Permalink
Browse files

fixed: setup for dirs relative to an external contrib dir

added: external example dir support

git-svn-id: https://external.lite3d.com/opensg/svn_repo/trunk@2273 4683daeb-ad0f-0410-a623-93161e962ae5
  • Loading branch information...
1 parent f47cb09 commit 97ee4f5e89f09bf58c2ec8477d387ad68110084f vossg committed Jan 25, 2010
Showing with 30 additions and 0 deletions.
  1. +17 −0 CMake/BuildFunctions.cmake
  2. +13 −0 CMakeLists.txt
View
17 CMake/BuildFunctions.cmake
@@ -425,6 +425,20 @@ FUNCTION(OSG_ADD_DIRECTORY DIRNAME)
FILE(GLOB LOCAL_TEST_SRC "${CMAKE_SOURCE_DIR}/${DIRNAME}/test*.cpp"
"${CMAKE_SOURCE_DIR}/${DIRNAME}/test*.mm")
FILE(GLOB BASE_MM "${CMAKE_SOURCE_DIR}/${DIRNAME}/OSG*Base.mm")
+ ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}")
+ FILE(GLOB LOCAL_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.mm")
+ FILE(GLOB LOCAL_HDR "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.h")
+ FILE(GLOB LOCAL_INL "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.inl")
+ FILE(GLOB LOCAL_INS "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.ins")
+ FILE(GLOB LOCAL_FCD "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.fcd")
+ FILE(GLOB LOCAL_LL "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.ll")
+ FILE(GLOB LOCAL_YY "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*.yy")
+ FILE(GLOB LOCAL_MOC "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*_qt.h")
+ FILE(GLOB LOCAL_UNITTEST_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*Test.cpp")
+ FILE(GLOB LOCAL_TEST_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/test*.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/test*.mm")
+ FILE(GLOB BASE_MM "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}/OSG*Base.mm")
ELSE()
# Guess it's an absolute dir we got as the rel one is not there
FILE(GLOB LOCAL_SRC "${DIRNAME}/OSG*.cpp" "${DIRNAME}/OSG*.mm")
@@ -527,6 +541,9 @@ FUNCTION(OSG_ADD_DIRECTORY DIRNAME)
IF(EXISTS "${CMAKE_SOURCE_DIR}/${DIRNAME}")
FILE(APPEND ${${PROJECT_NAME}_BUILD_FILE}
"LIST(APPEND ${PROJECT_NAME}_INC \"${CMAKE_SOURCE_DIR}/${DIRNAME}\")\n\n")
+ ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}")
+ FILE(APPEND ${${PROJECT_NAME}_BUILD_FILE}
+ "LIST(APPEND ${PROJECT_NAME}_INC \"${CMAKE_CURRENT_SOURCE_DIR}/${DIRNAME}\")\n\n")
ELSE()
FILE(APPEND ${${PROJECT_NAME}_BUILD_FILE}
"LIST(APPEND ${PROJECT_NAME}_INC \"${DIRNAME}\")\n\n")
View
13 CMakeLists.txt
@@ -867,6 +867,19 @@ IF(OSGBUILD_EXAMPLES_ADVANCED)
ADD_SUBDIRECTORY("Examples/Advanced/DeferredShading")
ENDIF(OSGBUILD_EXAMPLES_ADVANCED)
+###################
+# External Examples
+###################
+
+FOREACH(_OSGCORE_EXT_EXAMPLE_DIR ${OSG_CORE_EXAMPLE_EXTENSIONS})
+ MESSAGE(STATUS "processing example ext : ${_OSGCORE_EXT_EXAMPLE_DIR}")
+
+ IF(EXISTS ${_OSGCORE_EXT_EXAMPLE_DIR}/CMakeLists.Examples.txt)
+ MESSAGE(STATUS " Found and process ${_OSGCORE_EXT_EXAMPLE_DIR}/CMakeLists.Examples.txt")
+ INCLUDE(${_OSGCORE_EXT_EXAMPLE_DIR}/CMakeLists.Examples.txt)
+ ENDIF(EXISTS ${_OSGCORE_EXT_EXAMPLE_DIR}/CMakeLists.Examples.txt)
+ENDFOREACH(_OSGCORE_EXT_EXAMPLE_DIR ${OSG_CORE_EXAMPLE_EXTENSIONS})
+
##################
# Documentation II
##################

0 comments on commit 97ee4f5

Please sign in to comment.