2019-11-02 10:57:42 +00:00
|
|
|
option(GLM_QUIET "No CMake Message" OFF)
|
|
|
|
|
|
|
|
option(GLM_TEST_ENABLE "Build unit tests" ON)
|
2023-12-28 15:50:25 +00:00
|
|
|
option(GLM_PERF_TEST_ENABLE "Build perf tests" OFF)
|
2019-11-02 10:57:42 +00:00
|
|
|
|
2024-02-06 15:06:52 +00:00
|
|
|
# Compiler and default options
|
|
|
|
|
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
if(NOT GLM_QUIET)
|
|
|
|
message("GLM: Clang - ${CMAKE_CXX_COMPILER_ID} compiler")
|
|
|
|
endif()
|
|
|
|
|
2023-12-22 16:24:37 +00:00
|
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
2024-02-06 15:06:52 +00:00
|
|
|
if(NOT GLM_DISABLE_AUTO_DETECTION)
|
|
|
|
add_compile_options(-Werror -Weverything)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
|
|
|
if(NOT GLM_QUIET)
|
|
|
|
message("GLM: GCC - ${CMAKE_CXX_COMPILER_ID} compiler")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT GLM_DISABLE_AUTO_DETECTION)
|
|
|
|
add_compile_options(-Werror)
|
|
|
|
# add_compile_options(-Wpedantic)
|
|
|
|
# add_compile_options(-Wall)
|
|
|
|
# add_compile_options(-Wextra)
|
|
|
|
endif()
|
|
|
|
add_compile_options(-O2)
|
|
|
|
#add_compile_options(-Wno-long-long)
|
|
|
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
|
|
|
if(NOT GLM_QUIET)
|
|
|
|
message("GLM: Intel - ${CMAKE_CXX_COMPILER_ID} compiler")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
|
|
|
if(NOT GLM_QUIET)
|
|
|
|
message("GLM: Visual C++ - ${CMAKE_CXX_COMPILER_ID} compiler")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT GLM_DISABLE_AUTO_DETECTION)
|
|
|
|
add_compile_options(/W4 /WX)
|
|
|
|
endif()
|
|
|
|
# add_compile_options(/wd4309 /wd4324 /wd4389 /wd4127 /wd4267 /wd4146 /wd4201 /wd4464 /wd4514 /wd4701 /wd4820 /wd4365)
|
|
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
|
|
|
endif()
|
|
|
|
|
2010-12-17 01:33:17 +00:00
|
|
|
function(glmCreateTestGTC NAME)
|
2018-07-14 17:14:08 +00:00
|
|
|
set(SAMPLE_NAME test-${NAME})
|
|
|
|
add_executable(${SAMPLE_NAME} ${NAME}.cpp)
|
2011-02-21 13:25:13 +00:00
|
|
|
|
2018-07-14 17:14:08 +00:00
|
|
|
add_test(
|
|
|
|
NAME ${SAMPLE_NAME}
|
|
|
|
COMMAND $<TARGET_FILE:${SAMPLE_NAME}> )
|
2019-10-17 14:41:13 +00:00
|
|
|
target_link_libraries(${SAMPLE_NAME} PRIVATE glm::glm)
|
2011-02-15 17:25:21 +00:00
|
|
|
endfunction()
|
2010-12-17 01:33:17 +00:00
|
|
|
|
2018-07-29 16:20:43 +00:00
|
|
|
if(GLM_TEST_ENABLE)
|
|
|
|
add_subdirectory(bug)
|
|
|
|
add_subdirectory(core)
|
|
|
|
add_subdirectory(ext)
|
|
|
|
add_subdirectory(gtc)
|
|
|
|
add_subdirectory(gtx)
|
2023-12-28 15:50:25 +00:00
|
|
|
endif()
|
|
|
|
if(GLM_PERF_TEST_ENABLE)
|
2018-08-19 09:24:56 +00:00
|
|
|
add_subdirectory(perf)
|
2018-07-29 16:20:43 +00:00
|
|
|
endif()
|
2011-01-19 16:14:23 +00:00
|
|
|
|