fixed: auto_ptr -> unique_ptr
[opensg.git] / Examples / Advanced / Character / CMakeLists.fromosg.txt
blob1df3151f2cf70929478afecebcf3ea80434eeb2e
2 IF(OSG_OGL_COREONLY AND NOT OSG_CHECK_COREONLY)
3   RETURN()
4 ENDIF()
6 PROJECT(OpenSGExamplesAdvancedCharacter)
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                    OSGDrawable
20                    OSGDynamics
21                    OSGFileIO
22                    OSGGroup
23                    OSGImageFileIO
24                    OSGState
25                    OSGSystem
26                    OSGUtil
27                    OSGWindow
28                    OSGWindowGLUT)
30 IF(UNIX)
31     IF(APPLE)
32         LIST(APPEND OSG_COMPONENTS OSGWindowCocoa)
33     ELSE(APPLE)
34         LIST(APPEND OSG_COMPONENTS OSGWindowX)
35     ENDIF(APPLE)
36 ENDIF(UNIX)
38 IF(WIN32)
39     LIST(APPEND OSG_COMPONENTS OSGWindowWIN32)
40 ENDIF(WIN32)
42 SET(DEP_INCLUDE_DIRS)
43 SET(DEP_LIBRARY_DIRS)
44 SET(DEP_LIBRARIES)
46 SET(OSG_EXTERNAL_COMPONENTS Boost GLUT)
48 #############
49 #### OpenSG
51 FOREACH(OSGDEP ${OSG_COMPONENTS})
52     IF(NOT EXISTS "${CMAKE_BINARY_DIR}/${OSGDEP}.cmake")
53         MESSAGE(FATAL_ERROR "Dependency (${OSGDEP}) not found, "
54                             "can not build ${PROJECT_NAME}\n")
55         RETURN()
56     ENDIF(NOT EXISTS "${CMAKE_BINARY_DIR}/${OSGDEP}.cmake")
58     INCLUDE("${CMAKE_BINARY_DIR}/${OSGDEP}.cmake")
59     INCLUDE_DIRECTORIES(${${OSGDEP}_INC})
60 ENDFOREACH()
62 FOREACH(OSGEXTDEP ${OSG_EXTERNAL_COMPONENTS})
63     IF(NOT ${OSGEXTDEP}_FOUND)
64         MESSAGE(FATAL_ERROR "Dependency (${OSGEXTDEP}) not found, "
65                             "can not build ${PROJECT_NAME}\n")
66         RETURN()
67     ENDIF()
69     INCLUDE_DIRECTORIES(SYSTEM ${${OSGEXTDEP}_INCLUDE_DIR})
70 ENDFOREACH()
73 #############################################################################
74 # build executables
76 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
78 FOREACH(GLOBAL_INC ${OSG_GLOBAL_DEP_INCDIR})
79   INCLUDE_DIRECTORIES(${${GLOBAL_INC}})
80 ENDFOREACH()
82 ADD_DEFINITIONS(-D OSG_BUILD_INTEGRATED)
84 FOREACH(SRC ${SRCFILES})
86     GET_FILENAME_COMPONENT(EXE ${SRC} NAME_WE)
88     ADD_EXECUTABLE(${EXE} ${OSGEXCLUDE_EXAMPLES_ADVANCED} 
89                           ${SRC} ${OSG_ADD_GLOBAL_EXE_SRC})
91     ADD_DEPENDENCIES(OSGAllAdvancedExamples ${EXE})
93     FOREACH(OSGDEP ${OSG_COMPONENTS})
94         ADD_DEPENDENCIES(${EXE} ${OSGDEP})
96         TARGET_LINK_LIBRARIES(${EXE} ${OSGDEP})
97     ENDFOREACH()
99     IF(WIN32)
100       SET_PROPERTY(TARGET ${EXE} PROPERTY FOLDER "Examples/Advanced")
101     ENDIF()
103     #Install
104     IF(OSG_INSTALL_EXAMPLES_EXE)
105       IF(WIN32)
106         INSTALL(TARGETS ${EXE}
107                 CONFIGURATIONS Release
108                 RUNTIME DESTINATION share/OpenSG/Examples/Advanced/Character/bin/rel)
109         INSTALL(TARGETS ${EXE}
110                 CONFIGURATIONS Debug
111                 RUNTIME DESTINATION share/OpenSG/Examples/Advanced/Character/bin/debug)
112         INSTALL(TARGETS ${EXE}
113                 CONFIGURATIONS ReleaseNoOpt
114                 RUNTIME DESTINATION share/OpenSG/Examples/Advanced/Character/bin/relnoopt)
115         INSTALL(TARGETS ${EXE}
116                 CONFIGURATIONS DebugOpt
117                 RUNTIME DESTINATION share/OpenSG/Examples/Advanced/Character/bin/debugopt)
118       ELSE()
119         INSTALL(TARGETS ${EXE}
120                 CONFIGURATIONS Release
121                 DESTINATION share/OpenSG/Examples/Advanced/Character/bin
122                 COMPONENT examples_advanced)
124         INSTALL(TARGETS ${EXE}
125                 CONFIGURATIONS Debug
126                 DESTINATION share/OpenSG/Examples/Advanced/Character/bin/debug
127                 COMPONENT examples_advanced)
129         INSTALL(TARGETS ${EXE}
130                 CONFIGURATIONS DebugGV
131                 DESTINATION share/OpenSG/Examples/Advanced/Character/bin/debug
132                 COMPONENT examples_advanced)
133       ENDIF()
134     ENDIF()
135     IF(OSG_INSTALL_EXAMPLES)
136         INSTALL(FILES "${SRC}"
137                 DESTINATION share/OpenSG/Examples/Advanced/Character
138                 COMPONENT examples_advanced)
139     ENDIF()
140 ENDFOREACH(SRC)
142 #GLSL files
143 IF(OSG_INSTALL_EXAMPLES)
144     INSTALL(FILES CMakeLists.standalone.txt
145             DESTINATION share/OpenSG/Examples/Advanced/Character
146             RENAME CMakeLists.txt
147             COMPONENT examples_advanced)
149     FILE(GLOB GLOBFILES "*.glsl")
150     INSTALL(FILES ${GLOBFILES}
151             DESTINATION share/OpenSG/Examples/Advanced/Character/Data
152             COMPONENT examples_advanced)
154     FILE(GLOB GLOBFILES "*.tga")
155     INSTALL(FILES ${GLOBFILES}
156             DESTINATION share/OpenSG/Examples/Advanced/Character/Data
157             COMPONENT examples_advanced)
159     FILE(GLOB GLOBFILES "*.png")
160     INSTALL(FILES ${GLOBFILES}
161             DESTINATION share/OpenSG/Examples/Advanced/Character/Data
162             COMPONENT examples_advanced)
164     FILE(GLOB GLOBFILES "*.jpg")
165     INSTALL(FILES ${GLOBFILES}
166             DESTINATION share/OpenSG/Examples/Advanced/Character/Data
167             COMPONENT examples_advanced)
169     FILE(GLOB GLOBFILES "*.mesh")
170     INSTALL(FILES ${GLOBFILES}
171             DESTINATION share/OpenSG/Examples/Advanced/Character/Data
172             COMPONENT examples_advanced)
174     FILE(GLOB GLOBFILES "*.skeleton")
175     INSTALL(FILES ${GLOBFILES}
176             DESTINATION share/OpenSG/Examples/Advanced/Character/Data
177             COMPONENT examples_advanced)
178 ENDIF()