fixed: auto_ptr -> unique_ptr
[opensg.git] / Examples / Advanced / DeferredShading / CMakeLists.standalone.txt
blob22d8418b4c2dba8bc58a3279888a3d5f49dd2303
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
4 PROJECT(OpenSGExamplesAdvancedDeferredShading)
6 MESSAGE(STATUS "Building ${PROJECT_NAME} standalone")
8 IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
9   SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
10 ENDIF()
12 IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../../cmake")
13   SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../../cmake")
14 ENDIF()
16 # show build command lines
17 SET(CMAKE_VERBOSE_MAKEFILE ON)
19 OPTION(OSG_USE_OSGSUPPORT_LIBS "" OFF)
21 IF(NOT OSG_SUPPORT_ROOT)
22   SET(OSG_SUPPORT_ROOT "" CACHE PATH "")
23 ENDIF()
25 IF(NOT OpenSG_DIR)
26   SET(OpenSG_DIR "" CACHE PATH "")
27 ENDIF()
29 #############################################################################
30 # find sources
32 FILE(GLOB SRCFILES "*.cpp")
34 #############################################################################
35 # get dependencies
37 SET(OSG_COMPONENTS OSGBase
38                    OSGContribTrapezoidalShadowMaps
39                    OSGDrawable
40                    OSGEffectGroups
41                    OSGFileIO
42                    OSGGroup
43                    OSGImageFileIO
44                    OSGState
45                    OSGSystem
46                    OSGUtil
47                    OSGWindow
48                    OSGWindowGLUT)
50 SET(DEP_INCLUDE_DIRS)
51 SET(DEP_LIBRARY_DIRS)
52 SET(DEP_LIBRARIES)
54 #############
55 #### GLUT
57 FIND_PACKAGE(GLUT REQUIRED)
58 LIST(APPEND DEP_INCLUDE_DIRS ${GLUT_INCLUDE_DIR})
59 LIST(APPEND DEP_LIBRARIES ${GLUT_LIBRARIES})
61 #############
62 #### Collada (optional, depending on how OpenSG was built)
64 FIND_PACKAGE(Collada)
66 IF(COLLADA_FOUND)
67     LIST(APPEND DEP_INCLUDE_DIRS ${COLLADA_INCLUDE_DIRS})
68     LIST(APPEND DEP_LIBRARIES ${COLLADA_LIBRARIES})
69 ENDIF(COLLADA_FOUND)
71 #############
72 #### Boost
74 SET(Boost_USE_MULTITHREAD ON)
75 SET(Boost_STATIC_LIBS OFF)
77 IF(COLLADA_FOUND)
78     SET(Boost_COMPONENTS filesystem)
79     FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
80 ELSE(COLLADA_FOUND)
81     FIND_PACKAGE(Boost REQUIRED)
82 ENDIF(COLLADA_FOUND)
84 FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
86 IF(Boost_FOUND AND Boost_VERSION VERSION_GREATER "1.34")
87     SET(Boost_COMPONENTS system ${Boost_COMPONENTS})
89     FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
90 ENDIF(Boost_FOUND AND Boost_VERSION VERSION_GREATER "1.34")
92 IF(Boost_FOUND)
93     LIST(APPEND DEP_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
94     LIST(APPEND DEP_LIBRARIES ${Boost_LIBRARIES})
95 ENDIF(Boost_FOUND)
97 #############
98 #### OpenSG
100 FIND_PACKAGE(OpenSG REQUIRED COMPONENTS ${OSG_COMPONENTS})
103 #############################################################################
104 # build executables
106 FOREACH(SRC ${SRCFILES})
108     GET_FILENAME_COMPONENT(EXE ${SRC} NAME_WE)
110     INCLUDE_DIRECTORIES(${OpenSG_INCLUDE_DIRS})
111     INCLUDE_DIRECTORIES(${DEP_INCLUDE_DIRS})
113     LINK_DIRECTORIES(${OpenSG_LIBRARY_DIRS})
114     LINK_DIRECTORIES(${DEP_LIBRARY_DIRS})
116     ADD_EXECUTABLE(${EXE} ${SRC} ${OSG_ADD_GLOBAL_EXE_SRC})
118     TARGET_LINK_LIBRARIES(${EXE} ${OpenSG_LIBRARIES})
119     TARGET_LINK_LIBRARIES(${EXE} ${DEP_LIBRARIES})
120 ENDFOREACH(SRC)