Files
OpenVulkano/3rdParty/glm/CMakeLists.txt
Georg Hagen 0f2241762b Update glm
2025-11-08 13:19:11 +01:00

29 lines
850 B
CMake

include(FetchContent)
if(NOT DEFINED GLM_REPO)
set(GLM_REPO https://github.com/g-truc/glm.git)
endif ()
FetchContent_Declare(
glm
EXCLUDE_FROM_ALL
GIT_REPOSITORY ${GLM_REPO}
GIT_TAG 1.0.2
GIT_SHALLOW TRUE
)
set(GLM_TEST_ENABLE OFF CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(glm)
function(SetGlmDefines TARGET)
target_compile_definitions(${TARGET} PUBLIC GLM_FORCE_SILENT_WARNINGS)
target_compile_definitions(${TARGET} PUBLIC GLM_ENABLE_EXPERIMENTAL)
target_compile_definitions(${TARGET} PUBLIC GLM_FORCE_ALIGNED_GENTYPES)
if (NOT ANDROID AND NOT APPLE)
# TODO check target architecture first
target_compile_definitions(${TARGET} PUBLIC GLM_FORCE_AVX2)
else ()
target_compile_definitions(${TARGET} PUBLIC GLM_FORCE_INTRINSICS)
endif ()
endfunction()