This repository has been archived by the owner on Feb 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
/
CMakeLists.txt
165 lines (125 loc) · 3.7 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# ==============================
# CMAKE Configuration for OSGART
# ==============================
# CMake version
cmake_minimum_required(VERSION 2.8.9)
# ==== Global Configuration ====
# Project definition
project(osgART)
# ==== Find Packages/Libs Dependencies ====
# Find OpenSceneGraph + NodeKits
#note: minimum version: 3.2.0
find_package(OpenSceneGraph 3.2.0 REQUIRED osg osgUtil osgDB osgGA osgText osgViewer osgParticle osgManipulator)
# Find OpenGL
find_package(OpenGL REQUIRED)
# OSGART Version
set(OSGART_VERSION_MAJOR 2)
set(OSGART_VERSION_MINOR 0)
set(OSGART_VERSION_PATCH 2)
set(OSGART_VERSION_FULL ${OSGART_VERSION_MAJOR}.${OSGART_VERSION_PATCH}.${OSGART_VERSION_PATCH})
# Patch in the osgART CMake module directory
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeModules)
if(WIN32)
set(CMAKE_DEBUG_POSTFIX "_debug")
endif(WIN32)
# make executable style configurable
set(OSGART_EXECUTABLE_TYPE)
# some include
include(OSGARTUtils)
# on *nix we need to make sure the local include
# directory is first
include_directories(
${CMAKE_SOURCE_DIR}/include
${OPENSCENEGRAPH_INCLUDE_DIRS}
)
# Mac needs these for building the examples
if(APPLE)
find_library(CARBON_LIBRARY Carbon REQUIRED)
find_library(COCOA_LIBRARY Cocoa REQUIRED)
find_library(QUICKTIME_LIBRARY QuickTime REQUIRED)
endif(APPLE)
#
# If we are on 64bit machines we use lib64 for installing
#
# set(OSGART_LIB_PREFIX "lib")
# if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
# set(OSGART_LIB_PREFIX "lib64")
# endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE PATH "Executables go here")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE PATH "Libraries go here")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE PATH "Libraries go here")
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/staging CACHE PATH "Installation goes here" FORCE)
install(FILES
${CMAKE_SOURCE_DIR}/AUTHORS.txt
${CMAKE_SOURCE_DIR}/ChangeLog.txt
${CMAKE_SOURCE_DIR}/README.txt
${CMAKE_SOURCE_DIR}/LICENSE.txt
DESTINATION "share/osgART"
)
# ==== Find Optional Packages/Libs Dependencies ====
## Examples
#
# library and plugin code here
#
add_subdirectory(src)
#
# Applications
#
option(OSGART_BUILD_APPLICATIONS "Build all applications (viewer)" ON)
if(OSGART_BUILD_APPLICATIONS)
add_subdirectory(applications)
endif()
#
# Examples
#
option(OSGART_BUILD_EXAMPLES "Build all examples" OFF)
if(OSGART_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
#
# Build API docs / but only if Doxygen is available
#
find_package(Doxygen)
if(DOXYGEN_FOUND)
option(OSGART_BUILD_APIDOC "Build API Documentation" OFF)
if (OSGART_BUILD_APIDOC)
configure_file(
${CMAKE_SOURCE_DIR}/CMakeModules/osgART.dox.in
${CMAKE_BINARY_DIR}/.doxygen/osgART.dox
@ONLY
)
add_custom_target("docs"
COMMENT "Building API docs from headers"
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/.doxygen/osgART.dox
DEPENDS osgART
VERBATIM
)
install(DIRECTORY ${CMAKE_BINARY_DIR}/doc
DESTINATION "share/osgART"
COMPONENT "API Documentation"
)
endif()
endif()
# ==== Uninstall ====
#
# Uninstall
#
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
# ==== Packaging ====
#
# Optional packaging for osgART 2.0 SDK
#
option(OSGART_BUILD_PACKAGE "Build distribution packages" OFF)
if(OSGART_BUILD_PACKAGE)
configure_file(
${CMAKE_SOURCE_DIR}/CMakeModules/Packaging.cmake.in
${CMAKE_BINARY_DIR}/.cpack/OSGARTPackaging.cmake
@ONLY IMMEDIATE
)
include(${CMAKE_BINARY_DIR}/.cpack/OSGARTPackaging.cmake)
endif()