openscenegraph.cmake 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. # Build OpenSceneGraph
  2. # The GitHub release (tag) we want to use
  3. SET(OPENSCENEGRAPH_TAG OpenSceneGraph-3.6.5)
  4. SET(OPENSCENEGRAPH_PREFIX openscenegraph)
  5. SET(OPENSCENEGRAPH_URL https://github.com/openscenegraph/OpenSceneGraph)
  6. # Configure OpenSceneGraph
  7. SET(DYNAMIC_OPENSCENEGRAPH ON CACHE INTERNAL "")
  8. SET(DYNAMIC_OPENTHREADS ON CACHE INTERNAL "")
  9. SET(BUILD_OSG_EXAMPLES OFF CACHE INTERNAL "")
  10. SET(BUILD_OSG_APPLICATIONS OFF CACHE INTERNAL "")
  11. SET(OSG_TEXT_USE_FONTCONFIG OFF CACHE INTERNAL "")
  12. SET(OSG_GL_LIBRARY_STATIC OFF CACHE INTERNAL "")
  13. ADD_COMPILE_DEFINITIONS(OSG_LIBRARY_STATIC)
  14. # Add OpenSceneGraph
  15. FETCHCONTENT_DECLARE(
  16. ${OPENSCENEGRAPH_PREFIX}
  17. PREFIX ${OPENSCENEGRAPH_PREFIX}
  18. GIT_REPOSITORY ${OPENSCENEGRAPH_URL}
  19. GIT_TAG ${OPENSCENEGRAPH_TAG}
  20. )
  21. FETCHCONTENT_GETPROPERTIES(${OPENSCENEGRAPH_PREFIX})
  22. IF(NOT ${OPENSCENEGRAPH_PREFIX}_POPULATED)
  23. FETCHCONTENT_POPULATE(${OPENSCENEGRAPH_PREFIX})
  24. ADD_SUBDIRECTORY(${${OPENSCENEGRAPH_PREFIX}_SOURCE_DIR} ${${OPENSCENEGRAPH_PREFIX}_BINARY_DIR})
  25. ENDIF()