forked from Eyescale/Equalizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
214 lines (178 loc) · 6.39 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# Copyright (c) 2010-2017 Stefan Eilemann <[email protected]>
# Daniel Pfeifer <[email protected]>
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(Equalizer VERSION 2.1.0)
set(Equalizer_VERSION_ABI 210)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake
${CMAKE_SOURCE_DIR}/CMake/common)
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/CMake/common/Common.cmake)
message(FATAL_ERROR "CMake/common missing, run: git submodule update --init")
endif()
set(EQUALIZER_INCLUDE_NAME eq)
set(EQUALIZER_DEB_DEPENDS bison flex libboost-program-options-dev
libboost-filesystem-dev libboost-system-dev libboost-thread-dev
libx11-dev libgl1-mesa-dev libglewmx1.6-dev libspnav-dev
libopenscenegraph-dev libopencv-dev qtbase5-dev)
set(EQUALIZER_PORT_DEPENDS boost opencv qt5)
include(Common)
option(EQUALIZER_USE_OSG "Test for OpenSceneGraph support" ON)
option(EQUALIZER_USE_HWLOC "Test for hwloc support (experimental)" OFF)
option(EQUALIZER_INSTALL_SERVER_HEADERS "Install Equalizer server headers" OFF)
option(EQUALIZER_BUILD_2_0_API
"Enable for pure 2.0 API (breaks compatibility with 1.x API)" OFF)
option(EQUALIZER_PREFER_QT "Prefer Qt window system over X11 on OS X" OFF)
mark_as_advanced(EQUALIZER_INSTALL_SERVER_HEADERS)
set(DPUT_HOST ppa:bbp/ppa)
set(COMMON_PROJECT_DOMAIN ch.eyescale)
set(EQUALIZER_DESCRIPTION "Parallel Rendering Framework")
set(EQUALIZER_MAINTAINER "Stefan Eilemann <[email protected]>")
set(EQUALIZER_LICENSE LGPL BSD)
if(EQUALIZER_BUILD_2_0_API)
list(APPEND COMMON_FIND_PACKAGE_DEFINES EQ_2_0_API)
else()
list(APPEND COMMON_FIND_PACKAGE_DEFINES EQ_1_0_API)
endif()
if(APPLE)
if(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
set(EQ_AGL_USED 1)
endif()
# WAR otherwise MacPorts X11 (/opt/local) is preferred
list(REMOVE_ITEM CMAKE_SYSTEM_LIBRARY_PATH /opt/local/lib /usr/local/lib)
list(REMOVE_ITEM CMAKE_SYSTEM_PREFIX_PATH /opt/local /usr/local)
link_directories(/opt/X11/lib /usr/X11R6/lib)
include_directories(SYSTEM /opt/X11/include /usr/X11R6/include)
endif()
if(MSVC)
include(UseGnuWin32)
else()
set(PTHREAD_LIBRARIES pthread)
endif()
common_find_package(Boost REQUIRED COMPONENTS
program_options filesystem system thread)
common_find_package(BISON REQUIRED)
common_find_package(Collage REQUIRED)
common_find_package(Deflect)
common_find_package(FLEX REQUIRED)
common_find_package(GLStats)
common_find_package(hwloc)
common_find_package(hwsd)
common_find_package(Lunchbox REQUIRED)
common_find_package(MAGELLAN)
common_find_package(OpenCV)
common_find_package(OpenMP)
common_find_package(OpenGL REQUIRED)
if(EQUALIZER_USE_OSG)
common_find_package(OpenSceneGraph SYSTEM COMPONENTS osgDB osgUtil)
endif()
common_find_package(Pression REQUIRED)
common_find_package(Qt5Core)
common_find_package(Qt5Gui)
common_find_package(Qt5Widgets)
common_find_package(vmmlib REQUIRED)
common_find_package(VRPN)
common_find_package(X11 SYSTEM)
common_find_package(ZeroEQ)
common_find_package(ZeroBuf)
if(APPLE) # tweak window systems before finding glew
if(EQ_AGL_USED)
common_find_package_disable(X11)
else()
if(EQUALIZER_PREFER_QT AND Qt5Gui_FOUND)
common_find_package_disable(X11)
elseif(X11_FOUND)
common_find_package_disable(Qt5Core Qt5Gui Qt5Widgets)
endif()
endif()
endif()
common_find_package(GLEW_MX)
list(APPEND COMMON_FIND_PACKAGE_DEFINES GLEW_MX GLEW_NO_GLU)
if(GLEW_MX_FOUND)
list(APPEND COMMON_FIND_PACKAGE_DEFINES EQ_FOUND_GLEW_MX)
else()
list(APPEND COMMON_FIND_PACKAGE_DEFINES GLEW_BUILD EQ_GLEW_INTERNAL)
if(X11_FOUND AND APPLE)
list(APPEND COMMON_FIND_PACKAGE_DEFINES GLEW_APPLE_GLX)
endif()
endif()
if(WIN32)
list(APPEND COMMON_FIND_PACKAGE_DEFINES WGL) # deprecated
list(APPEND COMMON_FIND_PACKAGE_DEFINES EQ_WGL_USED)
endif()
if(Qt5Gui_FOUND AND Qt5Gui_VERSION VERSION_GREATER 5.0)
set(EQ_QT_USED 1)
endif()
if(X11_FOUND)
set(EQ_GLX_USED 1)
endif()
include(EqGLLibraries)
if(EQ_GLX_USED)
list(APPEND COMMON_FIND_PACKAGE_DEFINES GLX) # deprecated
list(APPEND COMMON_FIND_PACKAGE_DEFINES EQ_GLX_USED)
if(MAGELLAN_FOUND AND NOT APPLE)
list(APPEND COMMON_FIND_PACKAGE_DEFINES EQUALIZER_USE_MAGELLAN_GLX)
endif()
elseif(EQ_AGL_USED)
list(APPEND COMMON_FIND_PACKAGE_DEFINES AGL) # deprecated
list(APPEND COMMON_FIND_PACKAGE_DEFINES EQ_AGL_USED)
endif()
if(EQ_QT_USED)
list(APPEND COMMON_FIND_PACKAGE_DEFINES EQ_QT_USED)
endif()
if(NOT EQUALIZER_USE_OSG)
set(OPENSCENEGRAPH_FOUND)
endif()
if(NOT EQUALIZER_USE_HWLOC)
common_find_package_disable(hwloc)
set(HWLOC_GL_FOUND)
endif()
if(HWLOC_GL_FOUND)
list(APPEND COMMON_FIND_PACKAGE_DEFINES EQUALIZER_USE_HWLOC_GL)
endif()
common_find_package_post()
if(APPLE)
LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /opt/local/lib /usr/local/lib)
LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH /opt/local /usr/local)
endif()
list(APPEND CPPCHECK_EXTRA_ARGS -DEQUALIZERFABRIC_STATIC=)
if(APPLE)
add_definitions(-DDarwin)
endif(APPLE)
list(APPEND EQ_DEFINITIONS -DEQ_BUILD_DIR="${CMAKE_BINARY_DIR}/")
if(EQUALIZER_BUILD_2_0_API)
list(APPEND EQ_DEFINITIONS -DEQ_2_0_API)
endif()
add_definitions(${EQ_DEFINITIONS})
include(GLEW/CMakeLists.txt)
add_subdirectory(eq)
add_subdirectory(seq)
add_subdirectory(tools) # before examples, they depend on it
add_subdirectory(examples)
if(EXISTS "${Equalizer_SOURCE_DIR}/tests/CMakeLists.txt" )
add_subdirectory(tests)
endif()
if(EXISTS "${CMAKE_SOURCE_DIR}/auxiliary" AND
IS_DIRECTORY "${CMAKE_SOURCE_DIR}/auxiliary")
add_subdirectory(auxiliary)
endif()
add_subdirectory(doc)
set(EQUALIZER_DEPENDENT_LIBRARIES vmmlib Lunchbox Collage)
if(GLEW_MX_FOUND)
list(APPEND EQUALIZER_DEPENDENT_LIBRARIES GLEW_MX)
endif()
common_install(RELATIVE
FILES ${CMAKE_SOURCE_DIR}/CMake/common/FindGLEW_MX.cmake
CMake/EqGLLibraries.cmake
DESTINATION ${CMAKE_MODULE_INSTALL_PATH}
COMPONENT dev)
install(FILES ${DEFINES_FILE} DESTINATION include/eq COMPONENT dev)
set(DOXYGEN_EXTRA_INPUT "${CMAKE_INSTALL_PREFIX}/include/seq ${CMAKE_INSTALL_PREFIX}/share/Equalizer/examples")
set(DOXYGEN_EXTRA_EXCLUDE "${CMAKE_INSTALL_PREFIX}/include/eq/admin {CMAKE_INSTALL_PREFIX}/include/GL")
include(CPackConfig)
set(DOXYGEN_MAINPAGE_MD README.md)
set(DOXYGEN_EXTRA_INPUT
"${PROJECT_SOURCE_DIR}/README.md ${CMAKE_INSTALL_PREFIX}/include/seq")
include(DoxygenRule) # must be after all targets
set(CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION}
# http://public.kitware.com/Bug/view.php?id=10179
"ld: warning: duplicate dylib")
include(CTest)