File: CMakeLists.txt

package info (click to toggle)
aoflagger 2.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,232 kB
  • sloc: cpp: 61,805; python: 60; sh: 23; makefile: 8
file content (341 lines) | stat: -rw-r--r-- 11,375 bytes parent folder | download
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror=vla -DNDEBUG -funroll-loops -O3 -std=c++11")

include(CheckCXXCompilerFlag)
include(CheckSymbolExists) 
include(CheckCXXSymbolExists)
include(CheckIncludeFileCXX)

CHECK_SYMBOL_EXISTS(posix_fallocate "fcntl.h" HAVE_POSIX_FALLOCATE) 
CHECK_CXX_SYMBOL_EXISTS(exp10 "cmath" HAVE_EXP10)

# -march=native speeds up the flagger with about 6% - 7%, but is not supported prior gcc 4.2.
# Hence, only enable it if it is supported.
if(PORTABLE)
  message(STATUS "Portable build requested; a generic build will be created with slightly decreased performance.")
else()	
	CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
	if(COMPILER_SUPPORTS_MARCH_NATIVE)
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
	else()
		message(STATUS " CXX compiler does not support -march=native : your code will not be optimized with -march=native.")
		message(STATUS " This probably means your compiler is old (e.g. gcc < 4.2).")
	endif(COMPILER_SUPPORTS_MARCH_NATIVE)
endif(PORTABLE)

CHECK_CXX_COMPILER_FLAG("-Wsuggest-override" COMPILER_SUPPORTS_SUGGEST_OVERRIDE)
if(COMPILER_SUPPORTS_SUGGEST_OVERRIDE)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
endif(COMPILER_SUPPORTS_SUGGEST_OVERRIDE)

if(HAVE_POSIX_FALLOCATE)
  add_definitions(-DHAVE_POSIX_FALLOCATE)
endif(HAVE_POSIX_FALLOCATE)

FIND_PATH(BOOST_ASIO_H_FOUND "boost/asio.hpp")
if(BOOST_ASIO_H_FOUND)
  message(STATUS "Boost ASIO library found.")
else()
  message(STATUS "Boost ASIO library not found, remote access of measurement sets disabled.")
endif(BOOST_ASIO_H_FOUND)

# To enable assembly .s files:
#enable_language(ASM-ATT)

if(GTKMM_FOUND)
  add_definitions(-DHAVE_GTKMM)
endif(GTKMM_FOUND)

if(GSL_LIB AND GSL_CBLAS_LIB AND GSL_INCLUDE_DIR)
  add_definitions(-DHAVE_GSL)
  link_libraries(${GSL_LIB} ${GSL_CBLAS_LIB})
  message(STATUS "GSL found.")
endif(GSL_LIB AND GSL_CBLAS_LIB AND GSL_INCLUDE_DIR)

set(AOQPLOT_FILES
  aoqplot/aoqplotwindow.cpp
  aoqplot/baselineplotpage.cpp
  aoqplot/datawindow.cpp
  aoqplot/grayscaleplotpage.cpp
  aoqplot/histogrampage.cpp
  aoqplot/timefrequencyplotpage.cpp
  aoqplot/twodimensionalplotpage.cpp
  aoqplot/controllers/aoqplotcontroller.cpp
  aoqplot/controllers/aoqplotpagecontroller.cpp
  aoqplot/controllers/baselinepagecontroller.cpp
  aoqplot/controllers/heatmappagecontroller.cpp
  aoqplot/controllers/histogrampagecontroller.cpp
  aoqplot/controllers/tfpagecontroller.cpp)

set(PLOT_FILES
  plot/colorscale.cpp
  plot/heatmapplot.cpp
  plot/horizontalplotscale.cpp
  plot/legend.cpp
  plot/plot2d.cpp
  plot/plotpropertieswindow.cpp
  plot/title.cpp
  plot/verticalplotscale.cpp)

