Skip to content

Commit fa3a15c

Browse files
committed
Use CMakeLists.txt in GLM source dir
Also simplified it a bit, excluding the unnecessary source files and adding the interface library on the top level CMakeLists.txt.
1 parent 50c0f02 commit fa3a15c

File tree

3 files changed

+20
-49
lines changed

3 files changed

+20
-49
lines changed

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ option(ENABLE_CXX_INTERFACE "Enable exporting C++ symbols for ProjectM and PCM c
8181

8282
if(ENABLE_SYSTEM_GLM)
8383
find_package(GLM REQUIRED)
84-
else()
85-
add_library(GLM::GLM INTERFACE IMPORTED)
86-
set_target_properties(GLM::GLM PROPERTIES
87-
INTERFACE_INCLUDE_DIRECTORIES "${PROJECTM_SOURCE_DIR}/vendor"
88-
)
8984
endif()
9085

9186
if(NOT BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "Windows")

vendor/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
if(NOT ENABLE_SYSTEM_GLM)
2+
add_subdirectory(glm)
3+
endif()
14
add_subdirectory(hlslparser)
25
add_subdirectory(projectm-eval)
36
add_subdirectory(SOIL2)

vendor/glm/CMakeLists.txt

Lines changed: 17 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,50 @@
1-
file(GLOB ROOT_SOURCE *.cpp)
21
file(GLOB ROOT_INLINE *.inl)
32
file(GLOB ROOT_HEADER *.hpp)
43
file(GLOB ROOT_TEXT ../*.txt)
54
file(GLOB ROOT_MD ../*.md)
65
file(GLOB ROOT_NAT ../util/glm.natvis)
76

8-
file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp)
97
file(GLOB_RECURSE CORE_INLINE ./detail/*.inl)
108
file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp)
119

12-
file(GLOB_RECURSE EXT_SOURCE ./ext/*.cpp)
1310
file(GLOB_RECURSE EXT_INLINE ./ext/*.inl)
1411
file(GLOB_RECURSE EXT_HEADER ./ext/*.hpp)
1512

16-
file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp)
1713
file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl)
1814
file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp)
1915

20-
file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp)
2116
file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl)
2217
file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp)
2318

24-
file(GLOB_RECURSE SIMD_SOURCE ./simd/*.cpp)
2519
file(GLOB_RECURSE SIMD_INLINE ./simd/*.inl)
2620
file(GLOB_RECURSE SIMD_HEADER ./simd/*.h)
2721

2822
source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD})
29-
source_group("Core Files" FILES ${CORE_SOURCE})
23+
3024
source_group("Core Files" FILES ${CORE_INLINE})
3125
source_group("Core Files" FILES ${CORE_HEADER})
32-
source_group("EXT Files" FILES ${EXT_SOURCE})
3326
source_group("EXT Files" FILES ${EXT_INLINE})
3427
source_group("EXT Files" FILES ${EXT_HEADER})
35-
source_group("GTC Files" FILES ${GTC_SOURCE})
3628
source_group("GTC Files" FILES ${GTC_INLINE})
3729
source_group("GTC Files" FILES ${GTC_HEADER})
38-
source_group("GTX Files" FILES ${GTX_SOURCE})
3930
source_group("GTX Files" FILES ${GTX_INLINE})
4031
source_group("GTX Files" FILES ${GTX_HEADER})
41-
source_group("SIMD Files" FILES ${SIMD_SOURCE})
4232
source_group("SIMD Files" FILES ${SIMD_INLINE})
4333
source_group("SIMD Files" FILES ${SIMD_HEADER})
4434

45-
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
46-
47-
if(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE)
48-
if(GLM_STATIC_LIBRARY_ENABLE)
49-
add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
50-
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
51-
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
52-
${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
53-
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
54-
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
55-
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
56-
endif(GLM_STATIC_LIBRARY_ENABLE)
57-
58-
if(GLM_DYNAMIC_LIBRARY_ENABLE)
59-
add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
60-
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
61-
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
62-
${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
63-
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
64-
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
65-
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
66-
endif(GLM_DYNAMIC_LIBRARY_ENABLE)
67-
68-
else(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE)
69-
add_executable(glm_dummy ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
70-
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
71-
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
72-
${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
73-
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
74-
${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
75-
${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
76-
77-
endif(GLM_STATIC_LIBRARY_ENABLE OR GLM_DYNAMIC_LIBRARY_ENABLE)
35+
add_library(glm INTERFACE
36+
${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
37+
${ROOT_INLINE} ${ROOT_HEADER}
38+
${CORE_INLINE} ${CORE_HEADER}
39+
${EXT_INLINE} ${EXT_HEADER}
40+
${GTC_INLINE} ${GTC_HEADER}
41+
${GTX_INLINE} ${GTX_HEADER}
42+
${SIMD_INLINE} ${SIMD_HEADER}
43+
)
44+
45+
target_include_directories(glm
46+
INTERFACE
47+
"${CMAKE_CURRENT_SOURCE_DIR}/.."
48+
)
49+
50+
add_library(GLM::GLM ALIAS glm)

0 commit comments

Comments
 (0)