forked from SIVICLab/sivic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.ctest
288 lines (240 loc) · 12.6 KB
/
Makefile.ctest
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
#
# $URL$
# $Rev$
# $Author$
# $Date$
#
OSTYPE := $(shell uname -s)
VTK_DIR = /netopt/lib/vtk-5.6
VTK6_DIR_DIST = /netopt/VTK/VTK-6.3.0/lib/cmake/vtk-6.3/
VTK6_DIR_DBG = /netopt/VTK/VTK-6.3.0_debug/lib/cmake/vtk-6.3/
VTK6_DIR_M32_EPIC = /netopt/VTK/VTK-6.3.0_m32_epic/lib/cmake/vtk-6.3/
KWW_DIR = /netopt/kwwidgets_2.0_56/lib/KWWidgets/
KWW6_DIR_DIST = /netopt/kwwidgets_vtk6/
KWW6_DIR_DBG = /netopt/kwwidgets_vtk6_debug/
DCMTK_DIR = /netopt/rhel7/versions/dcmtk/dcmtk-3.6.7
#DCMTK_DIR = /netopt/rhel7/dicom
#DCMTK_DIR = /netopt/dicom
# check test_data out of radiology trac into test_data
SIVIC_ROOT = $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
SVK_TEST_ROOT = ${SIVIC_ROOT}/test_data
OUTPUT_LOG = ${PWD}/ctest_logs/atom
CMAKE_DIR = /usr/bin
CMAKE_DIR_GE = /usr/bin
XVFB_RUN = ${SIVIC_ROOT}/tests/scripts/xvfb-run
SVN_COMMAND = /netopt/bin/svn
CLAPACK_DIR = /opt/src/freeware/clapack/clapack-3.2.1-CMAKE
ITK_DIR = /netopt/InsightToolkit/InsightToolkit-4.4.1/lib/cmake/ITK-4.4
ADD_LINK_DIRS =
CMAKE_PREFIX_PATH = ${VTK_DIR}
NUM_JOBS = 16
# Mac OS X
ifeq ($(OSTYPE),Darwin)
CMAKE_DIR := /usr/local/bin
DCMTK_DIR := /usr/local/dicom
CLAPACK_DIR := /usr/local/clapack-3.2.1-CMAKE
VTK6_DIR_DBG := /usr/local/vtk6.3/lib/cmake/vtk-6.3
VTK6_DIR_DIST := /usr/local/vtk6.3/lib/cmake/vtk-6.3
KWWidgets_DIR := /usr/local/kwwidgets_vtk6/lib/KWWidgets
KWW_DIR := /usr/local/kwwidgets_vtk6/lib/KWWidgets
KWW6_DIR_DIST := /usr/local/kwwidgets_vtk6/lib/KWWidgets
KWW6_DIR_DBG := /usr/local/kwwidgets_vtk6/lib/KWWidgets
ITK_DIR := /usr/local/ITK4.9/lib/cmake/ITK-4.9
ADD_LINK_DIRS := -DADD_LINK_DIRS=/opt/local/lib
CMAKE_CXX_FLAGS := -I/usr/X11R6/include
CMAKE_EXE_LINKER_FLAGS := -L/usr/X11R6/lib
OPENGL_INCLUDE_DIR := /usr/X11R6/include
OPENGL_gl_LIBRARY := -framework OpenGL;/usr/X11R6/lib/libGL.dylib
OPENGL_glu_LIBRARY := /usr/X11R6/lib/libGLU.dylib
endif
ifeq ($(OS), SunOS)
if ( "`/bin/uname`" == "SunOS" ) then
GETOPT_LIB = /netopt/lib/local/libgnu.a
endif
#
# Add flags for source code coverage determination
#
CMAKE_CXX_FLAGS_TEST = "-g -O0 -fprofile-arcs -ftest-coverage"
RM_CACHE = ${RM} CMakeCache.txt;
CONFIG_OPTS_VTK5 = -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} \
-DKWWidgets_DIR=${KWWidgets_DIR} \
-DVTK_DIR=${VTK_DIR} \
-DKWWidgets_DIR=${KWW_DIR} \
-DBUILD_CLAPACK=ON \
-DBUILD_ITK=ON \
-DITK_DIR=${ITK_DIR} \
-DCLAPACK_DIR=${CLAPACK_DIR} \
-DDCMTK_DIR=${DCMTK_DIR} \
-DBUILD_APPS=ON \
-DBUILD_EXAMPLES=OFF \
-DGETOPT_LIB=${GETOPT_LIB} \
-DBUILD_SIVIC=ON \
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} \
-DSVNCOMMAND=${SVN_COMMAND} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DMAKECOMMAND="/usr/bin/gmake -i -j64"
CMAKE_PREFIX_PATH_DBG = ${VTK6_DIR_DBG}
CMAKE_PREFIX_PATH_DIST = ${VTK6_DIR_DIST}
CMAKE_PREFIX_PATH_EPIC32= ${VTK6_DIR_M32_EPIC}
CONFIG_OPTS_VTK6_DBG = -DCMAKE_PREFIX_PATH=${VTK6_DIR_DBG} -DVTK_DIR=${VTK6_DIR_DBG} -DKWWidgets_DIR=${KWW6_DIR_DBG}
CONFIG_OPTS_VTK6_DIST = -DCMAKE_PREFIX_PATH=${VTK6_DIR_DIST} -DVTK_DIR=${VTK6_DIR_DIST} -DKWWidgets_DIR=${KWW6_DIR_DIST}
CONFIG_OPTS_VTK6_EPIC32 = -DCMAKE_PREFIX_PATH=${VTK6_DIR_DIST} -DVTK_DIR=${VTK6_DIR_DIST} -DKWWidgets_DIR=${KWW6_DIR_DIST}
CONFIG_OPTS = \
-DBUILD_CLAPACK=ON \
-DBUILD_ITK=ON \
-DITK_DIR=${ITK_DIR} \
-DCLAPACK_DIR=${CLAPACK_DIR} \
-DDCMTK_DIR=${DCMTK_DIR} \
-DBUILD_APPS=ON \
-DBUILD_EXAMPLES=OFF \
-DGETOPT_LIB=${GETOPT_LIB} \
-DBUILD_SIVIC=ON \
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} \
-DSVNCOMMAND=${SVN_COMMAND} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DMAKECOMMAND="/usr/bin/gmake -i -j${NUM_JOBS}" \
-DSVK_USE_GL2PS=ON
ifeq ($(OSTYPE),Darwin)
CONFIG_OPTS_VTK6_DIST += -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \
-DOPENGL_INCLUDE_DIR="${OPENGL_INCLUDE_DIR}" \
-DOPENGL_gl_LIBRARY="${OPENGL_gl_LIBRARY}" \
-DOPENGL_glu_LIBRARY="${OPENGL_glu_LIBRARY}"
CONFIG_OPTS_VTK6_DBG += -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \
-DOPENGL_INCLUDE_DIR="${OPENGL_INCLUDE_DIR}" \
-DOPENGL_gl_LIBRARY="${OPENGL_gl_LIBRARY}" \
-DOPENGL_glu_LIBRARY="${OPENGL_glu_LIBRARY}"
endif
CONFIG_OPTS_DBG = \
${CONFIG_OPTS_VTK6_DBG} \
${CONFIG_OPTS}
CONFIG_OPTS_DIST = \
${CONFIG_OPTS_VTK6_DIST} \
${CONFIG_OPTS}
CONFIG_OPTS_EPIC32 = \
${CONFIG_OPTS_VTK6_EPIC32} \
CMAKE_CXX_FLAGS := -m32 \
CMAKE_EXE_LINKER_FLAGS := -m32 \
${CONFIG_OPTS}
CONFIG_BASE_VTK5 = ${CMAKE_DIR}/cmake ${CONFIG_OPTS_VTK5}
CONFIG_BASE_GE = ${CMAKE_DIR_GE}/cmake ${CONFIG_OPTS_DIST}
CONFIG_BASE_VTK6_DBG = ${CMAKE_DIR}/cmake ${CONFIG_OPTS_DBG}
CONFIG_BASE_VTK6_DIST = ${CMAKE_DIR}/cmake ${CONFIG_OPTS_DIST}
CONFIG_BASE_VTK6_EPIC32 = ${CMAKE_DIR}/cmake ${CONFIG_OPTS_EPIC32}
CONFIG_BASE_GE_VTK6_DIST = ${CMAKE_DIR_GE}/cmake ${CONFIG_OPTS_DIST}
CONFIG_TEST_ON = -DUSE_OFF_SCREEN_TESTING=ON \
-DBUILD_TESTING=ON \
-DBUILD_GRAPHICS_TESTING=ON \
-DSVK_TEST_ROOT=${SVK_TEST_ROOT} \
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS_TEST} \
-DDART_TESTING_TIMEOUT=6000
CONFIG_TEST_OFF = -DUSE_OFF_SCREEN_TESTING=OFF -DBUILD_TESTING=OFF -DBUILD_GRAPHICS_TESTING=OFF
CONFIG_UCSF_ON = -DUCSF_INTERNAL=ON -DBUILD_CREATE_RAW=ON
CONFIG_UCSF_OFF = -DUCSF_INTERNAL=OFF -DBUILD_CREATE_RAW=OFF
CONFIG_OSIRIX = -DBUILD_OSIRIX=OFF
ifeq ($(OSTYPE),Darwin)
CONFIG_OSIRIX := -DBUILD_OSIRIX=ON -DBUILD_CREATE_RAW=OFF
endif
CONFIG_GE_CONSOLE = -DBUILD_GE_CONSOLE=ON
CONFIG_RELEASE = -DCMAKE_BUILD_TYPE=Release
CONFIG_DEBUG = -DCMAKE_BUILD_TYPE=Debug
CONFIG_EPIC = -DBUILD_EPIC=ON
TEST_ROOT = ${SVK_TEST_ROOT}/results_tmp
CLION_OPTS_DBG = -DCLION_BUILD=true -DCREATE_WRAPPER_SCRIPTS=false ${CONFIG_OPTS_DBG} ${CONFIG_DEBUG} ${CONFIG_TEST_ON} ${CONFIG_UCSF_ON}
CLION_OPTS_REL = -DCLION_BUILD=true -DCREATE_WRAPPER_SCRIPTS=false ${CONFIG_OPTS_DIST} ${CONFIG_RELEASE} ${CONFIG_TEST_OFF} ${CONFIG_UCSF_ON}
CLION_OPTS_REL_OSX = -DCLION_BUILD=true -DCREATE_WRAPPER_SCRIPTS=false ${CONFIG_BASE_VTK6_DIST} ${CONFIG_RELEASE} ${CONFIG_TEST_OFF} ${CONFIG_UCSF_ON} ${ADD_LINK_DIRS}
clean_results:
${RM} -rf ${TEST_ROOT}/
update_test_cases:
cd ${SVK_TEST_ROOT}; ${SVN_COMMAND} up;
############################################################
# Configuration targets for prod, debug, testing, etc.
############################################################
#
# Configure build for Experimental / Nightly
#
configure_testing_vtk5: clean_results
(${RM_CACHE} ${CONFIG_BASE_VTK5} ${CONFIG_TEST_ON} ${CONFIG_UCSF_ON} ${CONFIG_OSIRIX} ${CONFIG_RELEASE} ${ADD_LINK_DIRS} ${SIVIC_ROOT}/)
configure_testing: clean_results
(${RM_CACHE} ${CONFIG_BASE_VTK6_DBG} ${CONFIG_TEST_ON} ${CONFIG_UCSF_ON} ${CONFIG_OSIRIX} ${CONFIG_RELEASE} ${ADD_LINK_DIRS} ${SIVIC_ROOT}/)
#
# Configure for debug, but no testing
#
configure_debug_vtk5: clean_results
(${RM_CACHE} ${CONFIG_BASE_VTK5} ${CONFIG_TEST_OFF} ${CONFIG_UCSF_ON} ${CONFIG_OSIRIX} ${CONFIG_DEBUG} ${ADD_LINK_DIRS} ${SIVIC_ROOT}/)
configure_debug: clean_results
(${RM_CACHE} ${CONFIG_BASE_VTK6_DBG} ${CONFIG_TEST_OFF} ${CONFIG_UCSF_ON} ${CONFIG_OSIRIX} ${CONFIG_DEBUG} ${ADD_LINK_DIRS} ${SIVIC_ROOT}/)
#
# configure for external release
#
configure_dist: clean_results
(${RM_CACHE} ${CONFIG_BASE_VTK6_DIST} ${CONFIG_TEST_OFF} ${CONFIG_UCSF_OFF} ${CONFIG_OSIRIX} ${CONFIG_RELEASE} ${ADD_LINK_DIRS} ${SIVIC_ROOT}/)
#
# configure for external release
#
configure_dist_osirix: clean_results
(${RM_CACHE} ${CONFIG_BASE_VTK6_DIST} ${CONFIG_TEST_OFF} ${CONFIG_UCSF_OFF} ${CONFIG_OSIRIX} -DOSX_PLUGIN_OSIRIX=ON ${CONFIG_RELEASE} ${ADD_LINK_DIRS} ${SIVIC_ROOT}/)
#
# configure for external release
#
configure_dist_horos: clean_results
(${RM_CACHE} ${CONFIG_BASE_VTK6_DIST} ${CONFIG_TEST_OFF} ${CONFIG_UCSF_OFF} ${CONFIG_OSIRIX} -DOSX_PLUGIN_HOROS=ON ${CONFIG_RELEASE} ${ADD_LINK_DIRS} ${SIVIC_ROOT}/)
#
# configure for UCSF release
#
configure_dist_UCSF: clean_results
(${RM_CACHE} ${CONFIG_BASE_VTK6_DIST} ${CONFIG_TEST_OFF} ${CONFIG_UCSF_ON} ${CONFIG_OSIRIX} ${CONFIG_RELEASE} ${ADD_LINK_DIRS} ${SIVIC_ROOT}/)
#
# configure for EPIC 32 release and debug
#
configure_epic32: clean_results
(${RM_CACHE} ${CONFIG_BASE_VTK6_EPIC32} ${CONFIG_TEST_OFF} ${CONFIG_UCSF_ON} ${CONFIG_OSIRIX} ${CONFIG_RELEASE} ${CONFIG_EPIC} ${ADD_LINK_DIRS} ${SIVIC_ROOT}/)
#
# configure for sourceforge release of GE Console version (not OsiriX)
# configure and build on ESE host
#
configure_GE_dist: clean_results
(${RM_CACHE} ${CONFIG_BASE_GE_VTK6_DIST} ${CONFIG_TEST_OFF} ${CONFIG_UCSF_OFF} ${CONFIG_OSIRIX} ${CONFIG_GE_CONSOLE} ${CONFIG_RELEASE} ${SIVIC_ROOT}/)
############################################################
# Build standard distribution for release (not osirix)
############################################################
std_dist: configure_dist
cpack
############################################################
# Build GE Console distribution for release (not osirix)
############################################################
GE_dist: configure_GE_dist
cpack
#
# Run odd numbered tests through memory check (dynamic analysis)
#
experimental: configure_testing
${XVFB_RUN} ${CMAKE_DIR}/ctest -D ExperimentalStart --verbose --output-log ${OUTPUT_LOG}
${XVFB_RUN} ${CMAKE_DIR}/ctest -D ExperimentalConfigure --verbose --output-log ${OUTPUT_LOG}
${XVFB_RUN} ${CMAKE_DIR}/ctest -D ExperimentalBuild --verbose --output-log ${OUTPUT_LOG}
${XVFB_RUN} ${CMAKE_DIR}/ctest -D ExperimentalMemCheck --verbose --output-log ${OUTPUT_LOG} -R MCHK
${XVFB_RUN} ${CMAKE_DIR}/ctest -D ExperimentalTest --verbose --output-log ${OUTPUT_LOG}
${XVFB_RUN} ${CMAKE_DIR}/ctest -D ExperimentalCoverage --verbose --output-log ${OUTPUT_LOG}
${XVFB_RUN} ${CMAKE_DIR}/ctest -D ExperimentalSubmit --verbose --output-log ${OUTPUT_LOG}
# Does not perform memory checking
experimental_fast_vtk5: configure_testing_vtk5
${XVFB_RUN} ${CMAKE_DIR}/ctest -D Experimental --output-log ${OUTPUT_LOG}
experimental_fast: configure_testing
${XVFB_RUN} ${CMAKE_DIR}/ctest -j${NUM_JOBS} -D Experimental --output-log ${OUTPUT_LOG}
clion_options:
$(info CMAKE BUILD OPTIONS FOR CLION:)
$(info Debug:)
$(info ----------------------------------------------------------------------------------)
$(info ${CLION_OPTS_DBG})
$(info ----------------------------------------------------------------------------------)
$(info Release:)
$(info ----------------------------------------------------------------------------------)
$(info ${CLION_OPTS_REL})
$(info ----------------------------------------------------------------------------------)
$(info Release_OSX:)
$(info ----------------------------------------------------------------------------------)
$(info ${CLION_OPTS_REL_OSX})
$(info ----------------------------------------------------------------------------------)
$(warning This target does only prints the cmake options for Clion.)
$(warning Please configure your project from the GUI.)
nightly: configure_testing
${XVFB_RUN} ${CMAKE_DIR}/ctest -D Nightly --verbose --build-nocmake --output-log ${OUTPUT_LOG}