-
Notifications
You must be signed in to change notification settings - Fork 168
/
CMakeLists.txt
68 lines (58 loc) · 2.35 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
PROJECT(OSG_Cookbook)
INCLUDE(CheckIncludeFiles)
IF(WIN32)
IF(MSVC)
ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
ENDIF(MSVC)
ELSE(WIN32)
SET(CMAKE_CXX_FLAGS "-W -Wall -Wno-unused")
ENDIF(WIN32)
FIND_PATH(OPENSCENEGRAPH_INCLUDE_DIR osg/Referenced
PATHS
$ENV{OSG_ROOT}/include
$ENV{OSG_DIR}/include
/usr/include
/usr/local/include
)
FIND_PATH(OPENSCENEGRAPH_LIB_DIR libosg.so osg.lib
PATHS
$ENV{OSG_ROOT}/lib
$ENV{OSG_DIR}/lib
/usr/lib
/usr/local/lib
)
INCLUDE_DIRECTORIES(common ${OPENSCENEGRAPH_INCLUDE_DIR})
LINK_DIRECTORIES(${OPENSCENEGRAPH_LIB_DIR})
SET(COMMON_FILES
${CMAKE_SOURCE_DIR}/cookbook/common/CommonFunctions.cpp
${CMAKE_SOURCE_DIR}/cookbook/common/CommonFunctions
)
MACRO(START_EXAMPLE)
INCLUDE_DIRECTORIES(${EXTERNAL_INCLUDE_DIR})
ADD_EXECUTABLE(${EXAMPLE_NAME} ${EXAMPLE_FILES} ${COMMON_FILES})
SET_TARGET_PROPERTIES(${EXAMPLE_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
TARGET_LINK_LIBRARIES(${EXAMPLE_NAME}
debug osg${CMAKE_DEBUG_POSTFIX} optimized osg
debug osgAnimation${CMAKE_DEBUG_POSTFIX} optimized osgAnimation
debug osgParticle${CMAKE_DEBUG_POSTFIX} optimized osgParticle
debug osgDB${CMAKE_DEBUG_POSTFIX} optimized osgDB
debug osgGA${CMAKE_DEBUG_POSTFIX} optimized osgGA
debug osgText${CMAKE_DEBUG_POSTFIX} optimized osgText
debug osgUtil${CMAKE_DEBUG_POSTFIX} optimized osgUtil
debug osgViewer${CMAKE_DEBUG_POSTFIX} optimized osgViewer
debug OpenThreads${CMAKE_DEBUG_POSTFIX} optimized OpenThreads
${EXTERNAL_LIBRARIES}
)
INSTALL(TARGETS ${EXAMPLE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
ENDMACRO(START_EXAMPLE)
#ADD_SUBDIRECTORY(chapter1) # CUSTOMZING OPENSCENEGRAPH (no source)
ADD_SUBDIRECTORY(chapter2) # DESIGNING THE SCENE GRAPH
ADD_SUBDIRECTORY(chapter3) # EDITING GEOMETRY MODELS
ADD_SUBDIRECTORY(chapter4) # MANIPULATING THE VIEW
ADD_SUBDIRECTORY(chapter5) # ANIMATING EVERYTHING
ADD_SUBDIRECTORY(chapter6) # CREATING CREATIVE EFFECTS
#ADD_SUBDIRECTORY(chapter7) # VISUALIZING THE WORLD (no source)
ADD_SUBDIRECTORY(chapter8) # MANAGING MASSIVE DATA
ADD_SUBDIRECTORY(chapter9) # INTEGRATING WITH GUI
ADD_SUBDIRECTORY(chapter10) # DISCUSSION IN DEPTH