From 084804111e877dab464792c911c17ac43a105713 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 1 May 2015 20:40:45 +0200 Subject: [PATCH] Fixed CMake build on 2.8 versions --- CMakeLists.txt | 60 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc6818bc..c408aa6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,37 +147,37 @@ add_subdirectory(test) set(GLM_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/glm") install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -include(CMakePackageConfigHelpers) -write_basic_package_version_file( - "${CMAKE_CURRENT_BINARY_DIR}/glmVersion.cmake" - VERSION ${GLM_VERSION} - COMPATIBILITY AnyNewerVersion -) - -# build tree package config -configure_file( - cmake/glmBuildConfig.cmake.in - glmConfig.cmake - COPYONLY -) - -# install tree package config -configure_package_config_file( - cmake/glmConfig.cmake.in - ${GLM_INSTALL_CONFIGDIR}/glmConfig.cmake - INSTALL_DESTINATION ${GLM_INSTALL_CONFIGDIR} - PATH_VARS CMAKE_INSTALL_INCLUDEDIR - NO_CHECK_REQUIRED_COMPONENTS_MACRO -) - -install( - FILES - "${CMAKE_CURRENT_BINARY_DIR}/glmConfig.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/glmVersion.cmake" - DESTINATION ${GLM_INSTALL_CONFIGDIR} -) - if (NOT CMAKE_VERSION VERSION_LESS "2.8.12") + include(CMakePackageConfigHelpers) + write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/glmVersion.cmake" + VERSION ${GLM_VERSION} + COMPATIBILITY AnyNewerVersion + ) + + # build tree package config + configure_file( + cmake/glmBuildConfig.cmake.in + glmConfig.cmake + COPYONLY + ) + + # install tree package config + configure_package_config_file( + cmake/glmConfig.cmake.in + ${GLM_INSTALL_CONFIGDIR}/glmConfig.cmake + INSTALL_DESTINATION ${GLM_INSTALL_CONFIGDIR} + PATH_VARS CMAKE_INSTALL_INCLUDEDIR + NO_CHECK_REQUIRED_COMPONENTS_MACRO + ) + + install( + FILES + "${CMAKE_CURRENT_BINARY_DIR}/glmConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/glmVersion.cmake" + DESTINATION ${GLM_INSTALL_CONFIGDIR} + ) + add_library(glm INTERFACE) target_include_directories(glm INTERFACE $