-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
executable file
·75 lines (63 loc) · 2.36 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
#
# Usage:
# - mkdir build && cd build
# - cmake -G"Unix Makefiles" ..
# - make
#
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0015 NEW)
# project name
project(3dNovac)
set(NC_LICENSE "LGPL")
message("*** 3dNovac use ${NC_LICENSE} license ***")
set(NC_VERSION_MAJOR 0)
set(NC_VERSION_MINOR 1)
set(NC_VERSION "${NC_VERSION_MAJOR}.${NC_VERSION_MINOR}" )
add_definitions(-DNC_VERSION=\"${NC_VERSION}\")
message("*** Using Nc version ${NC_VERSION} ***")
# remove graphical libs if we don't find Opengl, we most likely are building on a server.
find_package(OpenGL QUIET)
if (NOT ${OPENGL_FOUND})
message("*** Can't find OpenGL, removing Graphical libs from build. ***")
set(NC_BUILD_GRAPHIC_LIBS false)
else()
set(NC_BUILD_GRAPHIC_LIBS true)
endif()
if(NOT DEFINED NC_BUILD_PLUGINS)
set(NC_BUILD_PLUGINS true CACHE BOOL "If true, add the plugins to the project.")
endif()
if(NOT DEFINED NC_BUILD_DEMOS)
set(NC_BUILD_DEMOS true CACHE BOOL "If true, add the demos to the project.")
endif()
if(NOT DEFINED NC_BUILD_EXAMPLES)
set(NC_BUILD_EXAMPLES true CACHE BOOL "If true, add the examples to the project.")
endif()
# executable and libraries output path
set(LIBRARY_OUTPUT_PATH ${3dNovac_SOURCE_DIR}/lib CACHE PATH "Single directory for all libraries.")
set(EXECUTABLE_OUTPUT_PATH ${3dNovac_SOURCE_DIR}/bin CACHE PATH "Single directory for all executables.")
mark_as_advanced(EXECUTABLE_OUTPUT_PATH)
mark_as_advanced(LIBRARY_OUTPUT_PATH)
# add 3dNovac modules
# the second argument is usefull for an out of source build.
add_subdirectory(./Nc/Core/ ./Nc/Core/)
add_subdirectory(./Nc/Net/ ./Nc/Net/)
if (NC_BUILD_GRAPHIC_LIBS)
add_subdirectory(./Nc/Graphics/ ./Nc/Graphics/)
add_subdirectory(./Nc/GUI/ ./Nc/GUI/)
add_subdirectory(./Nc/Contrib/ ./Nc/Contrib/)
add_subdirectory(./Nc/Audio/ ./Nc/Audio/)
endif()
# Following projects won't be compiled with the ALL target or when you execute "make", to compile then, you must specify the target in your IDE or by "make 'TargetName'".
# Those projects are optional.
# plugins
if(NC_BUILD_PLUGINS AND NC_BUILD_GRAPHIC_LIBS)
add_subdirectory(./Plugin/FileFormatCollada/ ./Plugin/FileFormatCollada/)
endif()
# examples
if(NC_BUILD_EXAMPLES AND NC_BUILD_GRAPHIC_LIBS)
add_subdirectory(./Examples/ ./Examples/)
endif()
# demos
if(NC_BUILD_DEMOS AND NC_BUILD_GRAPHIC_LIBS)
add_subdirectory(./Demos/ ./Demos/)
endif()