summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-05-13 00:39:40 +0200
committerMarius Bakke <mbakke@fastmail.com>2020-05-13 00:57:15 +0200
commit1a75fc8442cb2c9fa644d52f600e608279c87698 (patch)
tree62b65a5c9ae1aabca42ddca3f3c5c6503ac5a095 /gnu
parent5d5327c2ba78f28993d73a3e19d9f489b5b4968e (diff)
gnu: glm: Update to 0.9.9.8.
* gnu/packages/patches/glm-restore-install-target.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/maths.scm (glm): Update to 0.9.9.8. [arguments]: New field.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/maths.scm33
-rw-r--r--gnu/packages/patches/glm-restore-install-target.patch574
3 files changed, 30 insertions, 578 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 02542cc820b..013e7d93c24 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1018,7 +1018,6 @@ dist_patch_DATA = \
1018 %D%/packages/patches/glibc-2.28-supported-locales.patch \ 1018 %D%/packages/patches/glibc-2.28-supported-locales.patch \
1019 %D%/packages/patches/glibc-2.29-supported-locales.patch \ 1019 %D%/packages/patches/glibc-2.29-supported-locales.patch \
1020 %D%/packages/patches/glibc-supported-locales.patch \ 1020 %D%/packages/patches/glibc-supported-locales.patch \
1021 %D%/packages/patches/glm-restore-install-target.patch \
1022 %D%/packages/patches/gmp-arm-asm-nothumb.patch \ 1021 %D%/packages/patches/gmp-arm-asm-nothumb.patch \
1023 %D%/packages/patches/gmp-faulty-test.patch \ 1022 %D%/packages/patches/gmp-faulty-test.patch \
1024 %D%/packages/patches/gnome-shell-theme.patch \ 1023 %D%/packages/patches/gnome-shell-theme.patch \
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 9df547f1b41..817763f79e8 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -3760,16 +3760,43 @@ Failure to do so will result in a library with poor performance.")
3760(define-public glm 3760(define-public glm
3761 (package 3761 (package
3762 (name "glm") 3762 (name "glm")
3763 (version "0.9.9.6") 3763 (version "0.9.9.8")
3764 (source 3764 (source
3765 (origin 3765 (origin
3766 (method url-fetch) 3766 (method url-fetch)
3767 (uri (string-append "https://github.com/g-truc/glm/releases/download/" 3767 (uri (string-append "https://github.com/g-truc/glm/releases/download/"
3768 version "/glm-" version ".zip")) 3768 version "/glm-" version ".zip"))
3769 (sha256 3769 (sha256
3770 (base32 "1l0pi1qi37mk6s0yrkrw07lspv4gcqnr9ryg3521hrl77ff37dwx")) 3770 (base32 "0k6yk9v46h690rshdx49x98y5qspkzibld1wb51jwcm35vba7qip"))))
3771 (patches (search-patches "glm-restore-install-target.patch"))))
3772 (build-system cmake-build-system) 3771 (build-system cmake-build-system)
3772 (arguments
3773 `(#:phases (modify-phases %standard-phases
3774 (replace 'install
3775 (lambda* (#:key outputs #:allow-other-keys)
3776 ;; Since version 0.9.9.6, 'make install' is not supported
3777 ;; and we have to do it "manually". Upstream discussion:
3778 ;; <https://github.com/g-truc/glm/pull/968>.
3779 (let* ((source (string-append "../glm"))
3780 (out (assoc-ref outputs "out"))
3781 (inc (string-append out "/include"))
3782 (lib (string-append out "/lib"))
3783 (pkgconfig (string-append lib "/pkgconfig")))
3784 (with-directory-excursion source
3785 (mkdir-p inc)
3786 (mkdir-p pkgconfig)
3787 (copy-recursively "glm" (string-append inc "/glm"))
3788 (copy-recursively "cmake" (string-append lib "/cmake"))
3789 (call-with-output-file (string-append pkgconfig "/glm.pc")
3790 (lambda (port)
3791 (format port
3792 "prefix=~a
3793includedir=${prefix}/include
3794
3795Name: GLM
3796Description: OpenGL Mathematics
3797Version: ~a
3798Cflags: -I${includedir}~%" out ,(version-prefix version 3)))))
3799 #t))))))
3773 (native-inputs 3800 (native-inputs
3774 `(("unzip" ,unzip))) 3801 `(("unzip" ,unzip)))
3775 (home-page "https://glm.g-truc.net/") 3802 (home-page "https://glm.g-truc.net/")
diff --git a/gnu/packages/patches/glm-restore-install-target.patch b/gnu/packages/patches/glm-restore-install-target.patch
deleted file mode 100644
index a628030f6ff..00000000000
--- a/gnu/packages/patches/glm-restore-install-target.patch
+++ /dev/null
@@ -1,574 +0,0 @@
1From: Tobias Geerinckx-Rice <me@tobias.gr>
2Date: Mon, 23 Sep 2019 22:01:17 +0200
3Subject: [PATCH] gnu: glm: Restore ‘install’ target.
4
5It was removed in 0.9.9.6, making installation a tedious manual process
6for no clear reason[0]. Restore it for now.
7
8[0]: https://github.com/g-truc/glm/issues/947
9
10diff -Naur glm/cmake/CMakePackageConfigHelpers.cmake glmn/cmake/CMakePackageConfigHelpers.cmake
11--- glm/cmake/CMakePackageConfigHelpers.cmake 1970-01-01 01:00:00.000000000 +0100
12+++ glmn/cmake/CMakePackageConfigHelpers.cmake 2019-09-23 00:11:21.418152249 +0200
13@@ -0,0 +1,227 @@
14+# - CONFIGURE_PACKAGE_CONFIG_FILE(), WRITE_BASIC_PACKAGE_VERSION_FILE()
15+#
16+# CONFIGURE_PACKAGE_CONFIG_FILE(<input> <output> INSTALL_DESTINATION <path>
17+# [PATH_VARS <var1> <var2> ... <varN>]
18+# [NO_SET_AND_CHECK_MACRO]
19+# [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
20+#
21+# CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain
22+# CONFIGURE_FILE() command when creating the <Name>Config.cmake or <Name>-config.cmake
23+# file for installing a project or library. It helps making the resulting package
24+# relocatable by avoiding hardcoded paths in the installed Config.cmake file.
25+#
26+# In a FooConfig.cmake file there may be code like this to make the
27+# install destinations know to the using project:
28+# set(FOO_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
29+# set(FOO_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
30+# set(FOO_ICONS_DIR "@CMAKE_INSTALL_PREFIX@/share/icons" )
31+# ...logic to determine installedPrefix from the own location...
32+# set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
33+# All 4 options shown above are not sufficient, since the first 3 hardcode
34+# the absolute directory locations, and the 4th case works only if the logic
35+# to determine the installedPrefix is correct, and if CONFIG_INSTALL_DIR contains
36+# a relative path, which in general cannot be guaranteed.
37+# This has the effect that the resulting FooConfig.cmake file would work poorly
38+# under Windows and OSX, where users are used to choose the install location
39+# of a binary package at install time, independent from how CMAKE_INSTALL_PREFIX
40+# was set at build/cmake time.
41+#
42+# Using CONFIGURE_PACKAGE_CONFIG_FILE() helps. If used correctly, it makes the
43+# resulting FooConfig.cmake file relocatable.
44+# Usage:
45+# 1. write a FooConfig.cmake.in file as you are used to
46+# 2. insert a line containing only the string "@PACKAGE_INIT@"
47+# 3. instead of SET(FOO_DIR "@SOME_INSTALL_DIR@"), use SET(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
48+# (this must be after the @PACKAGE_INIT@ line)
49+# 4. instead of using the normal CONFIGURE_FILE(), use CONFIGURE_PACKAGE_CONFIG_FILE()
50+#
51+# The <input> and <output> arguments are the input and output file, the same way
52+# as in CONFIGURE_FILE().
53+#
54+# The <path> given to INSTALL_DESTINATION must be the destination where the FooConfig.cmake
55+# file will be installed to. This can either be a relative or absolute path, both work.
56+#
57+# The variables <var1> to <varN> given as PATH_VARS are the variables which contain
58+# install destinations. For each of them the macro will create a helper variable
59+# PACKAGE_<var...>. These helper variables must be used
60+# in the FooConfig.cmake.in file for setting the installed location. They are calculated
61+# by CONFIGURE_PACKAGE_CONFIG_FILE() so that they are always relative to the
62+# installed location of the package. This works both for relative and also for absolute locations.
63+# For absolute locations it works only if the absolute location is a subdirectory
64+# of CMAKE_INSTALL_PREFIX.
65+#
66+# By default configure_package_config_file() also generates two helper macros,
67+# set_and_check() and check_required_components() into the FooConfig.cmake file.
68+#
69+# set_and_check() should be used instead of the normal set()
70+# command for setting directories and file locations. Additionally to setting the
71+# variable it also checks that the referenced file or directory actually exists
72+# and fails with a FATAL_ERROR otherwise. This makes sure that the created
73+# FooConfig.cmake file does not contain wrong references.
74+# When using the NO_SET_AND_CHECK_MACRO, this macro is not generated into the
75+# FooConfig.cmake file.
76+#
77+# check_required_components(<package_name>) should be called at the end of the
78+# FooConfig.cmake file if the package supports components.
79+# This macro checks whether all requested, non-optional components have been found,
80+# and if this is not the case, sets the Foo_FOUND variable to FALSE, so that the package
81+# is considered to be not found.
82+# It does that by testing the Foo_<Component>_FOUND variables for all requested
83+# required components.
84+# When using the NO_CHECK_REQUIRED_COMPONENTS option, this macro is not generated
85+# into the FooConfig.cmake file.
86+#
87+# For an example see below the documentation for WRITE_BASIC_PACKAGE_VERSION_FILE().
88+#
89+#
90+# WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
91+#
92+# Writes a file for use as <package>ConfigVersion.cmake file to <filename>.
93+# See the documentation of FIND_PACKAGE() for details on this.
94+# filename is the output filename, it should be in the build tree.
95+# major.minor.patch is the version number of the project to be installed
96+# The COMPATIBILITY mode AnyNewerVersion means that the installed package version
97+# will be considered compatible if it is newer or exactly the same as the requested version.
98+# This mode should be used for packages which are fully backward compatible,
99+# also across major versions.
100+# If SameMajorVersion is used instead, then the behaviour differs from AnyNewerVersion
101+# in that the major version number must be the same as requested, e.g. version 2.0 will
102+# not be considered compatible if 1.0 is requested.
103+# This mode should be used for packages which guarantee backward compatibility within the
104+# same major version.
105+# If ExactVersion is used, then the package is only considered compatible if the requested
106+# version matches exactly its own version number (not considering the tweak version).
107+# For example, version 1.2.3 of a package is only considered compatible to requested version 1.2.3.
108+# This mode is for packages without compatibility guarantees.
109+# If your project has more elaborated version matching rules, you will need to write your
110+# own custom ConfigVersion.cmake file instead of using this macro.
111+#
112+# Internally, this macro executes configure_file() to create the resulting
113+# version file. Depending on the COMPATIBILITY, either the file
114+# BasicConfigVersion-SameMajorVersion.cmake.in or BasicConfigVersion-AnyNewerVersion.cmake.in
115+# is used. Please note that these two files are internal to CMake and you should
116+# not call configure_file() on them yourself, but they can be used as starting
117+# point to create more sophisticted custom ConfigVersion.cmake files.
118+#
119+#
120+# Example using both configure_package_config_file() and write_basic_package_version_file():
121+# CMakeLists.txt:
122+# set(INCLUDE_INSTALL_DIR include/ ... CACHE )
123+# set(LIB_INSTALL_DIR lib/ ... CACHE )
124+# set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
125+# ...
126+# include(CMakePackageConfigHelpers)
127+# configure_package_config_file(FooConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
128+# INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
129+# PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
130+# write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
131+# VERSION 1.2.3
132+# COMPATIBILITY SameMajorVersion )
133+# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
134+# DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
135+#
136+# With a FooConfig.cmake.in:
137+# set(FOO_VERSION x.y.z)
138+# ...
139+# @PACKAGE_INIT@
140+# ...
141+# set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
142+# set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
143+#
144+# check_required_components(Foo)
145+
146+
147+#=============================================================================
148+# Copyright 2012 Alexander Neundorf <neundorf@kde.org>
149+#
150+# Distributed under the OSI-approved BSD License (the "License");
151+# see accompanying file Copyright.txt for details.
152+#
153+# This software is distributed WITHOUT ANY WARRANTY; without even the
154+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
155+# See the License for more information.
156+#=============================================================================
157+# (To distribute this file outside of CMake, substitute the full
158+# License text for the above reference.)
159+
160+include(CMakeParseArguments)
161+
162+include(WriteBasicConfigVersionFile)
163+
164+macro(WRITE_BASIC_PACKAGE_VERSION_FILE)
165+ write_basic_config_version_file(${ARGN})
166+endmacro()
167+
168+
169+function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
170+ set(options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO)
171+ set(oneValueArgs INSTALL_DESTINATION )
172+ set(multiValueArgs PATH_VARS )
173+
174+ cmake_parse_arguments(CCF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
175+
176+ if(CCF_UNPARSED_ARGUMENTS)
177+ message(FATAL_ERROR "Unknown keywords given to CONFIGURE_PACKAGE_CONFIG_FILE(): \"${CCF_UNPARSED_ARGUMENTS}\"")
178+ endif()
179+
180+ if(NOT CCF_INSTALL_DESTINATION)
181+ message(FATAL_ERROR "No INSTALL_DESTINATION given to CONFIGURE_PACKAGE_CONFIG_FILE()")
182+ endif()
183+
184+ if(IS_ABSOLUTE "${CCF_INSTALL_DESTINATION}")
185+ set(absInstallDir "${CCF_INSTALL_DESTINATION}")
186+ else()
187+ set(absInstallDir "${CMAKE_INSTALL_PREFIX}/${CCF_INSTALL_DESTINATION}")
188+ endif()
189+ file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${absInstallDir}" "${CMAKE_INSTALL_PREFIX}" )
190+
191+ foreach(var ${CCF_PATH_VARS})
192+ if(NOT DEFINED ${var})
193+ message(FATAL_ERROR "Variable ${var} does not exist")
194+ else()
195+ if(IS_ABSOLUTE "${${var}}")
196+ string(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}"
197+ PACKAGE_${var} "${${var}}")
198+ else()
199+ set(PACKAGE_${var} "\${PACKAGE_PREFIX_DIR}/${${var}}")
200+ endif()
201+ endif()
202+ endforeach()
203+
204+ set(PACKAGE_INIT "
205+####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
206+get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/${PACKAGE_RELATIVE_PATH}\" ABSOLUTE)
207+")
208+
209+ if(NOT CCF_NO_SET_AND_CHECK_MACRO)
210+ set(PACKAGE_INIT "${PACKAGE_INIT}
211+macro(set_and_check _var _file)
212+ set(\${_var} \"\${_file}\")
213+ if(NOT EXISTS \"\${_file}\")
214+ message(FATAL_ERROR \"File or directory \${_file} referenced by variable \${_var} does not exist !\")
215+ endif()
216+endmacro()
217+")
218+ endif()
219+
220+
221+ if(NOT CCF_NO_CHECK_REQUIRED_COMPONENTS_MACRO)
222+ set(PACKAGE_INIT "${PACKAGE_INIT}
223+macro(check_required_components _NAME)
224+ foreach(comp \${\${_NAME}_FIND_COMPONENTS})
225+ if(NOT \${_NAME}_\${comp}_FOUND)
226+ if(\${_NAME}_FIND_REQUIRED_\${comp})
227+ set(\${_NAME}_FOUND FALSE)
228+ endif()
229+ endif()
230+ endforeach(comp)
231+endmacro()
232+")
233+ endif()
234+
235+ set(PACKAGE_INIT "${PACKAGE_INIT}
236+####################################################################################")
237+
238+ configure_file("${_inputFile}" "${_outputFile}" @ONLY)
239+
240+endfunction()
241diff -Naur glm/cmake/glmBuildConfig.cmake.in glmn/cmake/glmBuildConfig.cmake.in
242--- glm/cmake/glmBuildConfig.cmake.in 1970-01-01 01:00:00.000000000 +0100
243+++ glmn/cmake/glmBuildConfig.cmake.in 2019-09-23 00:12:08.090955650 +0200
244@@ -0,0 +1,6 @@
245+set(GLM_VERSION "@GLM_VERSION@")
246+set(GLM_INCLUDE_DIRS "@CMAKE_CURRENT_SOURCE_DIR@")
247+
248+if (NOT CMAKE_VERSION VERSION_LESS "3.0")
249+ include("${CMAKE_CURRENT_LIST_DIR}/glmTargets.cmake")
250+endif()
251diff -Naur glm/cmake/glmConfig.cmake.in glmn/cmake/glmConfig.cmake.in
252--- glm/cmake/glmConfig.cmake.in 1970-01-01 01:00:00.000000000 +0100
253+++ glmn/cmake/glmConfig.cmake.in 2019-09-23 00:12:14.566373412 +0200
254@@ -0,0 +1,9 @@
255+set(GLM_VERSION "@GLM_VERSION@")
256+
257+@PACKAGE_INIT@
258+
259+set_and_check(GLM_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
260+
261+if (NOT CMAKE_VERSION VERSION_LESS "3.0")
262+ include("${CMAKE_CURRENT_LIST_DIR}/glmTargets.cmake")
263+endif()
264diff -Naur glm/cmake/glm.pc.in glmn/cmake/glm.pc.in
265--- glm/cmake/glm.pc.in 1970-01-01 01:00:00.000000000 +0100
266+++ glmn/cmake/glm.pc.in 2019-09-23 00:11:59.695710511 +0200
267@@ -0,0 +1,7 @@
268+prefix=@CMAKE_INSTALL_PREFIX@
269+includedir=${prefix}/include
270+
271+Name: GLM
272+Description: OpenGL Mathematics
273+Version: @GLM_VERSION@
274+Cflags: -I${includedir}
275diff -Naur glm/cmake/GNUInstallDirs.cmake glmn/cmake/GNUInstallDirs.cmake
276--- glm/cmake/GNUInstallDirs.cmake 1970-01-01 01:00:00.000000000 +0100
277+++ glmn/cmake/GNUInstallDirs.cmake 2019-09-23 00:11:47.363819337 +0200
278@@ -0,0 +1,188 @@
279+# - Define GNU standard installation directories
280+# Provides install directory variables as defined for GNU software:
281+# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
282+# Inclusion of this module defines the following variables:
283+# CMAKE_INSTALL_<dir> - destination for files of a given type
284+# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path
285+# where <dir> is one of:
286+# BINDIR - user executables (bin)
287+# SBINDIR - system admin executables (sbin)
288+# LIBEXECDIR - program executables (libexec)
289+# SYSCONFDIR - read-only single-machine data (etc)
290+# SHAREDSTATEDIR - modifiable architecture-independent data (com)
291+# LOCALSTATEDIR - modifiable single-machine data (var)
292+# LIBDIR - object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian)
293+# INCLUDEDIR - C header files (include)
294+# OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
295+# DATAROOTDIR - read-only architecture-independent data root (share)
296+# DATADIR - read-only architecture-independent data (DATAROOTDIR)
297+# INFODIR - info documentation (DATAROOTDIR/info)
298+# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale)
299+# MANDIR - man documentation (DATAROOTDIR/man)
300+# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME)
301+# Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION options of
302+# install() commands for the corresponding file type. If the includer does
303+# not define a value the above-shown default will be used and the value will
304+# appear in the cache for editing by the user.
305+# Each CMAKE_INSTALL_FULL_<dir> value contains an absolute path constructed
306+# from the corresponding destination by prepending (if necessary) the value
307+# of CMAKE_INSTALL_PREFIX.
308+
309+#=============================================================================
310+# Copyright 2011 Nikita Krupen'ko <krnekit@gmail.com>
311+# Copyright 2011 Kitware, Inc.
312+#
313+# Distributed under the OSI-approved BSD License (the "License");
314+# see accompanying file Copyright.txt for details.
315+#
316+# This software is distributed WITHOUT ANY WARRANTY; without even the
317+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
318+# See the License for more information.
319+#=============================================================================
320+# (To distribute this file outside of CMake, substitute the full
321+# License text for the above reference.)
322+
323+# Installation directories
324+#
325+if(NOT DEFINED CMAKE_INSTALL_BINDIR)
326+ set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
327+endif()
328+
329+if(NOT DEFINED CMAKE_INSTALL_SBINDIR)
330+ set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)")
331+endif()
332+
333+if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR)
334+ set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)")
335+endif()
336+
337+if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
338+ set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)")
339+endif()
340+
341+if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR)
342+ set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)")
343+endif()
344+
345+if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
346+ set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
347+endif()
348+
349+if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
350+ set(_LIBDIR_DEFAULT "lib")
351+ # Override this default 'lib' with 'lib64' iff:
352+ # - we are on Linux system but NOT cross-compiling
353+ # - we are NOT on debian
354+ # - we are on a 64 bits system
355+ # reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
356+ # For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
357+ # CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
358+ # See http://wiki.debian.org/Multiarch
359+ if((CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU")
360+ AND NOT CMAKE_CROSSCOMPILING)
361+ if (EXISTS "/etc/debian_version") # is this a debian system ?
362+ if(CMAKE_LIBRARY_ARCHITECTURE)
363+ set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
364+ endif()
365+ else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
366+ if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
367+ message(AUTHOR_WARNING
368+ "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
369+ "Please enable at least one language before including GNUInstallDirs.")
370+ else()
371+ if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
372+ set(_LIBDIR_DEFAULT "lib64")
373+ endif()
374+ endif()
375+ endif()
376+ endif()
377+ set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
378+endif()
379+
380+if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
381+ set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
382+endif()
383+
384+if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR)
385+ set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)")
386+endif()
387+
388+if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR)
389+ set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)")
390+endif()
391+
392+#-----------------------------------------------------------------------------
393+# Values whose defaults are relative to DATAROOTDIR. Store empty values in
394+# the cache and store the defaults in local variables if the cache values are
395+# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes.
396+
397+if(NOT CMAKE_INSTALL_DATADIR)
398+ set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)")
399+ set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}")
400+endif()
401+
402+if(NOT CMAKE_INSTALL_INFODIR)
403+ set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)")
404+ set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info")
405+endif()
406+
407+if(NOT CMAKE_INSTALL_LOCALEDIR)
408+ set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)")
409+ set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale")
410+endif()
411+
412+if(NOT CMAKE_INSTALL_MANDIR)
413+ set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)")
414+ set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man")
415+endif()
416+
417+if(NOT CMAKE_INSTALL_DOCDIR)
418+ set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
419+ set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}")
420+endif()
421+
422+#-----------------------------------------------------------------------------
423+
424+mark_as_advanced(
425+ CMAKE_INSTALL_BINDIR
426+ CMAKE_INSTALL_SBINDIR
427+ CMAKE_INSTALL_LIBEXECDIR
428+ CMAKE_INSTALL_SYSCONFDIR
429+ CMAKE_INSTALL_SHAREDSTATEDIR
430+ CMAKE_INSTALL_LOCALSTATEDIR
431+ CMAKE_INSTALL_LIBDIR
432+ CMAKE_INSTALL_INCLUDEDIR
433+ CMAKE_INSTALL_OLDINCLUDEDIR
434+ CMAKE_INSTALL_DATAROOTDIR
435+ CMAKE_INSTALL_DATADIR
436+ CMAKE_INSTALL_INFODIR
437+ CMAKE_INSTALL_LOCALEDIR
438+ CMAKE_INSTALL_MANDIR
439+ CMAKE_INSTALL_DOCDIR
440+ )
441+
442+# Result directories
443+#
444+foreach(dir
445+ BINDIR
446+ SBINDIR
447+ LIBEXECDIR
448+ SYSCONFDIR
449+ SHAREDSTATEDIR
450+ LOCALSTATEDIR
451+ LIBDIR
452+ INCLUDEDIR
453+ OLDINCLUDEDIR
454+ DATAROOTDIR
455+ DATADIR
456+ INFODIR
457+ LOCALEDIR
458+ MANDIR
459+ DOCDIR
460+ )
461+ if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
462+ set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
463+ else()
464+ set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")
465+ endif()
466+endforeach()
467diff -Naur glm/CMakeLists.txt glmn/CMakeLists.txt
468--- glm/CMakeLists.txt 2019-09-07 14:10:16.000000000 +0200
469+++ glmn/CMakeLists.txt 2019-09-23 00:10:29.559815104 +0200
470@@ -4,6 +4,11 @@
471 set(GLM_VERSION "0.9.9")
472 project(glm VERSION ${GLM_VERSION} LANGUAGES CXX)
473
474+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
475+
476+include(GNUInstallDirs)
477+include(CMakePackageConfigHelpers)
478+
479 enable_testing()
480
481 option(GLM_QUIET "No CMake Message" OFF)
482@@ -237,3 +242,62 @@
483 add_subdirectory(glm)
484 add_subdirectory(test)
485
486+set(GLM_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/glm")
487+install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
488+
489+
490+# CMake automatically adds an architecture compatibility check to make sure
491+# 32 and 64 bit code is not accidentally mixed. For a header-only library this
492+# is not required. The check can be disabled by temporarily unsetting
493+# CMAKE_SIZEOF_VOID_P. In CMake 3.14 and later this can be achieved more cleanly
494+# with write_basic_package_version_file(ARCH_INDEPENDENT).
495+# TODO: Use this once a newer CMake can be required.
496+set(GLM_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
497+unset(CMAKE_SIZEOF_VOID_P)
498+write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake" VERSION ${GLM_VERSION} COMPATIBILITY AnyNewerVersion)
499+set(CMAKE_SIZEOF_VOID_P ${GLM_SIZEOF_VOID_P})
500+
501+# build tree package config
502+configure_file(cmake/glmBuildConfig.cmake.in glmConfig.cmake @ONLY)
503+
504+# install tree package config
505+configure_package_config_file(
506+ cmake/glmConfig.cmake.in
507+ ${GLM_INSTALL_CONFIGDIR}/glmConfig.cmake
508+ INSTALL_DESTINATION ${GLM_INSTALL_CONFIGDIR}
509+ PATH_VARS CMAKE_INSTALL_INCLUDEDIR
510+ NO_CHECK_REQUIRED_COMPONENTS_MACRO)
511+
512+install(FILES
513+ "${CMAKE_CURRENT_BINARY_DIR}/${GLM_INSTALL_CONFIGDIR}/glmConfig.cmake"
514+ "${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake"
515+ DESTINATION ${GLM_INSTALL_CONFIGDIR})
516+
517+add_library(glm INTERFACE)
518+target_include_directories(glm INTERFACE
519+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
520+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
521+install(TARGETS glm EXPORT glmTargets)
522+
523+export(EXPORT glmTargets FILE "${CMAKE_CURRENT_BINARY_DIR}/glmTargets.cmake")
524+
525+install(EXPORT glmTargets FILE glmTargets.cmake DESTINATION ${GLM_INSTALL_CONFIGDIR})
526+
527+# build pkg-config file
528+configure_file("./cmake/glm.pc.in" "glm.pc" @ONLY)
529+
530+# install pkg-config file
531+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/glm.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
532+
533+export(PACKAGE glm)
534+
535+if(NOT TARGET uninstall)
536+ configure_file(
537+ ${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in
538+ ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
539+ IMMEDIATE @ONLY)
540+
541+ add_custom_target(uninstall
542+ COMMAND ${CMAKE_COMMAND} -P
543+ ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
544+endif()
545diff -Naur glm/cmake_uninstall.cmake.in glmn/cmake_uninstall.cmake.in
546--- glm/cmake_uninstall.cmake.in 1970-01-01 01:00:00.000000000 +0100
547+++ glmn/cmake_uninstall.cmake.in 2019-09-23 00:12:22.495660449 +0200
548@@ -0,0 +1,26 @@
549+if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
550+ message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
551+endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
552+
553+if (NOT DEFINED CMAKE_INSTALL_PREFIX)
554+ set (CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
555+endif ()
556+ message(${CMAKE_INSTALL_PREFIX})
557+
558+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
559+string(REGEX REPLACE "\n" ";" files "${files}")
560+foreach(file ${files})
561+ message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
562+ if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
563+ exec_program(
564+ "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
565+ OUTPUT_VARIABLE rm_out
566+ RETURN_VALUE rm_retval
567+ )
568+ if(NOT "${rm_retval}" STREQUAL 0)
569+ message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
570+ endif(NOT "${rm_retval}" STREQUAL 0)
571+ else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
572+ message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
573+ endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
574+endforeach(file)