CMakeLists.txt.in 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. cmake_minimum_required(VERSION 3.0)
  2. project(OpenCSG)
  3. if (NOT BUILD_SHARED_LIBS)
  4. set(GLEW_USE_STATIC_LIBS ON)
  5. elseif (MSVC)
  6. set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
  7. endif()
  8. find_package(OpenGL REQUIRED)
  9. set(GLEW_VERBOSE ON)
  10. find_package(GLEW 1.13.0 REQUIRED)
  11. set(_srcfiles
  12. src/area.cpp
  13. src/batch.cpp
  14. src/context.cpp
  15. src/channelManager.cpp
  16. src/frameBufferObject.cpp
  17. src/frameBufferObjectExt.cpp
  18. src/occlusionQuery.cpp
  19. src/opencsgRender.cpp
  20. src/openglHelper.cpp
  21. src/pBufferTexture.cpp
  22. src/primitive.cpp
  23. src/primitiveHelper.cpp
  24. src/renderGoldfeather.cpp
  25. src/renderSCS.cpp
  26. src/scissorMemo.cpp
  27. src/settings.cpp
  28. src/stencilManager.cpp
  29. RenderTexture/RenderTexture.cpp
  30. include/opencsg.h
  31. src/opencsgConfig.h
  32. src/area.h
  33. src/batch.h
  34. src/context.h
  35. src/channelManager.h
  36. src/frameBufferObject.h
  37. src/frameBufferObjectExt.h
  38. src/occlusionQuery.h
  39. src/offscreenBuffer.h
  40. src/opencsgRender.h
  41. src/openglHelper.h
  42. src/pBufferTexture.h
  43. src/primitiveHelper.h
  44. src/scissorMemo.h
  45. src/settings.h
  46. src/stencilManager.h
  47. )
  48. add_library(opencsg ${_srcfiles})
  49. target_include_directories(opencsg PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>)
  50. target_include_directories(opencsg PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>)
  51. target_link_libraries(opencsg PRIVATE GLEW::GLEW OpenGL::GL)
  52. include(CMakePackageConfigHelpers)
  53. include(GNUInstallDirs)
  54. write_basic_package_version_file(
  55. "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
  56. VERSION 1.4.2
  57. COMPATIBILITY AnyNewerVersion
  58. )
  59. install(TARGETS opencsg
  60. EXPORT ${PROJECT_NAME}Targets
  61. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  62. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  63. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  64. INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
  65. export(EXPORT ${PROJECT_NAME}Targets
  66. FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
  67. NAMESPACE ${PROJECT_NAME}:: )
  68. set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
  69. install(EXPORT ${PROJECT_NAME}Targets
  70. FILE
  71. "${PROJECT_NAME}Config.cmake"
  72. NAMESPACE
  73. ${PROJECT_NAME}::
  74. DESTINATION
  75. ${ConfigPackageLocation}
  76. )
  77. install(
  78. FILES
  79. ${PROJECT_SOURCE_DIR}/include/opencsg.h
  80. DESTINATION
  81. ${CMAKE_INSTALL_INCLUDEDIR}/opencsg
  82. )
  83. install(
  84. FILES
  85. "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
  86. DESTINATION
  87. ${ConfigPackageLocation}
  88. )