set(GUI_FILES
  rfigui/controllers/imagecomparisoncontroller.cpp
  rfigui/controllers/rfiguicontroller.cpp
  rfigui/complexplaneplotwindow.cpp
  rfigui/editstrategywindow.cpp
  rfigui/gotowindow
  rfigui/highlightwindow.cpp
  rfigui/imageplanewindow
  rfigui/imagepropertieswindow.cpp
  rfigui/heatmapwidget.cpp
  rfigui/msoptionwindow.cpp
  rfigui/plotframe.cpp
  rfigui/plotwindow.cpp
  rfigui/progresswindow.cpp
  rfigui/rfiguiwindow.cpp
  rfigui/strategywizardwindow.cpp
  strategy/plots/rfiplots.cpp
  util/multiplot.cpp
  ${PLOT_FILES} ${AOQPLOT_FILES})

set(IMAGING_FILES
  imaging/uvimager.cpp
  imaging/model.cpp)

set(INTERFACE_FILES
  interface/aoflagger.cpp)
  
set(MSIO_FILES
  msio/baselinematrixloader.cpp
  msio/baselinereader.cpp
  msio/directbaselinereader.cpp
  msio/fitsfile.cpp
  msio/indirectbaselinereader.cpp
  msio/memorybaselinereader.cpp
  msio/pngfile.cpp
  msio/rspreader.cpp
  msio/spatialtimeloader.cpp)
  
set(STRUCTURES_FILES
  structures/colormap.cpp
  structures/image2d.cpp
  structures/mask2d.cpp
  structures/measurementset.cpp
  structures/samplerow.cpp
  structures/stokesimager.cpp
  structures/timefrequencydata.cpp)
  
set(QUALITY_FILES
  quality/histogramcollection.cpp
  quality/histogramtablesformatter.cpp
  quality/qualitytablesformatter.cpp
	quality/rayleighfitter.cpp
	quality/statisticscollection.cpp)

set(STRATEGY_ACTION_FILES
  strategy/actions/baselineselectionaction.cpp
  strategy/actions/calibratepassbandaction.cpp
  strategy/actions/changeresolutionaction.cpp
  strategy/actions/foreachbaselineaction.cpp
  strategy/actions/foreachmsaction.cpp
  strategy/actions/frequencyselectionaction.cpp
  strategy/actions/fringestopaction.cpp
	strategy/actions/highpassfilteraction.cpp
  strategy/actions/imageraction.cpp
  strategy/actions/normalizevarianceaction.cpp
  strategy/actions/plotaction.cpp
  strategy/actions/saveheatmapaction.cpp
  strategy/actions/slidingwindowfitaction.cpp
  strategy/actions/morphologicalflagaction.cpp
  strategy/actions/strategy.cpp
  strategy/actions/svdaction.cpp
  strategy/actions/timeconvolutionaction.cpp
  strategy/actions/timeselectionaction.cpp
  strategy/actions/visualizeaction.cpp
  strategy/actions/writeflagsaction.cpp)

set(STRATEGY_ALGORITHMS_FILES
  strategy/algorithms/antennaselector.cpp
  strategy/algorithms/baselineselector.cpp
	strategy/algorithms/baselinetimeplaneimager.cpp
  strategy/algorithms/combinatorialthresholder.cpp
  strategy/algorithms/eigenvalue.cpp
  strategy/algorithms/fringestoppingfitter.cpp
  strategy/algorithms/fringetestcreater.cpp
	strategy/algorithms/highpassfilter.cpp
  strategy/algorithms/localfitmethod.cpp
  strategy/algorithms/morphology.cpp
  strategy/algorithms/sinusfitter.cpp
  strategy/algorithms/morphologicalflagger.cpp
  strategy/algorithms/sumthreshold.cpp
  strategy/algorithms/sumthresholdmissing.cpp
  strategy/algorithms/svdmitigater.cpp
  strategy/algorithms/testsetgenerator.cpp
  strategy/algorithms/thresholdconfig.cpp
  strategy/algorithms/thresholdtools.cpp
  strategy/algorithms/timefrequencystatistics.cpp
  strategy/plots/antennaflagcountplot.cpp
  strategy/plots/frequencyflagcountplot.cpp)

