changed: deal with dxt1 compressed dds volumes
[opensg.git] / Examples / Tutorial / CMakeLists.standalone.txt
blob8f5cc41c5c729829ca56d279ffa7ed5de337912d
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
4 PROJECT(OpenSGExamplesTutorial)
6 IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
7   SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
8 ENDIF()
10 IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../cmake")
11   SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../cmake")
12 ENDIF()
14 # show build command lines
15 SET(CMAKE_VERBOSE_MAKEFILE ON)
17 OPTION(OSG_USE_OSGSUPPORT_LIBS "" OFF)
19 IF(NOT OSG_SUPPORT_ROOT)
20   SET(OSG_SUPPORT_ROOT "" CACHE PATH "")
21 ENDIF()
23 IF(NOT OpenSG_DIR)
24   SET(OpenSG_DIR "" CACHE PATH "")
25 ENDIF()
27 #############################################################################
28 # find sources
30 FILE(GLOB SRCFILES "*.cpp")
32 #############################################################################
33 # get dependencies
35 SET(OSG_COMPONENTS OSGBase
36                    OSGCluster
37                    OSGDrawable
38                    OSGFileIO
39                    OSGGroup
40                    OSGImageFileIO
41                    OSGState
42                    OSGSystem
43                    OSGUtil
44                    OSGText
45                    OSGWindow
46                    OSGWindowGLUT)
48 SET(DEP_INCLUDE_DIRS)
49 SET(DEP_LIBRARY_DIRS)
50 SET(DEP_LIBRARIES)
52 #############
53 #### OpenGL
55 FIND_PACKAGE(OpenGL REQUIRED)
56 LIST(APPEND DEP_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
57 LIST(APPEND DEP_LIBRARIES ${OPENGL_LIBRARIES})
59 #############
60 #### GLUT
62 FIND_PACKAGE(GLUT REQUIRED)
63 LIST(APPEND DEP_INCLUDE_DIRS ${GLUT_INCLUDE_DIR})
64 LIST(APPEND DEP_LIBRARIES ${GLUT_LIBRARIES})
66 #############
67 #### Collada (optional, required if OSGFileIO is used 
68 ####          and was built with collada support)
70 FIND_PACKAGE(Collada)
72 IF(COLLADA_FOUND)
73     LIST(APPEND DEP_INCLUDE_DIRS ${COLLADA_INCLUDE_DIRS})
74     LIST(APPEND DEP_LIBRARY_DIRS ${COLLADA_LIBRARY_DIRS})
75 ENDIF(COLLADA_FOUND)
77 #############
78 #### Boost
80 SET(Boost_USE_MULTITHREAD ON)
81 SET(Boost_STATIC_LIBS OFF)
83 SET(Boost_COMPONENTS system ${Boost_COMPONENTS})
85 IF(COLLADA_FOUND)
86     LIST(APPEND Boost_COMPONENTS filesystem)
87 ENDIF(COLLADA_FOUND)
89 FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
91 IF(Boost_FOUND)
92     LIST(APPEND DEP_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
93     LIST(APPEND DEP_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
94     LIST(APPEND DEP_LIBRARIES ${Boost_LIBRARIES})
95 ENDIF(Boost_FOUND)
97 #############
98 #### OpenSG
100 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})
117     TARGET_LINK_LIBRARIES(${EXE} ${OpenSG_LIBRARIES})
118     TARGET_LINK_LIBRARIES(${EXE} ${DEP_LIBRARIES})
119 ENDFOREACH(SRC)