fixed: auto_ptr -> unique_ptr
[opensg.git] / Examples / Advanced / DeferredShading / CMakeLists.fromosg.txt
bloba4e1b2cf6910e87e6c41daf9d457e8ed66562b04
2 IF(OSG_OGL_COREONLY AND NOT OSG_CHECK_COREONLY)
3   RETURN()
4 ENDIF()
6 PROJECT(OpenSGExamplesAdvancedDeferredShading)
8 MESSAGE(STATUS "Building ${PROJECT_NAME} integrated")
10 #############################################################################
11 # find sources
13 FILE(GLOB SRCFILES "*.cpp")
15 #############################################################################
16 # get dependencies
18 SET(OSG_COMPONENTS OSGBase
19                    OSGContribTrapezoidalShadowMaps
20                    OSGDrawable
21                    OSGEffectGroups
22                    OSGFileIO
23                    OSGGroup
24                    OSGImageFileIO
25                    OSGState
26                    OSGSystem
27                    OSGUtil
28                    OSGWindow
29                    OSGWindowGLUT)
31 IF(UNIX)
32     IF(APPLE)
33         LIST(APPEND OSG_COMPONENTS OSGWindowCocoa)
34     ELSE(APPLE)
35         LIST(APPEND OSG_COMPONENTS OSGWindowX)
36     ENDIF(APPLE)
37 ENDIF(UNIX)
39 IF(WIN32)
40     LIST(APPEND OSG_COMPONENTS OSGWindowWIN32)
41 ENDIF(WIN32)
43 SET(DEP_INCLUDE_DIRS)
44 SET(DEP_LIBRARY_DIRS)
45 SET(DEP_LIBRARIES)
47 SET(OSG_EXTERNAL_COMPONENTS Boost GLUT)
49 #############
50 #### OpenSG
52 FOREACH(OSGDEP ${OSG_COMPONENTS})
53     IF(NOT EXISTS "${CMAKE_BINARY_DIR}/${OSGDEP}.cmake")
54         MESSAGE(FATAL_ERROR "Dependency (${OSGDEP}) not found, "
55                             "can not build ${PROJECT_NAME}\n")
56         RETURN()
57     ENDIF(NOT EXISTS "${CMAKE_BINARY_DIR}/${OSGDEP}.cmake")
59     INCLUDE("${CMAKE_BINARY_DIR}/${OSGDEP}.cmake")
60     INCLUDE_DIRECTORIES(${${OSGDEP}_INC})
61 ENDFOREACH()
63 FOREACH(OSGEXTDEP ${OSG_EXTERNAL_COMPONENTS})
64     IF(NOT ${OSGEXTDEP}_FOUND)
65         MESSAGE(FATAL_ERROR "Dependency (${OSGEXTDEP}) not found, "
66                             "can not build ${PROJECT_NAME}\n")
67         RETURN()
68     ENDIF()
70     INCLUDE_DIRECTORIES(SYSTEM ${${OSGEXTDEP}_INCLUDE_DIR})
71 ENDFOREACH()
74 #############################################################################
75 # build executables
77 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
79 FOREACH(GLOBAL_INC ${OSG_GLOBAL_DEP_INCDIR})
80   INCLUDE_DIRECTORIES(${${GLOBAL_INC}})
81 ENDFOREACH()
83 ADD_DEFINITIONS(-D OSG_BUILD_INTEGRATED)
85 FOREACH(SRC ${SRCFILES})
87     GET_FILENAME_COMPONENT(EXE ${SRC} NAME_WE)
89     ADD_EXECUTABLE(${EXE} ${OSGEXCLUDE_EXAMPLES_ADVANCED} 
90                           ${SRC} ${OSG_ADD_GLOBAL_EXE_SRC})
92     ADD_DEPENDENCIES(OSGAllAdvancedExamples ${EXE})
94     FOREACH(OSGDEP ${OSG_COMPONENTS})
95         ADD_DEPENDENCIES(${EXE} ${OSGDEP})
97         TARGET_LINK_LIBRARIES(${EXE} ${OSGDEP})
98     ENDFOREACH()
100     IF(WIN32)
101       SET_PROPERTY(TARGET ${EXE} PROPERTY FOLDER "Examples/Advanced")
102     ENDIF()
104     #Install
105     IF(OSG_INSTALL_EXAMPLES_EXE)
106       IF(WIN32)
107         INSTALL(TARGETS ${EXE}
108                 CONFIGURATIONS Release
109                 RUNTIME DESTINATION share/OpenSG/Examples/Advanced/DeferredShading/bin/rel)
110         INSTALL(TARGETS ${EXE}
111                 CONFIGURATIONS Debug
112                 RUNTIME DESTINATION share/OpenSG/Examples/Advanced/DeferredShading/bin/debug)
113         INSTALL(TARGETS ${EXE}
114                 CONFIGURATIONS ReleaseNoOpt
115                 RUNTIME DESTINATION share/OpenSG/Examples/Advanced/DeferredShading/bin/relnoopt)
116         INSTALL(TARGETS ${EXE}
117                 CONFIGURATIONS DebugOpt
118                 RUNTIME DESTINATION share/OpenSG/Examples/Advanced/DeferredShading/bin/debugopt)
120         INSTALL(TARGETS ${EXE}
121                 DESTINATION share/OpenSG/Examples/Advanced/DeferredShading
122                 COMPONENT examples_advanced)
123       ELSE()
124         INSTALL(TARGETS ${EXE}
125                 CONFIGURATIONS Release
126                 DESTINATION share/OpenSG/Examples/Advanced/DeferredShading/bin
127                 COMPONENT examples_advanced)
129         INSTALL(TARGETS ${EXE}
130                 CONFIGURATIONS Debug
131                 DESTINATION share/OpenSG/Examples/Advanced/DeferredShading/bin/debug
132                 COMPONENT examples_advanced)
134         INSTALL(TARGETS ${EXE}
135                 CONFIGURATIONS DebugGV
136                 DESTINATION share/OpenSG/Examples/Advanced/DeferredShading/bin/debug
137                 COMPONENT examples_advanced)
138       ENDIF()
139     ENDIF()
140     IF(OSG_INSTALL_EXAMPLES)
141         INSTALL(FILES "${SRC}"
142                 DESTINATION share/OpenSG/Examples/Advanced/DeferredShading
143                 COMPONENT examples_advanced)
144     ENDIF()
145 ENDFOREACH(SRC)
147 #GLSL files
148 IF(OSG_INSTALL_EXAMPLES)
149     INSTALL(FILES CMakeLists.standalone.txt
150             DESTINATION share/OpenSG/Examples/Advanced/DeferredShading
151             RENAME CMakeLists.txt
152             COMPONENT examples_advanced)
154     FILE(GLOB GLSLFILES "*.glsl")
155     INSTALL(FILES ${GLSLFILES}
156             DESTINATION share/OpenSG/Examples/Advanced/DeferredShading/Data
157             COMPONENT examples_advanced)
158 ENDIF()