2017-08-17 08:54:16 +00:00
|
|
|
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
|
|
|
|
cmake_policy(VERSION 3.2)
|
2010-04-29 10:56:52 +00:00
|
|
|
|
2020-05-02 16:32:19 +00:00
|
|
|
|
|
|
|
file(READ "glm/detail/setup.hpp" GLM_SETUP_FILE)
|
|
|
|
string(REGEX MATCH "#define[ ]+GLM_VERSION_MAJOR[ ]+([0-9]+)" _ ${GLM_SETUP_FILE})
|
|
|
|
set(GLM_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
|
|
|
string(REGEX MATCH "#define[ ]+GLM_VERSION_MINOR[ ]+([0-9]+)" _ ${GLM_SETUP_FILE})
|
|
|
|
set(GLM_VERSION_MINOR "${CMAKE_MATCH_1}")
|
|
|
|
string(REGEX MATCH "#define[ ]+GLM_VERSION_PATCH[ ]+([0-9]+)" _ ${GLM_SETUP_FILE})
|
|
|
|
set(GLM_VERSION_PATCH "${CMAKE_MATCH_1}")
|
|
|
|
string(REGEX MATCH "#define[ ]+GLM_VERSION_REVISION[ ]+([0-9]+)" _ ${GLM_SETUP_FILE})
|
|
|
|
set(GLM_VERSION_REVISION "${CMAKE_MATCH_1}")
|
|
|
|
|
|
|
|
set(GLM_VERSION ${GLM_VERSION_MAJOR}.${GLM_VERSION_MINOR}.${GLM_VERSION_PATCH}.${GLM_VERSION_REVISION})
|
2017-08-17 08:54:16 +00:00
|
|
|
project(glm VERSION ${GLM_VERSION} LANGUAGES CXX)
|
2020-05-02 16:32:19 +00:00
|
|
|
message(STATUS "GLM: Version " ${GLM_VERSION})
|
|
|
|
|
2019-10-15 12:49:30 +00:00
|
|
|
add_subdirectory(glm)
|
|
|
|
add_library(glm::glm ALIAS glm)
|
|
|
|
|
|
|
|
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
2021-01-30 22:00:41 +00:00
|
|
|
include(CPack)
|
2021-01-30 22:59:37 +00:00
|
|
|
install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PATTERN "CMakeLists.txt" EXCLUDE)
|
2021-01-30 22:00:41 +00:00
|
|
|
install(EXPORT glm FILE glmConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glm NAMESPACE glm::)
|
|
|
|
include(CMakePackageConfigHelpers)
|
2021-01-30 23:49:58 +00:00
|
|
|
write_basic_package_version_file("glmConfigVersion.cmake" COMPATIBILITY AnyNewerVersion)
|
2021-01-30 22:00:41 +00:00
|
|
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glm)
|
|
|
|
|
2021-01-30 22:35:37 +00:00
|
|
|
include(CTest)
|
|
|
|
if(BUILD_TESTING)
|
|
|
|
add_subdirectory(test)
|
|
|
|
endif()
|
2019-10-16 15:03:31 +00:00
|
|
|
|
2019-10-15 12:49:30 +00:00
|
|
|
endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
2021-01-30 22:00:41 +00:00
|
|
|
|
2021-03-06 07:58:58 +00:00
|
|
|
if (NOT TARGET uninstall)
|
|
|
|
configure_file(cmake/cmake_uninstall.cmake.in
|
|
|
|
cmake_uninstall.cmake IMMEDIATE @ONLY)
|
|
|
|
|
|
|
|
add_custom_target(uninstall
|
|
|
|
"${CMAKE_COMMAND}" -P
|
|
|
|
"${CMAKE_BINARY_DIR}/cmake_uninstall.cmake")
|
|
|
|
endif()
|