fixed: auto_ptr -> unique_ptr
[opensg.git] / Examples / Advanced / CMakeLists.standalone.txt
blob0fd5f76feea9f5dca70a17b74ec7bd1396638132
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
4 PROJECT(OpenSGAdvancedExamples)
6 MESSAGE(STATUS "Building advanced examples 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                    OSGCluster 
39                    OSGDrawable 
40                    OSGDynamics
41                    OSGFileIO 
42                    OSGGroup 
43                    OSGEffectGroups
44                    OSGImageFileIO
45                    OSGState 
46                    OSGSystem 
47                    OSGUtil 
48                    OSGWindow 
49                    OSGWindowGLUT
50                    OSGContribBackgroundLoader
51                    OSGContribTrapezoidalShadowMaps
52                    OSGContribComputeBase
53                    OSGContribTechniques)
55 IF(UNIX)
56     IF(APPLE)
57         LIST(APPEND OSG_COMPONENTS OSGWindowCarbon)
58     ELSE(APPLE)
59         LIST(APPEND OSG_COMPONENTS OSGWindowX)
60     ENDIF(APPLE)
61 ENDIF(UNIX)
63 IF(WIN32)
64     LIST(APPEND OSG_COMPONENTS OSGWindowWIN32)
65 ENDIF(WIN32)
67 SET(DEP_INCLUDE_DIRS)
68 SET(DEP_LIBRARY_DIRS)
69 SET(DEP_LIBRARIES)
71 #############
72 #### GLUT
74 FIND_PACKAGE(GLUT REQUIRED)
75 LIST(APPEND DEP_INCLUDE_DIRS ${GLUT_INCLUDE_DIR})
76 LIST(APPEND DEP_LIBRARIES ${GLUT_LIBRARIES})
78 #############
79 #### OpenGL
81 FIND_PACKAGE(OpenGL REQUIRED)
82 LIST(APPEND DEP_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
83 LIST(APPEND DEP_LIBRARIES ${OPENGL_LIBRARIES})
85 #############
86 #### X11 (optional)
88 FIND_PACKAGE(X11)
90 IF(X11_FOUND)
91     LIST(APPEND DEP_INCLUDE_DIRS ${X11_X11_INCLUDE_PATH})
92     LIST(APPEND DEP_LIBRARIES ${X11_X11_LIB})
93 ENDIF(X11_FOUND)
95 #############
96 #### Collada (optional, depending on how OpenSG was built)
98 FIND_PACKAGE(Collada)
100 IF(COLLADA_FOUND)
101     LIST(APPEND DEP_INCLUDE_DIRS ${COLLADA_INCLUDE_DIRS})
102     LIST(APPEND DEP_LIBRARY_DIRS ${COLLADA_LIBRARY_DIRS})
103 ENDIF(COLLADA_FOUND)
105 #############
106 #### Boost
108 SET(Boost_USE_MULTITHREAD ON)
109 SET(Boost_STATIC_LIBS OFF)
111 SET(Boost_COMPONENTS system ${Boost_COMPONENTS})
113 IF(COLLADA_FOUND)
114     LIST(APPEND Boost_COMPONENTS filesystem)
115 ENDIF(COLLADA_FOUND)
117 FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
119 IF(Boost_FOUND)
120     LIST(APPEND DEP_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
121     LIST(APPEND DEP_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
122     LIST(APPEND DEP_LIBRARIES ${Boost_LIBRARIES})
123 ENDIF(Boost_FOUND)
125 ##################
126 #### AntTweakBar
128 FIND_PACKAGE(AntTweakBar)
129 IF(ANTTWEAKBAR_FOUND)
130     LIST(APPEND DEP_INCLUDE_DIRS ${ANTTWEAKBAR_INCLUDE_DIRS})
131     LIST(APPEND DEP_LIBRARY_DIRS ${ANTTWEAKBAR_LIBRARY_DIRS})
132     LIST(APPEND DEP_LIBRARIES    ${ANTTWEAKBAR_LIBRARIES})
133 ENDIF(ANTTWEAKBAR_FOUND)
135 #############
136 #### OpenSG
138 FIND_PACKAGE(OpenSG REQUIRED COMPONENTS ${OSG_COMPONENTS})
141 #############################################################################
142 # build executables
144 FOREACH(SRC ${SRCFILES})
146     GET_FILENAME_COMPONENT(EXE ${SRC} NAME_WE)
148     INCLUDE_DIRECTORIES(${OpenSG_INCLUDE_DIRS})
149     INCLUDE_DIRECTORIES(${DEP_INCLUDE_DIRS})
151     LINK_DIRECTORIES(${OpenSG_LIBRARY_DIRS})
152     LINK_DIRECTORIES(${DEP_LIBRARY_DIRS})
154     ADD_EXECUTABLE(${EXE} ${SRC} ${OSG_ADD_GLOBAL_EXE_SRC})
156     TARGET_LINK_LIBRARIES(${EXE} ${OpenSG_LIBRARIES})
157     TARGET_LINK_LIBRARIES(${EXE} ${DEP_LIBRARIES})
158 ENDFOREACH(SRC)