-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
118 lines (107 loc) · 3.77 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
cmake_minimum_required (VERSION 3.0)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/")
project(AlloStreamer)
set(ENABLE_ALLOSHARED ON CACHE BOOL "")
set(ENABLE_ALLOSERVER ON CACHE BOOL "")
set(ENABLE_CUBEMAPEXTRACTIONPLUGIN ON CACHE BOOL "")
set(ENABLE_UNITYRENDERINGPLUGIN ON CACHE BOOL "")
set(ENABLE_ALLORECEIVER ON CACHE BOOL "")
set(ENABLE_ALLOPLAYER ON CACHE BOOL "")
set(ENABLE_WINDOWEDPLAYER ON CACHE BOOL "")
set(ENABLE_OCULUSPLAYER ON CACHE BOOL "")
set(ENABLE_TRAFFICMONITOR ON CACHE BOOL "")
set(ENABLE_ALLOSERVER_BINOCULARS ON CACHE BOOL "")
set(ENABLE_RENDERINGPLUGIN_BINOCULARS ON CACHE BOOL "")
set(ENABLE_UNITYSCRIPTS_BINOCULARS ON CACHE BOOL "")
set(ENABLE_ALLOUNITYPLAYER ON CACHE BOOL "")
# Boost setup
set(Boost_USE_STATIC_RUNTIME OFF)
set(Boost_USE_STATIC_LIBS OFF)
add_definitions(-DBOOST_ALL_DYN_LINK)
add_definitions(-DROOT_DIR="${CMAKE_SOURCE_DIR}")
if(WIN32)
add_definitions(-DBOOST_INTERPROCESS_BOOTSTAMP_IS_LASTBOOTUPTIME) # prevents error when startup time is not in Windows sys log
add_definitions(-DBOOST_INTERPROCESS_WINDOWS)
endif()
# Use unicode in every project
add_definitions(-DUNICODE -D_UNICODE)
# In case the libraries have to be connected to Unity
set(UNITY_PROJECT_DIR "${CMAKE_SOURCE_DIR}/AlloStreamer/" CACHE PATH "")
set(UNITY_PROJECT_ASSETS_DIR "${UNITY_PROJECT_DIR}/Assets/")
set(UNITY_PROJECT_PLUGIN_DIR "${UNITY_PROJECT_ASSETS_DIR}/Plugins")
string(REGEX REPLACE "C:" "/c" UNITY_PROJECT_ASSETS_DIR_MSYS ${UNITY_PROJECT_ASSETS_DIR})
mark_as_advanced(UNITY_PROJECT_ASSETS_DIR UNITY_PROJECT_PLUGIN_DIR UNITY_PROJECT_ASSETS_DIR_MSYS)
# so that each project can include the other project's headers
include_directories(${CMAKE_SOURCE_DIR})
# configure scripts
configure_file(${CMAKE_SOURCE_DIR}/Scripts/uploadToAlloSphere.sh.template
${CMAKE_SOURCE_DIR}/Scripts/uploadToAlloSphere.sh
@ONLY
)
# Enable C++11
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
CMAKE_COMPILER_IS_GNUCXX)
# We are using C++11 features and
# we are linking static libs into shared libs
# (AlloShared linked into CubemapExtractionPlugin),
# thus the PIC.
# The decision was made against making AlloShared a shared lib
# since it needs to be loadable by the CubemapExtractionPlugin and, in turn, by Unity3D.
# However, Unity3D doesn't give us the possibility to set the search path
# for shared libs and makes it very cumbersome to load external shared libs.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC")
endif()
# make exes and libs profilable on windows
if(MSVC)
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG
"${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /PROFILE"
)
set(CMAKE_STATIC_LINKER_FLAGS_DEBUG
"${CMAKE_STATIC_LINKER_FLAGS_DEBUG} /PROFILE"
)
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG
"${CMAKE_MODULE_LINKER_FLAGS_DEBUG} /PROFILE"
)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG
"${CMAKE_EXE_LINKER_FLAGS_DEBUG} /PROFILE"
)
endif()
if(ENABLE_ALLOSHARED)
add_subdirectory(AlloShared)
endif()
if(ENABLE_ALLOSERVER)
add_subdirectory(AlloServer)
endif()
if(ENABLE_CUBEMAPEXTRACTIONPLUGIN)
add_subdirectory(CubemapExtractionPlugin)
endif()
if(ENABLE_UNITYRENDERINGPLUGIN)
add_subdirectory(UnityRenderingPlugin)
endif()
if(ENABLE_ALLORECEIVER)
add_subdirectory(AlloReceiver)
endif()
if(ENABLE_ALLOPLAYER)
add_subdirectory(AlloPlayer)
endif()
if(ENABLE_WINDOWEDPLAYER)
add_subdirectory(WindowedPlayer)
endif()
if(ENABLE_OCULUSPLAYER)
add_subdirectory(OculusPlayer)
endif()
if(ENABLE_TRAFFICMONITOR)
add_subdirectory(TrafficMonitor)
endif()
if(ENABLE_ALLOSERVER_BINOCULARS)
add_subdirectory(AlloServer_Binoculars)
endif()
if(ENABLE_RENDERINGPLUGIN_BINOCULARS)
add_subdirectory(RenderingPlugin_Binoculars)
endif()
if(ENABLE_UNITYSCRIPTS_BINOCULARS)
add_subdirectory(UnityScripts_Binoculars)
endif()
if(ENABLE_ALLOUNITYPLAYER)
add_subdirectory(AlloUnityPlayer)
endif()