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")
12 IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../../cmake")
13 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../../cmake")
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 "")
26 SET(OpenSG_DIR "" CACHE PATH "")
29 #############################################################################
32 FILE(GLOB SRCFILES "*.cpp")
34 #############################################################################
37 SET(OSG_COMPONENTS OSGBase
38 OSGContribTrapezoidalShadowMaps
57 FIND_PACKAGE(GLUT REQUIRED)
58 LIST(APPEND DEP_INCLUDE_DIRS ${GLUT_INCLUDE_DIR})
59 LIST(APPEND DEP_LIBRARIES ${GLUT_LIBRARIES})
62 #### Collada (optional, depending on how OpenSG was built)
67 LIST(APPEND DEP_INCLUDE_DIRS ${COLLADA_INCLUDE_DIRS})
68 LIST(APPEND DEP_LIBRARIES ${COLLADA_LIBRARIES})
74 SET(Boost_USE_MULTITHREAD ON)
75 SET(Boost_STATIC_LIBS OFF)
78 SET(Boost_COMPONENTS filesystem)
79 FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
81 FIND_PACKAGE(Boost REQUIRED)
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")
93 LIST(APPEND DEP_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
94 LIST(APPEND DEP_LIBRARIES ${Boost_LIBRARIES})
100 FIND_PACKAGE(OpenSG REQUIRED COMPONENTS ${OSG_COMPONENTS})
103 #############################################################################
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})