2 IF(OSG_OGL_COREONLY AND NOT OSG_CHECK_COREONLY)
6 PROJECT(OpenSGAdvancedExamples)
8 MESSAGE(STATUS "Building advanced examples integrated")
10 #############################################################################
13 FILE(GLOB SRCFILES "*.cpp")
15 #############################################################################
18 SET(OSG_COMPONENTS OSGBase
31 OSGContribBackgroundLoader
32 OSGContribTrapezoidalShadowMaps
38 LIST(APPEND OSG_COMPONENTS OSGWindowCocoa)
40 LIST(APPEND OSG_COMPONENTS OSGWindowX)
45 LIST(APPEND OSG_COMPONENTS OSGWindowWIN32)
52 SET(OSG_EXTERNAL_COMPONENTS Boost GLUT)
57 IF(X11_FOUND AND NOT APPLE)
58 LIST(APPEND OSG_EXTERNAL_COMPONENTS X11)
59 LIST(APPEND OSG_COMPONENTS OSGWindowX)
60 ENDIF(X11_FOUND AND NOT APPLE)
65 FOREACH(OSGDEP ${OSG_COMPONENTS})
66 IF(NOT EXISTS "${CMAKE_BINARY_DIR}/${OSGDEP}.cmake")
67 MESSAGE(STATUS "Dependency (${OSGDEP}) not found, "
68 "can not build ${PROJECT_NAME}\n")
70 ENDIF(NOT EXISTS "${CMAKE_BINARY_DIR}/${OSGDEP}.cmake")
72 INCLUDE("${CMAKE_BINARY_DIR}/${OSGDEP}.cmake")
73 INCLUDE_DIRECTORIES(${${OSGDEP}_INC})
76 FOREACH(OSGEXTDEP ${OSG_EXTERNAL_COMPONENTS})
77 IF(NOT ${OSGEXTDEP}_FOUND)
78 MESSAGE(FATAL_ERROR "Dependency (${OSGEXTDEP}) not found, "
79 "can not build ${PROJECT_NAME}\n")
83 INCLUDE_DIRECTORIES(SYSTEM ${${OSGEXTDEP}_INCLUDE_DIR})
86 set(OSG_ADDON_LIBRARIES "")
89 INCLUDE_DIRECTORIES(AFTER ${ANTTWEAKBAR_INCLUDE_DIR})
90 LIST(APPEND OSG_ADDON_LIBRARIES ${ANTTWEAKBAR_LIBRARIES})
91 add_definitions(-DOSG_WITH_ANTTWEAKBAR)
95 INCLUDE_DIRECTORIES(AFTER ${QHULL_INCLUDE_DIR})
96 LIST(APPEND OSG_ADDON_LIBRARIES ${QHULL_LIBRARIES})
97 add_definitions(-DOSG_WITH_QHULL)
100 OSG_FIND_PACKAGE(Glm_OpenSG)
102 INCLUDE_DIRECTORIES(AFTER ${GLM_INCLUDE_DIR})
103 add_definitions(-DOSG_WITH_GLM)
106 OSG_FIND_PACKAGE(VMath_OpenSG)
108 INCLUDE_DIRECTORIES(AFTER ${VMATH_INCLUDE_DIR})
109 add_definitions(-DOSG_WITH_VMATH)
112 #############################################################################
115 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
117 FOREACH(GLOBAL_INC ${OSG_GLOBAL_DEP_INCDIR})
118 INCLUDE_DIRECTORIES(${${GLOBAL_INC}})
121 FOREACH(SRC ${SRCFILES})
123 GET_FILENAME_COMPONENT(EXE ${SRC} NAME_WE)
125 ADD_EXECUTABLE(${EXE} ${OSGEXCLUDE_EXAMPLES_ADVANCED}
126 ${SRC} ${OSG_ADD_GLOBAL_EXE_SRC})
128 ADD_DEPENDENCIES(OSGAllAdvancedExamples ${EXE})
130 FOREACH(OSGDEP ${OSG_COMPONENTS})
131 ADD_DEPENDENCIES(${EXE} ${OSGDEP})
133 TARGET_LINK_LIBRARIES(${EXE} ${OSGDEP})
136 TARGET_LINK_LIBRARIES(${EXE} ${OSG_ADDON_LIBRARIES})
138 IF(LINUX AND CMAKE_BUILD_TYPE STREQUAL "DebugGV" AND OSG_ADD_CXX_FLAGS_GV)
139 SET_PROPERTY(TARGET ${EXE}
140 APPEND PROPERTY COMPILE_FLAGS ${OSG_ADD_CXX_FLAGS_GV})
144 SET_PROPERTY(TARGET ${EXE} PROPERTY FOLDER "Examples/Advanced")
148 IF(OSG_INSTALL_EXAMPLES_EXE)
150 INSTALL(TARGETS ${EXE}
151 CONFIGURATIONS Release
152 RUNTIME DESTINATION share/OpenSG/Examples/Advanced/bin/rel)
153 INSTALL(TARGETS ${EXE}
155 RUNTIME DESTINATION share/OpenSG/Examples/Advanced/bin/debug)
156 INSTALL(TARGETS ${EXE}
157 CONFIGURATIONS ReleaseNoOpt
158 RUNTIME DESTINATION share/OpenSG/Examples/Advanced/bin/relnoopt)
159 INSTALL(TARGETS ${EXE}
160 CONFIGURATIONS DebugOpt
161 RUNTIME DESTINATION share/OpenSG/Examples/Advanced/bin/debugopt)
163 INSTALL(TARGETS ${EXE}
164 CONFIGURATIONS Release
165 DESTINATION share/OpenSG/Examples/Advanced/bin
166 COMPONENT examples_basic)
168 INSTALL(TARGETS ${EXE}
170 DESTINATION share/OpenSG/Examples/Advanced/bin/debug
171 COMPONENT examples_basic)
173 INSTALL(TARGETS ${EXE}
174 CONFIGURATIONS DebugGV
175 DESTINATION share/OpenSG/Examples/Advanced/bin/debug
176 COMPONENT examples_basic)
179 IF(OSG_INSTALL_EXAMPLES)
180 INSTALL(FILES "${SRC}"
181 DESTINATION share/OpenSG/Examples/Advanced
182 COMPONENT examples_basic)
187 IF(OSG_INSTALL_EXAMPLES)
188 INSTALL(FILES CMakeLists.standalone.txt
189 DESTINATION share/OpenSG/Examples/Advanced
190 RENAME CMakeLists.txt
191 COMPONENT examples_basic)