Re-add the glm interface library in cmake

Also re-work the main cmakelists to make the project more easily embeddable
This commit is contained in:
Krzysztof Kurek 2019-10-15 14:49:30 +02:00 committed by kiroma
parent ea678faff9
commit e791090589
No known key found for this signature in database
GPG Key ID: 388ED27EE6311049
2 changed files with 14 additions and 7 deletions

View File

@ -4,6 +4,13 @@ cmake_policy(VERSION 3.2)
set(GLM_VERSION "0.9.9") set(GLM_VERSION "0.9.9")
project(glm VERSION ${GLM_VERSION} LANGUAGES CXX) project(glm VERSION ${GLM_VERSION} LANGUAGES CXX)
add_subdirectory(glm)
add_library(glm::glm ALIAS glm)
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(test)
enable_testing() enable_testing()
option(GLM_QUIET "No CMake Message" OFF) option(GLM_QUIET "No CMake Message" OFF)
@ -232,8 +239,4 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif() endif()
include_directories("${PROJECT_SOURCE_DIR}") endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(glm)
add_subdirectory(test)

View File

@ -42,7 +42,8 @@ source_group("SIMD Files" FILES ${SIMD_SOURCE})
source_group("SIMD Files" FILES ${SIMD_INLINE}) source_group("SIMD Files" FILES ${SIMD_INLINE})
source_group("SIMD Files" FILES ${SIMD_HEADER}) source_group("SIMD Files" FILES ${SIMD_HEADER})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) add_library(glm INTERFACE)
target_include_directories(glm INTERFACE ../)
if(BUILD_STATIC_LIBS) if(BUILD_STATIC_LIBS)
add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
@ -52,6 +53,8 @@ add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
target_link_libraries(glm_static PUBLIC glm)
add_library(glm::glm_static ALIAS glm_static)
endif() endif()
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
@ -62,5 +65,6 @@ add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
target_link_libraries(glm_shared PUBLIC glm)
add_library(glm::glm_shared ALIAS glm_shared)
endif() endif()