fixed: auto_ptr -> unique_ptr
[opensg.git] / Examples / Advanced / Character / CMakeLists.standalone.txt
blob900dee7061005f89b5bc038aaf0d357b05e65d50
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
4 PROJECT(OpenSGExamplesAdvancedCharcter)
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                    OSGDrawable
39                    OSGDynamics
40                    OSGFileIO
41                    OSGGroup
42                    OSGImageFileIO
43                    OSGState
44                    OSGSystem
45                    OSGUtil
46                    OSGWindow
47                    OSGWindowGLUT)
49 SET(DEP_INCLUDE_DIRS)
50 SET(DEP_LIBRARY_DIRS)
51 SET(DEP_LIBRARIES)
53 #############
54 #### GLUT
56 FIND_PACKAGE(GLUT REQUIRED)
57 LIST(APPEND DEP_INCLUDE_DIRS ${GLUT_INCLUDE_DIR})
58 LIST(APPEND DEP_LIBRARIES ${GLUT_LIBRARIES})
60 #############
61 #### Collada (optional, depending on how OpenSG was built)
63 FIND_PACKAGE(Collada)
65 IF(COLLADA_FOUND)
66     LIST(APPEND DEP_INCLUDE_DIRS ${COLLADA_INCLUDE_DIRS})
67     LIST(APPEND DEP_LIBRARIES ${COLLADA_LIBRARIES})
68 ENDIF(COLLADA_FOUND)
70 #############
71 #### Boost
73 SET(Boost_USE_MULTITHREAD ON)
74 SET(Boost_STATIC_LIBS OFF)
76 IF(COLLADA_FOUND)
77     SET(Boost_COMPONENTS filesystem)
78     FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
79 ELSE(COLLADA_FOUND)
80     FIND_PACKAGE(Boost REQUIRED)
81 ENDIF(COLLADA_FOUND)
83 FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
85 IF(Boost_FOUND AND Boost_VERSION VERSION_GREATER "1.34")
86     SET(Boost_COMPONENTS system ${Boost_COMPONENTS})
88     FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
89 ENDIF(Boost_FOUND AND Boost_VERSION VERSION_GREATER "1.34")
91 IF(Boost_FOUND)
92     LIST(APPEND DEP_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
93     LIST(APPEND DEP_LIBRARIES ${Boost_LIBRARIES})
94 ENDIF(Boost_FOUND)
96 #############
97 #### OpenSG
99 FIND_PACKAGE(OpenSG REQUIRED COMPONENTS ${OSG_COMPONENTS})
102 #############################################################################
103 # build executables
105 FOREACH(SRC ${SRCFILES})
107     GET_FILENAME_COMPONENT(EXE ${SRC} NAME_WE)
109     INCLUDE_DIRECTORIES(${OpenSG_INCLUDE_DIRS})
110     INCLUDE_DIRECTORIES(${DEP_INCLUDE_DIRS})
112     LINK_DIRECTORIES(${OpenSG_LIBRARY_DIRS})
113     LINK_DIRECTORIES(${DEP_LIBRARY_DIRS})
115     ADD_EXECUTABLE(${EXE} ${SRC} ${OSG_ADD_GLOBAL_EXE_SRC})
117     TARGET_LINK_LIBRARIES(${EXE} ${OpenSG_LIBRARIES})
118     TARGET_LINK_LIBRARIES(${EXE} ${DEP_LIBRARIES})
119 ENDFOREACH(SRC)