mirror of
https://github.com/g-truc/glm.git
synced 2024-11-16 14:54:35 +00:00
Move header files from /glm to /include/glm subfolder
This makes it safer to include GLM as sources instead of install. By not having the repository root as the header search path, but a dedicated subfolder instead, chances of name clashes are reduced and the amount of options displayed in IDEs is vastly reduced and disambiguated. This change should not affect anyone relying on CMake's automatic header search path setting of target dependencies. A re-run of cmake may be necessary if it doesn't automatically pickup the changes. Already installed/exported packages should not be affected. Those already building from sources and managing search paths manually need to switch from "path/to/glm" to "path/to/glm/include".
This commit is contained in:
parent
6cb2c7f95c
commit
92d0d4e77e
@ -161,14 +161,14 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|||||||
add_definitions(/FAs)
|
add_definitions(/FAs)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories("${PROJECT_SOURCE_DIR}")
|
include_directories("${PROJECT_SOURCE_DIR}/include")
|
||||||
include_directories("${PROJECT_SOURCE_DIR}/test/external")
|
include_directories("${PROJECT_SOURCE_DIR}/test/external")
|
||||||
|
|
||||||
add_subdirectory(glm)
|
add_subdirectory(include/glm)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
|
|
||||||
set(GLM_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/glm")
|
set(GLM_INSTALL_CONFIGDIR "${CMAKE_INSTALL_LIBDIR}/cmake/glm")
|
||||||
install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
install(DIRECTORY include/glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
|
|
||||||
write_basic_package_version_file(
|
write_basic_package_version_file(
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/glmVersion.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/glmVersion.cmake"
|
||||||
@ -203,7 +203,7 @@ if (NOT CMAKE_VERSION VERSION_LESS "3.0")
|
|||||||
add_library(glm INTERFACE)
|
add_library(glm INTERFACE)
|
||||||
target_include_directories(glm INTERFACE
|
target_include_directories(glm INTERFACE
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
)
|
)
|
||||||
install(TARGETS glm EXPORT glmTargets)
|
install(TARGETS glm EXPORT glmTargets)
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
set(GLM_VERSION "@GLM_VERSION@")
|
set(GLM_VERSION "@GLM_VERSION@")
|
||||||
set(GLM_INCLUDE_DIRS "@CMAKE_CURRENT_SOURCE_DIR@")
|
set(GLM_INCLUDE_DIRS "@CMAKE_CURRENT_SOURCE_DIR@/include")
|
||||||
|
|
||||||
if (NOT CMAKE_VERSION VERSION_LESS "3.0")
|
if (NOT CMAKE_VERSION VERSION_LESS "3.0")
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/glmTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/glmTargets.cmake")
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user