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:
Miro Knejp 2016-06-28 18:33:17 +02:00
parent 6cb2c7f95c
commit 92d0d4e77e
262 changed files with 5 additions and 5 deletions

View File

@ -161,14 +161,14 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_definitions(/FAs)
endif()
include_directories("${PROJECT_SOURCE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}/include")
include_directories("${PROJECT_SOURCE_DIR}/test/external")
add_subdirectory(glm)
add_subdirectory(include/glm)
add_subdirectory(test)
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(
"${CMAKE_CURRENT_BINARY_DIR}/glmVersion.cmake"
@ -203,7 +203,7 @@ if (NOT CMAKE_VERSION VERSION_LESS "3.0")
add_library(glm INTERFACE)
target_include_directories(glm INTERFACE
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
install(TARGETS glm EXPORT glmTargets)

View File

@ -1,5 +1,5 @@
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")
include("${CMAKE_CURRENT_LIST_DIR}/glmTargets.cmake")

Some files were not shown because too many files have changed in this diff Show More