-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
253 lines (216 loc) · 7.06 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(BrainView)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake
${CMAKE_SOURCE_DIR}/CMake/common)
include(GitExternal)
set(VERSION_MAJOR "0")
set(VERSION_MINOR "1")
set(VERSION_PATCH "0")
set(VERSION_ABI 1)
set(BRAINVIEW_DESCRIPTION "Blue Brain Plugin for ParaView")
set(BRAINVIEW_MAINTAINER "CSCS <[email protected]>")
set(BRAINVIEW_LICENSE BSD)
set(BUILD_TESTING OFF CACHE BOOL "Tests")
set(BUILD_EXAMPLES OFF CACHE BOOL "Examples")
set(PARAVIEW_QT_VERSION 5 CACHE STRING "Qt Version")
set(PARAVIEW_USE_MPI ON CACHE BOOL "Use MPI")
set(COMMON_PROJECT_DOMAIN ch.epfl.bluebrain)
include(Common)
common_package(Boost REQUIRED COMPONENTS filesystem program_options
serialization system thread unit_test_framework)
common_package(HDF5 REQUIRED)
common_package(BBPSDK REQUIRED)
common_package(ParaView REQUIRED)
common_package(pvZoltan)
include(${PARAVIEW_USE_FILE})
include(vtkModuleAPI)
include(vtkModuleMacros)
include(ParaViewMacros)
# --------------------------------------------------------------
# setup paths to 'default' data
# --------------------------------------------------------------
site_name(MACHINE)
if (MACHINE MATCHES "carona")
set(PV_BBP_DEFAULT_DATA "/Users/biddisco/data/bbp/egpgv/centralV.cfg")
set(PV_BBP_DEFAULT_TARGET "5K")
elseif (MACHINE MATCHES "bbpviz")
set (PV_BBP_DEFAULT_DATA "/gpfs/bbp.cscs.ch/project/proj3/resources/circuits/summit2015demo/BlueConfig")
set(PV_BBP_DEFAULT_TARGET "demo")
elseif (MACHINE MATCHES "crusca")
set (PV_BBP_DEFAULT_DATA "/gpfs/bbp.cscs.ch/project/proj3/resources/circuits/summit2015demo/BlueConfig")
set(PV_BBP_DEFAULT_TARGET "1K")
else ()
set (PV_BBP_DEFAULT_DATA "/gpfs/bbp.cscs.ch/project/proj3/resources/circuits/summit2015demo/BlueConfig")
set(PV_BBP_DEFAULT_TARGET "demo")
endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/vtkCircuitReaderBase.xml.in
${CMAKE_CURRENT_BINARY_DIR}/vtkCircuitReaderBase.xml
@ONLY
)
# --------------------------------------------------------------
# Build main plugin
# --------------------------------------------------------------
# --------------------------------------------------
# Plugin config
# --------------------------------------------------
# PLUGIN PATHS
set(XML_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
set(SRC_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
#--------------------------------------------------
# pv-zoltan : Required for depth sort
#--------------------------------------------------
if(PVZOLTAN_FOUND)
set(ZOLTAN_SUPPORT 1)
ADD_DEFINITIONS(-DZOLTAN_SUPPORT -DPV_BBP_USE_ZOLTAN)
set(ZOLTAN_LIBS pv_zoltan)
include_directories(${COMMON_SOURCE_DIR}/pvZoltan ${Trilinos_INCLUDE_DIRS})
set(PVZOLTAN_TARGET pvZoltan)
endif()
#--------------------------------------------------
# pv-temporal : Required for spike display
#--------------------------------------------------
set(TEMPORAL_SUPPORT 1)
ADD_DEFINITIONS(-DTEMPORAL_SUPPORT -DPV_BBP_USE_TEMPORAL)
set(TEMPORAL_LIBS pv_temporal)
include_directories(${COMMON_SOURCE_DIR}/pv-temporal)
#--------------------------------------------------
# Includes
#--------------------------------------------------
get_filename_component(PLUGIN_PATH ${CMAKE_CURRENT_SOURCE_DIR} ABSOLUTE)
include_directories(
${PLUGIN_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/Piston
)
#--------------------------------------------------
# CONDITIONAL : Setup Qt/GUI panel sources/wrapping
#--------------------------------------------------
IF(PARAVIEW_BUILD_QT_GUI)
if (PARAVIEW_QT_VERSION VERSION_GREATER "4")
set (Qt5_FIND_COMPONENTS Widgets)
include (ParaViewQt5)
QT5_WRAP_CPP(
BBP_MOC_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/pqCircuitReaderPanelBase.h
${CMAKE_CURRENT_SOURCE_DIR}/pqCircuitReaderPanelMesh.h
${CMAKE_CURRENT_SOURCE_DIR}/pqCircuitReaderPanelSoma.h
)
QT5_WRAP_UI(
BBP_UI_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/pqCircuitReaderPanelBase.ui
)
else ()
include (${QT_USE_FILE})
QT4_WRAP_CPP(
BBP_MOC_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/pqCircuitReaderPanelBase.h
${CMAKE_CURRENT_SOURCE_DIR}/pqCircuitReaderPanelMesh.h
${CMAKE_CURRENT_SOURCE_DIR}/pqCircuitReaderPanelSoma.h
)
QT4_WRAP_UI(
BBP_UI_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/pqCircuitReaderPanelBase.ui
)
endif ()
ADD_PARAVIEW_OBJECT_PANEL(
BBP_IFACE
BBP_IFACE_SRCS
CLASS_NAME
pqCircuitReaderPanelMesh
XML_NAME
CircuitReaderMesh
XML_GROUP
sources
)
ADD_PARAVIEW_OBJECT_PANEL(
BBP_IFACE
BBP_IFACE_SRCS
CLASS_NAME
pqCircuitReaderPanelSoma
XML_NAME
CircuitReaderSoma
XML_GROUP
sources
)
ENDIF(PARAVIEW_BUILD_QT_GUI)
#--------------------------------------------------
# Define plugin sources
#--------------------------------------------------
SET(PLUGIN_NAME pv_BBP)
ADD_PARAVIEW_PLUGIN(
${PLUGIN_NAME}
"1.0"
REQUIRED_PLUGINS ${PVZOLTAN_TARGET} pv_temporal
SERVER_MANAGER_XML
${XML_PATH}/vtkNeuronAlphaFunction.xml
#
${CMAKE_CURRENT_BINARY_DIR}/vtkCircuitReaderBase.xml
${XML_PATH}/vtkCircuitReaderMesh.xml
${XML_PATH}/vtkCircuitReaderSoma.xml
${XML_PATH}/vtkNeuronSpikeFilter.xml
${XML_PATH}/vtkNeuronSpikeTableSource.xml
SERVER_MANAGER_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/vtkNeuronAlphaFunction.cxx
#
${CMAKE_CURRENT_SOURCE_DIR}/vtkCircuitReaderBase.cxx
${CMAKE_CURRENT_SOURCE_DIR}/vtkCircuitReaderMesh.cxx
${CMAKE_CURRENT_SOURCE_DIR}/vtkCircuitReaderSoma.cxx
${CMAKE_CURRENT_SOURCE_DIR}/vtkNeuronSpikeFilter.cxx
${CMAKE_CURRENT_SOURCE_DIR}/vtkNeuronSpikeTableSource.cxx
SERVER_SOURCES
GUI_INTERFACES
${BBP_IFACE}
GUI_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/pqCircuitReaderPanelBase.cxx
${CMAKE_CURRENT_SOURCE_DIR}/pqCircuitReaderPanelMesh.cxx
${CMAKE_CURRENT_SOURCE_DIR}/pqCircuitReaderPanelSoma.cxx
${BBP_IFACE_SRCS}
${BBP_MOC_SRCS}
${BBP_UI_SOURCES}
)
if(ADD_CXX)
# message("Adding C++0x flag for Depth Sort")
# set_target_properties(pv_BBP PROPERTIES COMPILE_FLAGS "-std=c++0x -I/usr/include/c++/4.2.1/tr1")
endif()
#--------------------------------------------------
# setup plugin linking
#--------------------------------------------------
TARGET_LINK_LIBRARIES(${PLUGIN_NAME}
PUBLIC
${PVZOLTAN_TARGET}
pv_temporal
vtksys
BBPSDK Brion Lunchbox pthread
hdf5_cpp
hdf5
${CUDA_LIBRARIES}
${HDF5_C_LIBRARY}
${HDF5_CXX_LIBRARY}
${Boost_SERIALIZATION_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_SERIALIZATION_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
)
#--------------------------------------------------
# A simple test of link against plugin
#--------------------------------------------------
add_executable(test_bbplink test_bbplink.cpp)
target_link_libraries(test_bbplink
${PLUGIN_NAME}
)
return()
#--------------------------------------------------
# Install
#--------------------------------------------------
SET(INSTALL_PATH
"${CMAKE_INSTALL_PREFIX}/lib/paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}"
)
INSTALL(
TARGETS
${PLUGIN_NAME}
DESTINATION ${INSTALL_PATH}
)