set(STRATEGY_PLOTS_FILES
  strategy/plots/frequencypowerplot.cpp
  strategy/plots/iterationsplot.cpp
  strategy/plots/timeflagcountplot.cpp)

set(STRATEGY_CONTROL_FILES
  strategy/control/actionblock.cpp
  strategy/control/actioncontainer.cpp
  strategy/control/actionfactory.cpp
  strategy/control/artifactset.cpp
  strategy/control/defaultstrategy.cpp
  strategy/control/pythonstrategy.cpp
  strategy/control/strategyreader.cpp
  strategy/control/strategywriter.cpp)

set(STRATEGY_IMAGESETS_FILES
  strategy/imagesets/bhfitsimageset.cpp
  strategy/imagesets/filterbankset.cpp
  strategy/imagesets/fitsimageset.cpp
  strategy/imagesets/imageset.cpp
  strategy/imagesets/msimageset.cpp
  strategy/imagesets/parmimageset.cpp
  strategy/imagesets/pngreader.cpp)

set(STRATEGY_FILES
  ${STRATEGY_ACTION_FILES}
  ${STRATEGY_ALGORITHMS_FILES}
  ${STRATEGY_CONTROL_FILES}
  ${STRATEGY_IMAGESETS_FILES}
  ${STRATEGY_PLOTS_FILES})

set(UTIL_FILES
  util/logger.cpp
  util/ffttools.cpp
  util/integerdomain.cpp
  util/plot.cpp
  util/rng.cpp
  util/stopwatch.cpp)

if(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND)
	set(REMOTE_FILES
		remote/client.cpp
		remote/server.cpp
		remote/serverconnection.cpp
		remote/processcommander.cpp
		remote/clusteredobservation.cpp
		remote/vdsfile.cpp)
else()
	set(REMOTE_FILES
		remote/clusteredobservation.cpp
		remote/vdsfile.cpp)
endif(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND)

set(PYTHON_FILES
	python/functions.cpp)

set(ALL_LIBRARIES
	${Boost_SYSTEM_LIBRARY}
	${Boost_DATE_TIME_LIBRARY}
#	${Boost_PYTHON-PY36_LIBRARIES}
	${Boost_PYTHON_LIBRARIES}
	${Boost_SIGNALS_LIBRARY}
	${FFTW3_LIB}
	${CASACORE_LIBRARIES}
	${CMAKE_THREAD_LIBS_INIT}
	${PYTHON_LIBRARIES})

if(GTKMM_FOUND)
	message(STATUS "GTKMM found.") 
	include_directories(${GTKMM_INCLUDE_DIRS})
	link_directories(${GTKMM_LIBDIR})
	set(ALL_LIBRARIES ${ALL_LIBRARIES} ${GTKMM_LIBRARIES})
endif(GTKMM_FOUND)

if(SIGCXX_FOUND)
	message(STATUS "SIGCXX found.") 
	include_directories(${SIGCXX_INCLUDE_DIRS})
	link_directories(${SIGCXX_LIBDIR})
	set(ALL_LIBRARIES ${ALL_LIBRARIES} ${SIGCXX_LIBRARIES})
endif(SIGCXX_FOUND)

if(GTKMM_FOUND)
	set(AOFLAGGER_PLOT_FILES ${PLOT_FILES})
endif(GTKMM_FOUND)
add_library(aoflagger-lib STATIC ${AOFLAGGER_PLOT_FILES} ${IMAGING_FILES} ${INTERFACE_FILES} ${MSIO_FILES} ${QUALITY_FILES} ${STRATEGY_FILES} ${STRUCTURES_FILES} ${UTIL_FILES} ${PYTHON_FILES})
set_target_properties(aoflagger-lib PROPERTIES OUTPUT_NAME aoflagger)

