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")
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
56 FIND_PACKAGE(GLUT REQUIRED)
57 LIST(APPEND DEP_INCLUDE_DIRS ${GLUT_INCLUDE_DIR})
58 LIST(APPEND DEP_LIBRARIES ${GLUT_LIBRARIES})
61 #### Collada (optional, depending on how OpenSG was built)
66 LIST(APPEND DEP_INCLUDE_DIRS ${COLLADA_INCLUDE_DIRS})
67 LIST(APPEND DEP_LIBRARIES ${COLLADA_LIBRARIES})
73 SET(Boost_USE_MULTITHREAD ON)
74 SET(Boost_STATIC_LIBS OFF)
77 SET(Boost_COMPONENTS filesystem)
78 FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
80 FIND_PACKAGE(Boost REQUIRED)
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")
92 LIST(APPEND DEP_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
93 LIST(APPEND DEP_LIBRARIES ${Boost_LIBRARIES})
99 FIND_PACKAGE(OpenSG REQUIRED COMPONENTS ${OSG_COMPONENTS})
102 #############################################################################
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})