diff --git a/CMakeLists.txt b/CMakeLists.txt index ceccb1e1..10bb1af0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,8 @@ include(CMakePackageConfigHelpers) enable_testing() option(GLM_QUIET "No CMake Message" OFF) +option(BUILD_SHARED_LIBS "Build shared library" ON) +option(BUILD_STATIC_LIBS "Build static library" ON) option(GLM_TEST_ENABLE_CXX_98 "Enable C++ 98" OFF) option(GLM_TEST_ENABLE_CXX_11 "Enable C++ 11" OFF) option(GLM_TEST_ENABLE_CXX_14 "Enable C++ 14" OFF) diff --git a/glm/CMakeLists.txt b/glm/CMakeLists.txt index 01c594f4..032340d4 100644 --- a/glm/CMakeLists.txt +++ b/glm/CMakeLists.txt @@ -44,6 +44,7 @@ source_group("SIMD Files" FILES ${SIMD_HEADER}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) +if(BUILD_STATIC_LIBS) add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} @@ -51,7 +52,9 @@ add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) +endif() +if(BUILD_SHARED_LIBS) add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} @@ -59,4 +62,5 @@ add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) +endif()