CMakeLists.txt 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. file(GLOB ROOT_SOURCE *.cpp)
  2. file(GLOB ROOT_INLINE *.inl)
  3. file(GLOB ROOT_HEADER *.hpp)
  4. file(GLOB ROOT_TEXT ../*.txt)
  5. file(GLOB ROOT_MD ../*.md)
  6. file(GLOB ROOT_NAT ../util/glm.natvis)
  7. file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp)
  8. file(GLOB_RECURSE CORE_INLINE ./detail/*.inl)
  9. file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp)
  10. file(GLOB_RECURSE EXT_SOURCE ./ext/*.cpp)
  11. file(GLOB_RECURSE EXT_INLINE ./ext/*.inl)
  12. file(GLOB_RECURSE EXT_HEADER ./ext/*.hpp)
  13. file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp)
  14. file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl)
  15. file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp)
  16. file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp)
  17. file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl)
  18. file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp)
  19. file(GLOB_RECURSE SIMD_SOURCE ./simd/*.cpp)
  20. file(GLOB_RECURSE SIMD_INLINE ./simd/*.inl)
  21. file(GLOB_RECURSE SIMD_HEADER ./simd/*.h)
  22. source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD})
  23. source_group("Core Files" FILES ${CORE_SOURCE})
  24. source_group("Core Files" FILES ${CORE_INLINE})
  25. source_group("Core Files" FILES ${CORE_HEADER})
  26. source_group("EXT Files" FILES ${EXT_SOURCE})
  27. source_group("EXT Files" FILES ${EXT_INLINE})
  28. source_group("EXT Files" FILES ${EXT_HEADER})
  29. source_group("GTC Files" FILES ${GTC_SOURCE})
  30. source_group("GTC Files" FILES ${GTC_INLINE})
  31. source_group("GTC Files" FILES ${GTC_HEADER})
  32. source_group("GTX Files" FILES ${GTX_SOURCE})
  33. source_group("GTX Files" FILES ${GTX_INLINE})
  34. source_group("GTX Files" FILES ${GTX_HEADER})
  35. source_group("SIMD Files" FILES ${SIMD_SOURCE})
  36. source_group("SIMD Files" FILES ${SIMD_INLINE})
  37. source_group("SIMD Files" FILES ${SIMD_HEADER})
  38. add_library(glm INTERFACE)
  39. target_include_directories(glm INTERFACE ../)
  40. if(BUILD_STATIC_LIBS)
  41. add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
  42. ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
  43. ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
  44. ${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
  45. ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
  46. ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
  47. ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
  48. target_link_libraries(glm_static PUBLIC glm)
  49. add_library(glm::glm_static ALIAS glm_static)
  50. endif()
  51. if(BUILD_SHARED_LIBS)
  52. add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT}
  53. ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
  54. ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
  55. ${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER}
  56. ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
  57. ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}
  58. ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER})
  59. target_link_libraries(glm_shared PUBLIC glm)
  60. add_library(glm::glm_shared ALIAS glm_shared)
  61. endif()