From ab2853e9d1ea9ae06562c641dace606647dca01b Mon Sep 17 00:00:00 2001 From: "Brian J. Davis" Date: Sun, 9 Apr 2017 13:16:43 -0500 Subject: [PATCH] request to add version info to include, package install, and project name --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5c87550..8a023872 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,9 +4,13 @@ if (NOT CMAKE_VERSION VERSION_LESS "3.1") cmake_policy(SET CMP0054 NEW) endif() -project(glm) set(GLM_VERSION "0.9.9") +# On windows sets default install directory to C:\Program Files\glm- +set(GLM_PACKAGE_NAME glm-${GLM_VERSION}) +project(${GLM_PACKAGE_NAME}) + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(GNUInstallDirs) @@ -171,9 +175,10 @@ include_directories("${PROJECT_SOURCE_DIR}/test/external") add_subdirectory(glm) add_subdirectory(test) -set(GLM_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/glm") +set(GLM_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/${GLM_PACKAGE_NAME}") if (GLM_INSTALL_ENABLE) - install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + # Now include dir will have glm version info allowing multiple installs in same install path + install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${GLM_PACKAGE_NAME}) endif() write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake" VERSION ${GLM_VERSION} COMPATIBILITY AnyNewerVersion)