2 IF(OSG_OGL_COREONLY AND NOT OSG_CHECK_COREONLY)
6 PROJECT(OpenSGTutorialExamples)
8 MESSAGE(STATUS "Building tutorial examples integrated")
10 #############################################################################
13 FILE(GLOB SRCFILES "*.cpp")
15 # stuff that is broken -- these examples need to be fixed
17 #############################################################################
20 SET(OSG_COMPONENTS OSGBase
35 LIST(APPEND OSG_COMPONENTS OSGWindowCocoa)
37 LIST(APPEND OSG_COMPONENTS OSGWindowX)
42 LIST(APPEND OSG_COMPONENTS OSGWindowWIN32)
49 SET(OSG_EXTERNAL_COMPONENTS Boost GLUT)
54 IF(X11_FOUND AND NOT APPLE)
55 LIST(APPEND OSG_EXTERNAL_COMPONENTS X11)
56 LIST(APPEND OSG_COMPONENTS OSGWindowX)
57 ELSE(X11_FOUND AND NOT APPLE)
58 LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/clusterserverx.cpp")
59 ENDIF(X11_FOUND AND NOT APPLE)
64 FOREACH(OSGDEP ${OSG_COMPONENTS})
65 IF(NOT EXISTS "${CMAKE_BINARY_DIR}/${OSGDEP}.cmake")
66 MESSAGE(STATUS "Dependency (${OSGDEP}) not found, "
67 "can not build ${PROJECT_NAME}\n")
69 ENDIF(NOT EXISTS "${CMAKE_BINARY_DIR}/${OSGDEP}.cmake")
71 INCLUDE("${CMAKE_BINARY_DIR}/${OSGDEP}.cmake")
72 INCLUDE_DIRECTORIES(${${OSGDEP}_INC})
75 FOREACH(OSGEXTDEP ${OSG_EXTERNAL_COMPONENTS})
76 IF(NOT ${OSGEXTDEP}_FOUND)
77 MESSAGE(FATAL_ERROR "Dependency (${OSGEXTDEP}) not found, "
78 "can not build ${PROJECT_NAME}\n")
82 INCLUDE_DIRECTORIES(SYSTEM ${${OSGEXTDEP}_INCLUDE_DIR})
86 #############################################################################
89 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
91 FOREACH(GLOBAL_INC ${OSG_GLOBAL_DEP_INCDIR})
92 INCLUDE_DIRECTORIES(${${GLOBAL_INC}})
95 FOREACH(SRC ${SRCFILES})
97 GET_FILENAME_COMPONENT(EXE ${SRC} NAME_WE)
99 ADD_EXECUTABLE(${EXE} ${OSGEXCLUDE_EXAMPLES_SIMPLE}
100 ${SRC} ${OSG_ADD_GLOBAL_EXE_SRC})
102 ADD_DEPENDENCIES(OSGAllTutorialExamples ${EXE})
104 FOREACH(OSGDEP ${OSG_COMPONENTS})
105 ADD_DEPENDENCIES(${EXE} ${OSGDEP})
107 TARGET_LINK_LIBRARIES(${EXE} ${OSGDEP})
110 IF(LINUX AND CMAKE_BUILD_TYPE STREQUAL "DebugGV" AND OSG_ADD_CXX_FLAGS_GV)
111 SET_PROPERTY(TARGET ${EXE}
112 APPEND PROPERTY COMPILE_FLAGS ${OSG_ADD_CXX_FLAGS_GV})
116 SET_PROPERTY(TARGET ${EXE} PROPERTY FOLDER "Examples/Tutorial")
120 IF(OSG_INSTALL_EXAMPLES_EXE)
122 INSTALL(TARGETS ${EXE}
123 CONFIGURATIONS Release
124 RUNTIME DESTINATION share/OpenSG/Examples/Tutorial/bin/rel)
125 INSTALL(TARGETS ${EXE}
127 RUNTIME DESTINATION share/OpenSG/Examples/Tutorial/bin/debug)
128 INSTALL(TARGETS ${EXE}
129 CONFIGURATIONS ReleaseNoOpt
130 RUNTIME DESTINATION share/OpenSG/Examples/Tutorial/bin/relnoopt)
131 INSTALL(TARGETS ${EXE}
132 CONFIGURATIONS DebugOpt
133 RUNTIME DESTINATION share/OpenSG/Examples/Tutorial/bin/debugopt)
135 INSTALL(TARGETS ${EXE}
136 CONFIGURATIONS Release
137 DESTINATION share/OpenSG/Examples/Tutorial/bin
138 COMPONENT examples_basic)
140 INSTALL(TARGETS ${EXE}
142 DESTINATION share/OpenSG/Examples/Tutorial/bin/debug
143 COMPONENT examples_basic)
145 INSTALL(TARGETS ${EXE}
146 CONFIGURATIONS DebugGV
147 DESTINATION share/OpenSG/Examples/Tutorial/bin/debug
148 COMPONENT examples_basic)
151 IF(OSG_INSTALL_EXAMPLES)
152 INSTALL(FILES "${SRC}"
153 DESTINATION share/OpenSG/Examples/Tutorial
154 COMPONENT examples_basic)
159 IF(OSG_INSTALL_EXAMPLES)
160 INSTALL(FILES CMakeLists.standalone.txt
161 DESTINATION share/OpenSG/Examples/Tutorial
162 RENAME CMakeLists.txt
163 COMPONENT examples_basic)
165 INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/Examples/Tutorial/Data"
166 DESTINATION share/OpenSG/Examples/Tutorial
167 COMPONENT examples_basic)