add_library(aoflagger-shared SHARED ${AOFLAGGER_PLOT_FILES} ${IMAGING_FILES} ${INTERFACE_FILES} ${MSIO_FILES} ${QUALITY_FILES} ${STRATEGY_FILES} ${STRUCTURES_FILES} ${UTIL_FILES} ${PYTHON_FILES})
set_target_properties(aoflagger-shared PROPERTIES OUTPUT_NAME aoflagger)
SET_TARGET_PROPERTIES(aoflagger-shared PROPERTIES SOVERSION 0)
target_link_libraries(aoflagger-shared PRIVATE
  ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY}
  ${Boost_FILESYSTEM_LIBRARY} ${Boost_PYTHON_LIBRARIES}
  ${FFTW3_LIB}
  ${CASACORE_LIBRARIES}
  ${CFITSIO_LIBRARY}
  ${CMAKE_THREAD_LIBS_INIT}
  ${PNG_LIBRARIES} ${LIBXML2_LIBRARIES}
  ${CMAKE_THREAD_LIBS_INIT})

link_libraries(aoflagger-shared)

add_library(python_aoflagger SHARED python/pyinterface.cpp)
set_target_properties(python_aoflagger PROPERTIES SOVERSION 0)
set_target_properties(python_aoflagger PROPERTIES OUTPUT_NAME "aoflagger")
set_target_properties(python_aoflagger PROPERTIES PREFIX "")
target_link_libraries(python_aoflagger ${ALL_LIBRARIES} )

add_library(aoflaggerremote OBJECT ${REMOTE_FILES})
set(AOFLAGGERREMOTE_OBJECT $<TARGET_OBJECTS:aoflaggerremote>)

if(GTKMM_FOUND)
	add_library(aoflaggergui OBJECT ${GUI_FILES})
	set(AOFLAGGERGUI_OBJECT $<TARGET_OBJECTS:aoflaggergui>)
endif(GTKMM_FOUND)

link_libraries(${ALL_LIBRARIES})

add_executable(rfihistory rfihistory.cpp)

if(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND)
  add_executable(aoquality aoquality.cpp ${AOFLAGGERREMOTE_OBJECT})
endif(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND)

if(GTKMM_FOUND)
  add_executable(rfigui rfigui.cpp ${AOFLAGGERGUI_OBJECT} ${AOFLAGGERREMOTE_OBJECT})
  
	if(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND)
		add_executable(aoqplot aoqplot.cpp ${AOFLAGGERGUI_OBJECT} ${AOFLAGGERREMOTE_OBJECT})
		add_executable(badstations badstations.cpp ${AOFLAGGERREMOTE_OBJECT})
		add_executable(aofrequencyfilter aofrequencyfilter.cpp ${AOFLAGGERREMOTE_OBJECT})
	endif(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND)
else()
  message(WARNING " The graphical user interface library GTKMM was not found; rfigui and aoqplot will not be compiled.")
endif(GTKMM_FOUND)

add_executable(aoflagger-bin aoflagger.cpp)
set_target_properties(aoflagger-bin PROPERTIES OUTPUT_NAME aoflagger)

add_executable(msinfo msinfo.cpp)

add_executable(colormapper colormapper.cpp)

if(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND AND GTKMM_FOUND)
	add_executable(aoremoteclient aoremoteclient.cpp ${AOFLAGGERREMOTE_OBJECT})
endif(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND AND GTKMM_FOUND)

add_executable(aotest EXCLUDE_FROM_ALL aotest.cpp)
add_test(aotest aotest)
add_custom_target(check COMMAND aotest DEPENDS aotest)

# Installation commands
if(GTKMM_FOUND)
	install (TARGETS rfigui aoqplot DESTINATION bin)
endif(GTKMM_FOUND)

if(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND AND GTKMM_FOUND)
	install (TARGETS aoquality aoremoteclient DESTINATION bin)
endif(BOOST_ASIO_H_FOUND AND SIGCXX_FOUND AND GTKMM_FOUND)

install (TARGETS aoflagger-bin DESTINATION bin)
install (TARGETS aoflagger-shared DESTINATION lib/${DEB_BUILD_MULTIARCH}) 
install (TARGETS aoflagger-lib DESTINATION lib/${DEB_BUILD_MULTIARCH}) 
install (FILES interface/aoflagger.h DESTINATION include)