glm-0.9.9.6-install.patch 26 KB

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