Export targets from top-level CMake file
With some slight reordering of the code
This commit is contained in:
parent
3e99386b6f
commit
631faffab3
@ -22,13 +22,18 @@ add_library(glm::glm ALIAS glm)
|
||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
include(CPack)
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS glm EXPORT glm)
|
||||
install(DIRECTORY glm TYPE INCLUDE PATTERN "CMakeLists.txt" EXCLUDE)
|
||||
install(EXPORT glm FILE glmConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glm NAMESPACE glm::)
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file("glmConfigVersion.cmake" COMPATIBILITY AnyNewerVersion ARCH_INDEPENDENT)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glm)
|
||||
|
||||
enable_testing()
|
||||
add_subdirectory(test)
|
||||
include(CTest)
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
||||
endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
|
@ -49,10 +49,6 @@ target_include_directories(glm INTERFACE
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS glm EXPORT glm)
|
||||
install(DIRECTORY . DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/glm" PATTERN "CMakeLists.txt" EXCLUDE)
|
||||
|
||||
if(BUILD_STATIC_LIBS)
|
||||
add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
|
||||
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
|
||||
|
Loading…
Reference in New Issue
Block a user