1 | # *********************************
|
---|
2 | # ************ cmake **************
|
---|
3 | # *********************************
|
---|
4 | CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
|
---|
5 | CMAKE_POLICY(SET CMP0043 NEW)
|
---|
6 | CMAKE_POLICY(SET CMP0048 NEW)
|
---|
7 |
|
---|
8 | # Enable debug symbols by default
|
---|
9 | # must be done before project() statement
|
---|
10 | SET(CMAKE_BUILD_TYPE_INIT Release)
|
---|
11 | # (you can also set it on the command line: -D CMAKE_BUILD_TYPE=Debug)
|
---|
12 |
|
---|
13 | # Enable CLANG as default compilers, to change this use
|
---|
14 | # cmake -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=c++
|
---|
15 | # Note that if compilers are switched on the fly,
|
---|
16 | # the cache is deleted
|
---|
17 | IF(NOT DEFINED CMAKE_C_COMPILER)
|
---|
18 | FIND_PROGRAM(CMAKE_C_COMPILER NAMES $ENV{CC} clang gcc cc PATHS ENV PATH NO_DEFAULT_PATH DOC "C Compiler")
|
---|
19 | ENDIF()
|
---|
20 | IF(NOT DEFINED CMAKE_CXX_COMPILER)
|
---|
21 | FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES $ENV{CXX} clang++ g++ c++ PATHS ENV PATH NO_DEFAULT_PATH DOC "C++ Compiler")
|
---|
22 | ENDIF()
|
---|
23 |
|
---|
24 |
|
---|
25 | #SET(CMAKE_VERBOSE_MAKEFILE ON)
|
---|
26 |
|
---|
27 |
|
---|
28 | # *********************************
|
---|
29 | # ************ Project ************
|
---|
30 | # *********************************
|
---|
31 |
|
---|
32 | STRING(TIMESTAMP VERSION %y.%U.%w.%H UTC)
|
---|
33 |
|
---|
34 | MESSAGE(STATUS "FACT++ V${VERSION}")
|
---|
35 |
|
---|
36 | PROJECT(fact++ VERSION ${VERSION})
|
---|
37 |
|
---|
38 | INCLUDE(GNUInstallDirs)
|
---|
39 |
|
---|
40 | # ======== For config.h.in =========
|
---|
41 | SET(PACKAGE_MAINTAINER "Thomas Bretz")
|
---|
42 | SET(PACKAGE_BUGREPORT "tbretz@physik.rwth-aachen.de")
|
---|
43 | SET(PACKAGE_URL "https://www.fact-project.org")
|
---|
44 |
|
---|
45 | FIND_PROGRAM(LSB_RELEASE_EXE NAMES lsb_release)
|
---|
46 | IF (DEFINED LSB_RELEASE_EXE)
|
---|
47 | EXECUTE_PROCESS(COMMAND ${LSB_RELEASE_EXE} -d OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
|
---|
48 | MESSAGE(STATUS ${LSB_RELEASE})
|
---|
49 | ENDIF()
|
---|
50 |
|
---|
51 | # *********************************
|
---|
52 | # ******** FAMOUS / IceACT ********
|
---|
53 | # *********************************
|
---|
54 |
|
---|
55 | #SET(OBSERVATORY "ORM" CACHE STRING "Select the observatory location (ORM, HAWC, SPM, RWTH: see nova.h)")
|
---|
56 |
|
---|
57 | IF (NOT TOOLS_ONLY AND NOT VIEWER_ONLY)
|
---|
58 |
|
---|
59 | IF(EXISTS "${CMAKE_SOURCE_DIR}/famous")
|
---|
60 | MESSAGE(STATUS "Compilation of 'famous' enabled.")
|
---|
61 | SET(FOUND_FAMOUS ON)
|
---|
62 | ENDIF()
|
---|
63 |
|
---|
64 | IF(EXISTS "${CMAKE_SOURCE_DIR}/iceact")
|
---|
65 | MESSAGE(STATUS "Compilation of 'iceact' enabled.")
|
---|
66 | SET(FOUND_ICEACT ON)
|
---|
67 | ENDIF()
|
---|
68 |
|
---|
69 | ENDIF(NOT TOOLS_ONLY AND NOT VIEWER_ONLY)
|
---|
70 |
|
---|
71 |
|
---|
72 | # *********************************
|
---|
73 | # ********* Requirements **********
|
---|
74 | # *********************************
|
---|
75 |
|
---|
76 | # =========== pkg-config ============
|
---|
77 | FIND_PACKAGE(PkgConfig)
|
---|
78 | FIND_PACKAGE(PackageHandleStandardArgs)
|
---|
79 |
|
---|
80 |
|
---|
81 | # ========== executables ==========
|
---|
82 | FIND_PROGRAM(HELP2MAN_EXECUTABLE help2man)
|
---|
83 | FIND_PROGRAM(ROFF2HTML_EXECUTABLE roff2html)
|
---|
84 | FIND_PROGRAM(ROFF2PDF_EXECUTABLE roff2pdf)
|
---|
85 | FIND_PROGRAM(GROFF_EXECUTABLE groff)
|
---|
86 |
|
---|
87 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(help2man DEFAULT_MSG HELP2MAN_EXECUTABLE)
|
---|
88 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(roff2html DEFAULT_MSG ROFF2HTML_EXECUTABLE)
|
---|
89 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(roff2pdf DEFAULT_MSG ROFF2PDF_EXECUTABLE)
|
---|
90 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(groff DEFAULT_MSG GROFF_EXECUTABLE)
|
---|
91 |
|
---|
92 | IF (NOT HELP2MAN_EXECUTABLE OR NOT ROFF2HTML_EXECUTABLE OR NOT ROFF2PDF_EXECUTABLE OR NOT GROFF_EXECUTABLE)
|
---|
93 | MESSAGE(STATUS "Documentation turned off (some executables missing).")
|
---|
94 | ENDIF()
|
---|
95 |
|
---|
96 | IF (NOT TOOLS_ONLY AND NOT VIEWER_ONLY)
|
---|
97 |
|
---|
98 | FIND_PROGRAM(JSDOC_EXECUTABLE jsdoc)
|
---|
99 | FIND_PROGRAM(MAILX_EXECUTABLE mailx)
|
---|
100 | FIND_PROGRAM(CURL_EXECUTABLE curl)
|
---|
101 |
|
---|
102 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(curl DEFAULT_MSG CURL_EXECUTABLE)
|
---|
103 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(mailx DEFAULT_MSG MAILX_EXECUTABLE)
|
---|
104 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(jsdoc DEFAULT_MSG JSDOC_EXECUTABLE)
|
---|
105 |
|
---|
106 | IF (curl_FOUND)
|
---|
107 | ADD_DEFINITIONS(-DHAVE_CURL)
|
---|
108 | ENDIF()
|
---|
109 | IF (mailx_FOUND)
|
---|
110 | ADD_DEFINITIONS(-DHAVE_MAILX)
|
---|
111 | ENDIF()
|
---|
112 |
|
---|
113 | ENDIF (NOT TOOLS_ONLY AND NOT VIEWER_ONLY)
|
---|
114 |
|
---|
115 | #IF(NOT SOME_COND)
|
---|
116 | # MESSAGE(FATAL_ERROR "At least one required executable was not found")
|
---|
117 | #ENDIF()
|
---|
118 |
|
---|
119 | # =========== libraries =============
|
---|
120 |
|
---|
121 | SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
|
---|
122 |
|
---|
123 | # FIXME: Need to check which package finders accept REQUIERED. For all others implement checks
|
---|
124 |
|
---|
125 | FIND_PACKAGE(Threads REQUIRED) # Threads::Threads
|
---|
126 | FIND_PACKAGE(ZLIB REQUIRED) # ZLIB::ZLIB
|
---|
127 |
|
---|
128 | SET(CURSES_NEED_NCURSES ON)
|
---|
129 | FIND_PACKAGE(Curses REQUIRED) # CURSES_FOUND
|
---|
130 | # FIXME : Require panel
|
---|
131 |
|
---|
132 | IF(NOT TOOLS_ONLY OR VIEWER_ONLY)
|
---|
133 | FIND_PACKAGE(OpenGL REQUIRED) # OpenGL::GL OpenGL::GLU / OPENGL_FOUND OPENGL_GLU_FOUND
|
---|
134 | ENDIF(NOT TOOLS_ONLY OR VIEWER_ONLY)
|
---|
135 |
|
---|
136 | IF(NOT TOOLS_ONLY)
|
---|
137 |
|
---|
138 | # FIND_PACKAGE(DBus) => skaypeclient
|
---|
139 | # FIND_PACKAGE(Motif) => did # MOTIF_FOUND
|
---|
140 |
|
---|
141 | FIND_PACKAGE(Readline REQUIRED)
|
---|
142 | FIND_PACKAGE(Panel REQUIRED)
|
---|
143 | FIND_PACKAGE(V8 REQUIRED)
|
---|
144 | FIND_PACKAGE(CCfits REQUIRED) # First as Cfitsio is a dependency
|
---|
145 | FIND_PACKAGE(Cfitsio REQUIRED)
|
---|
146 | FIND_PACKAGE(OpenSSL REQUIRED) # Required for boost::asio::ssl
|
---|
147 |
|
---|
148 | ENDIF(NOT TOOLS_ONLY)
|
---|
149 |
|
---|
150 | FIND_PACKAGE(Nova REQUIRED)
|
---|
151 |
|
---|
152 | #INCLUDE_DIRECTORIES("/usr/include/mysql")
|
---|
153 | # dbus-1 dbus-glib-1
|
---|
154 | # doxygen
|
---|
155 |
|
---|
156 | #MESSAGE("")
|
---|
157 | #MESSAGE(${V8_LIBRARY})
|
---|
158 | #MESSAGE(${MYSQLPP_LIBRARY})
|
---|
159 | #MESSAGE(${PANEL_LIBRARY})
|
---|
160 | #MESSAGE(${CURSES_LIBRARIES})
|
---|
161 | #MESSAGE(${CCFITS_LIBRARY})
|
---|
162 | #MESSAGE(${CFITSIO_LIBRARY})
|
---|
163 | #MESSAGE(${MYSQL_LIBRARY})
|
---|
164 | #MESSAGE(${NOVA_LIBRARY})
|
---|
165 | #MESSAGE(${READLINE_LIBRARY})
|
---|
166 | #MESSAGE(${OPENSSL_SSL_LIBRARY})
|
---|
167 | #MESSAGE("")
|
---|
168 |
|
---|
169 | # =============== MySQL ============
|
---|
170 |
|
---|
171 | INCLUDE(GetPrerequisites)
|
---|
172 |
|
---|
173 | FIND_PACKAGE(MySQL++ REQUIRED)
|
---|
174 |
|
---|
175 | IF(NOT DEFINED MYSQL_LIBRARY AND NOT CMAKE_VERSION VERSION_LESS 3.6)
|
---|
176 | GET_PREREQUISITES(${MYSQLPP_LIBRARY} MYSQL_LIBRARY 0 0 "" "")
|
---|
177 | LIST(FILTER MYSQL_LIBRARY INCLUDE REGEX .*mysqlclient.*)
|
---|
178 | IF (DEFINED MYSQL_LIBRARY)
|
---|
179 | FIND_PACKAGE_MESSAGE(MysqlLib "MySQL++ links to ${MYSQL_LIBRARY}" "[${MYSQL_LIBRARY}]")
|
---|
180 | ENDIF()
|
---|
181 | ENDIF()
|
---|
182 |
|
---|
183 | FIND_PACKAGE(MySQL REQUIRED)
|
---|
184 |
|
---|
185 | INCLUDE_DIRECTORIES(${MYSQL_INCLUDE_DIR} ${MYSQLPP_INCLUDE_DIR})
|
---|
186 |
|
---|
187 |
|
---|
188 | # =============== BOOST ============
|
---|
189 | # 1.47.0 is the newest version available at ISDC
|
---|
190 | FIND_PACKAGE(Boost 1.47.0 REQUIRED
|
---|
191 | date_time
|
---|
192 | filesystem
|
---|
193 | program_options
|
---|
194 | regex
|
---|
195 | system
|
---|
196 | thread)
|
---|
197 |
|
---|
198 | IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND Boost_VERSION LESS 106000 AND NOT NO_BOOST_HACK)
|
---|
199 | MESSAGE(STATUS " BOOST_REGEX_NO_EXTERNAL_TEMPLATES")
|
---|
200 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_REGEX_NO_EXTERNAL_TEMPLATES=1")
|
---|
201 | ENDIF()
|
---|
202 |
|
---|
203 | # At least print some information for reference
|
---|
204 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Boost FOUND_VAR Boost_FOUND REQUIRED_VARS Boost_INCLUDE_DIR Boost_LIBRARIES)
|
---|
205 |
|
---|
206 | # =============== QT4 ==============
|
---|
207 | IF(NOT TOOLS_ONLY OR VIEWER_ONLY)
|
---|
208 |
|
---|
209 | FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtOpenGL QtSql QtXml)
|
---|
210 | FIND_PACKAGE(Qwt REQUIRED)
|
---|
211 |
|
---|
212 | ENDIF(NOT TOOLS_ONLY OR VIEWER_ONLY)
|
---|
213 |
|
---|
214 | # ============== ROOT ================
|
---|
215 |
|
---|
216 | FIND_PROGRAM(ROOTCONFIG_EXECUTABLE NAMES root-config)
|
---|
217 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(root-config DEFAULT_MSG ROOTCONFIG_EXECUTABLE)
|
---|
218 | IF(NOT ROOTCONFIG_EXECUTABLE)
|
---|
219 | MESSAGE(FATAL_ERROR "Please make sure `root-config` is accessible in your path. In case of an installation from source, you might need to source\n . [path-to-root]/bin/thisroot.sh")
|
---|
220 | ENDIF()
|
---|
221 |
|
---|
222 | # You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
|
---|
223 | # - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
|
---|
224 | # - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
|
---|
225 | IF(EXISTS $ENV{ROOTSYS}/ROOTConfig.cmake)
|
---|
226 | IF(NOT DEFINED ENV{CMAKE_PREFIX_PATH})
|
---|
227 | LIST(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
|
---|
228 | ENDIF()
|
---|
229 | ENDIF()
|
---|
230 | SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "$ENV{ROOTSYS}/etc/cmake")
|
---|
231 |
|
---|
232 | #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
|
---|
233 | IF (NOT TOOLS_ONLY AND NOT VIEWER_ONLY)
|
---|
234 | # SET(ROOT_CONFIG_DEBUG 1)
|
---|
235 | FIND_PACKAGE(ROOT OPTIONAL_COMPONENTS GQt)
|
---|
236 | ENDIF()
|
---|
237 |
|
---|
238 | IF(NOT DEFINED ROOT_CONFIG_EXECUTABLE)
|
---|
239 | FIND_PACKAGE_MESSAGE(RootFound "Found ROOT: ${ROOT_INCLUDE_DIRS}" "[${ROOT_INCLUDE_DIRS}][${ROOT_LIBRARY_DIR}][${ROOT_VERSION}]")
|
---|
240 | ENDIF()
|
---|
241 |
|
---|
242 | IF (NOT TOOLS_ONLY AND NOT VIEWER_ONLY AND NOT ROOT_GQt_LIBRARY)
|
---|
243 | IF(ROOT_VERSION VERSION_LESS 6.18)
|
---|
244 | MESSAGE(FATAL_ERROR "Root version [${ROOT_VERSION}] less than 6.18, but component GQt not found.")
|
---|
245 | ELSE()
|
---|
246 | MESSAGE(WARNING "Root version [${ROOT_VERSION}] does not support GQt, GUI [fact] turned off.")
|
---|
247 | ENDIF()
|
---|
248 | ENDIF()
|
---|
249 |
|
---|
250 | #---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
|
---|
251 | FIND_PACKAGE_MESSAGE(RootInclude "Setup ROOT: [${ROOT_VERSION}] ${ROOT_USE_FILE}" "[${ROOT_VERSION}][${ROOT_USE_FILE}]")
|
---|
252 | IF(DEFINED ROOT_USE_FILE)
|
---|
253 | INCLUDE(${ROOT_USE_FILE})
|
---|
254 | ELSE()
|
---|
255 | # From RootUseFile.cmake (root 6)
|
---|
256 | INCLUDE_DIRECTORIES(${ROOT_INCLUDE_DIRS})
|
---|
257 | LINK_DIRECTORIES(${ROOT_LIBRARY_DIR})
|
---|
258 | ADD_DEFINITIONS(${ROOT_DEFINITIONS})
|
---|
259 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ROOT_CXX_FLAGS}")
|
---|
260 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ROOT_C_FLAGS}")
|
---|
261 | SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${ROOT_fortran_FLAGS}")
|
---|
262 | ENDIF()
|
---|
263 |
|
---|
264 | # -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree
|
---|
265 | # -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread
|
---|
266 | # -lASImage -lMinuit -lHistPainter -lThread
|
---|
267 |
|
---|
268 | #MESSAGE("INCL_DIRS: ${ROOT_INCLUDE_DIRS}")
|
---|
269 | #MESSAGE("LIBS: ${ROOT_LIBRARIES}")
|
---|
270 | #MESSAGE("DEFS: ${ROOT_DEFINITIONS}")
|
---|
271 | #MESSAGE("CXXFLAGS: ${ROOT_CXX_FLAGS}")
|
---|
272 | #MESSAGE("CXFLAGS: ${ROOT_CC_FLAGS}")
|
---|
273 | #MESSAGE("FOUND: ${ROOT_FOUND}")
|
---|
274 | #MESSAGE("FILE: ${ROOT_USE_FILE}")
|
---|
275 | #MESSAGE("DIR: ${CMAKE_CURRENT_SOURCE_DIR}")
|
---|
276 | #ROOT_<library>_LIBRARY PATH Full path for each of the ROOT libraries listed in COMPONENTS
|
---|
277 | #ROOT_<command>_CMD PATH Full path for each ROOT executable (rootcling, root, hadd, etc.)
|
---|
278 | #ROOT_<option>_FOUND BOOL True for each enabled build option (e.g. cocoa, python, xrootd, etc.)
|
---|
279 |
|
---|
280 | # function ROOT_GENERATE_DICTIONARY( dictionary
|
---|
281 | # header1 header2 ...
|
---|
282 | # LINKDEF linkdef1 ...
|
---|
283 | # OPTIONS opt1...)
|
---|
284 |
|
---|
285 | # *********************************
|
---|
286 | # ********** Observatory **********
|
---|
287 | # *********************************
|
---|
288 |
|
---|
289 | SET(OBSERVATORY "ORM" CACHE STRING "Select the observatory location (ORM, HAWC, SPM, RWTH: see nova.h)")
|
---|
290 |
|
---|
291 | IF(NOT OBSERVATORY STREQUAL "ORM" AND
|
---|
292 | NOT OBSERVATORY STREQUAL "HAWC" AND
|
---|
293 | NOT OBSERVATORY STREQUAL "SPM" AND
|
---|
294 | NOT OBSERVATORY STREQUAL "RWTH")
|
---|
295 | MESSAGE(FATAL_ERROR "OBSERVATORY=${OBSERVATORY} invalid. Only ORM, HAWC, SPM and RWTH allowd!")
|
---|
296 | ENDIF()
|
---|
297 |
|
---|
298 | FIND_PACKAGE_MESSAGE(PresetObservatory "Preset Observatory: ${OBSERVATORY}" "[${OBSERVATORY}]")
|
---|
299 |
|
---|
300 | # *********************************
|
---|
301 | # *********** Compiler ************
|
---|
302 | # *********************************
|
---|
303 |
|
---|
304 | SET(CMAKE_CXX_STANDARD 11)
|
---|
305 |
|
---|
306 | #ADD_DEFINITIONS(-D__CMAKE__)
|
---|
307 |
|
---|
308 | SET(CMAKE_CXX_FLAGS
|
---|
309 | "${CMAKE_CXX_FLAGS} -Wall -Winit-self -Wpointer-arith \
|
---|
310 | -Wcast-align -Wformat=2 -Woverloaded-virtual \
|
---|
311 | -Wnon-virtual-dtor -Wshadow -Wno-unknown-pragmas") # -Wextra
|
---|
312 |
|
---|
313 | # -D__MARS__
|
---|
314 | SET(CMAKE_CXX_FLAGS
|
---|
315 | "${CMAKE_CXX_FLAGS} \
|
---|
316 | -D_REENTRANT -D__LINUX__ \
|
---|
317 | -DHAVE_ZLIB -DHAVE_ROOT -DHAVE_V8 -DHAVE_SQL -DHAVE_NOVA -DHAVE_FITS -DPRESET_OBSERVATORY=k${OBSERVATORY} \
|
---|
318 | -DMARSVER=\\\"${VERSION}\\\" \
|
---|
319 | -DPACKAGE_VERSION=\\\"${VERSION}\\\" \
|
---|
320 | -DREVISION=\\\"${REVISION}\\\" \
|
---|
321 | -DPACKAGE_NAME=\\\"FACT++\\\" \
|
---|
322 | -DPACKAGE_STRING=\\\"FACT++\\\" \
|
---|
323 | -DPACKAGE_URL=\\\"${PACKAGE_URL}\\\" \
|
---|
324 | -DPACKAGE_BUGREPORT=\\\"${PACKAGE_BUGREPORT}\\\""
|
---|
325 | )
|
---|
326 |
|
---|
327 | # -DBOOST_DISABLE_ASSERTS \
|
---|
328 | # -DBOOST_NO_STD_LOCALE=1 \
|
---|
329 | # -DBOOST_REXEG_NO_FWD=1 \
|
---|
330 | # -DBOOST_NO_MEMBER_TEMPLATES=1 \
|
---|
331 | # -DBOOST_HAS_ABI_HEADERS=1 \
|
---|
332 |
|
---|
333 | # Flags required for Dim
|
---|
334 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -DMIPSEL -DPROTOCOL=1 -Dunix -Dlinux")
|
---|
335 |
|
---|
336 |
|
---|
337 | # -------------------------------------------------------
|
---|
338 | # Inlclude the main source AND build dir itself
|
---|
339 | SET(CMAKE_INCLUDE_CURRENT_DIR ON)
|
---|
340 | SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
|
---|
341 |
|
---|
342 | INCLUDE_DIRECTORIES(pal)
|
---|
343 | INCLUDE_DIRECTORIES(erfa/src)
|
---|
344 | INCLUDE_DIRECTORIES(dim/dim)
|
---|
345 | INCLUDE_DIRECTORIES(externals)
|
---|
346 | INCLUDE_DIRECTORIES(src)
|
---|
347 |
|
---|
348 | # ********************************************************
|
---|
349 | # ********************** Libraries ***********************
|
---|
350 | # ********************************************************
|
---|
351 | IF (NOT TOOLS_ONLY AND NOT VIEWER_ONLY)
|
---|
352 |
|
---|
353 | # =================== libPointing.so ======================
|
---|
354 | ADD_LIBRARY(Pointing SHARED
|
---|
355 | pal/pal.h
|
---|
356 | pal/palDtt.c pal/palDat.c pal/palMappa.c
|
---|
357 | pal/palPrenut.c pal/palEvp.c pal/palAoppa.c
|
---|
358 | pal/palAoppat.c pal/palRefco.c pal/palRefro.c
|
---|
359 | pal/pal1Atmt.c pal/palDrange.c pal/palOne2One.c
|
---|
360 | pal/pal1Atms.c pal/palMapqkz.c pal/palAopqk.c
|
---|
361 | pal/palRefz.c pal/palAmpqk.c pal/palRdplan.c
|
---|
362 | pal/palDt.c pal/palPvobs.c pal/palNut.c
|
---|
363 | pal/palDmoon.c pal/palPlanet.c pal/palNutc.c
|
---|
364 | pal/palDeuler.c
|
---|
365 | erfa/src/gd2gc.c erfa/src/p06e.c erfa/src/c2s.c
|
---|
366 | erfa/src/eform.c erfa/src/s2c.c erfa/src/pas.c
|
---|
367 | erfa/src/pmat06.c erfa/src/epv00.c erfa/src/plan94.c
|
---|
368 | erfa/src/anpm.c erfa/src/obl06.c erfa/src/dat.c
|
---|
369 | erfa/src/af2a.c erfa/src/rxr.c erfa/src/gmst06.c
|
---|
370 | erfa/src/sepp.c erfa/src/rz.c erfa/src/zp.c
|
---|
371 | erfa/src/rxpv.c erfa/src/pn.c erfa/src/cr.c
|
---|
372 | erfa/src/seps.c erfa/src/ry.c erfa/src/pdp.c
|
---|
373 | erfa/src/pnm06a.c erfa/src/hfk5z.c erfa/src/epj2jd.c
|
---|
374 | erfa/src/pv2s.c erfa/src/tf2a.c erfa/src/pm.c
|
---|
375 | erfa/src/sxp.c erfa/src/a2af.c erfa/src/rxp.c
|
---|
376 | erfa/src/pxp.c erfa/src/fk5hip.c erfa/src/fw2m.c
|
---|
377 | erfa/src/rx.c erfa/src/tf2d.c erfa/src/cal2jd.c
|
---|
378 | erfa/src/cp.c erfa/src/nut06a.c erfa/src/rm2v.c
|
---|
379 | erfa/src/nut00a.c erfa/src/ee06a.c erfa/src/fk5hz.c
|
---|
380 | erfa/src/epb2jd.c erfa/src/refco.c erfa/src/a2tf.c
|
---|
381 | erfa/src/fapa03.c erfa/src/gst06a.c erfa/src/faf03.c
|
---|
382 | erfa/src/faur03.c erfa/src/faju03.c erfa/src/fal03.c
|
---|
383 | erfa/src/fasa03.c erfa/src/fame03.c erfa/src/fave03.c
|
---|
384 | erfa/src/fama03.c erfa/src/faom03.c erfa/src/gst06.c
|
---|
385 | erfa/src/jd2cal.c erfa/src/gd2gce.c erfa/src/anp.c
|
---|
386 | erfa/src/fae03.c erfa/src/ir.c erfa/src/pfw06.c
|
---|
387 | erfa/src/bpn2xy.c erfa/src/eors.c erfa/src/s06.c
|
---|
388 | erfa/src/trxp.c erfa/src/era00.c erfa/src/epj.c
|
---|
389 | erfa/src/d2tf.c erfa/src/epb.c erfa/src/rv2m.c
|
---|
390 | erfa/src/pap.c erfa/src/fad03.c erfa/src/pmp.c
|
---|
391 | erfa/src/tr.c erfa/src/falp03.c)
|
---|
392 | TARGET_LINK_LIBRARIES(Pointing PUBLIC m)
|
---|
393 |
|
---|
394 | # ======================= libDim.so ======================
|
---|
395 | ADD_LIBRARY(Dim SHARED
|
---|
396 | # dim/dim/dic.h
|
---|
397 | # dim/dim/dim_common.h
|
---|
398 | # dim/dim/dim.h
|
---|
399 | # dim/dim/dim_tcpip.h
|
---|
400 | # dim/dim/dis.h
|
---|
401 | dim/src/dic.c
|
---|
402 | dim/src/dis.c
|
---|
403 | dim/src/dna.c
|
---|
404 | dim/src/sll.c
|
---|
405 | dim/src/dll.c
|
---|
406 | dim/src/hash.c
|
---|
407 | dim/src/swap.c
|
---|
408 | dim/src/copy_swap.c
|
---|
409 | dim/src/open_dns.c
|
---|
410 | dim/src/conn_handler.c
|
---|
411 | dim/src/tcpip.c
|
---|
412 | dim/src/dtq.c
|
---|
413 | dim/src/dim_thr.c
|
---|
414 | dim/src/utilities.c)
|
---|
415 |
|
---|
416 | # ================= libDimExtension.so ===================
|
---|
417 | ADD_LIBRARY(DimExtension SHARED
|
---|
418 | # src/DimSetup.h
|
---|
419 | src/DimSetup.cc)
|
---|
420 | TARGET_LINK_LIBRARIES(DimExtension PUBLIC
|
---|
421 | Boost::system)
|
---|
422 |
|
---|
423 | # ===================== libDim++.so ======================
|
---|
424 | ADD_LIBRARY(Dim++ SHARED
|
---|
425 | # dim/dim/dic.hxx
|
---|
426 | # dim/dim/dis.hxx
|
---|
427 | # dim/dim/dim_core.hxx
|
---|
428 | # dim/dim/dim.hxx
|
---|
429 | # dim/dim/dim_tcpip.h
|
---|
430 | # dim/dim/dllist.hxx
|
---|
431 | # dim/dim/sllist.hxx
|
---|
432 | # dim/dim/tokenstring.hxx
|
---|
433 | # src/Dim.h
|
---|
434 | dim/src/diccpp.cxx
|
---|
435 | dim/src/dimcpp.cxx
|
---|
436 | dim/src/discpp.cxx
|
---|
437 | dim/src/tokenstring.cxx)
|
---|
438 | TARGET_LINK_LIBRARIES(Dim++ PUBLIC Dim)
|
---|
439 |
|
---|
440 | # ================= libStateMachine.so ===================
|
---|
441 | ADD_LIBRARY(StateMachine SHARED
|
---|
442 | src/WindowLog.h src/WindowLog.cc
|
---|
443 | src/Readline.h src/Readline.cc
|
---|
444 | src/ReadlineColor.h src/ReadlineColor.cc
|
---|
445 | src/ReadlineWindow.h src/ReadlineWindow.cc
|
---|
446 | src/Console.h src/Console.cc
|
---|
447 | src/Shell.h src/Shell.cc
|
---|
448 | src/EventImp.h src/EventImp.cc
|
---|
449 | src/Event.h src/Event.cc
|
---|
450 | src/State.h src/State.cc
|
---|
451 | src/Description.h src/Description.cc
|
---|
452 | src/MessageImp.h src/MessageImp.cc
|
---|
453 | src/Converter.h src/Converter.cc
|
---|
454 | src/StateMachineImp.h src/StateMachineImp.cc
|
---|
455 | src/StateMachine.h src/StateMachine.cc
|
---|
456 | src/EventDim.h
|
---|
457 | src/MessageDim.h src/MessageDim.cc
|
---|
458 | src/StateMachineDim.h src/StateMachineDim.cc
|
---|
459 | src/DimServerList.h src/DimServerList.cc
|
---|
460 | src/DimServiceInfoList.h src/DimServiceInfoList.cc
|
---|
461 | # src/DimNetworkList.h src/DimNetwork.cc
|
---|
462 | src/ServiceList.h src/ServiceList.cc
|
---|
463 | src/DimErrorRedirecter.h
|
---|
464 | src/DimErrorRedirecter.cc
|
---|
465 | src/DimDescriptionService.h
|
---|
466 | src/DimDescriptionService.cc
|
---|
467 | src/Connection.h src/Connection.cc
|
---|
468 | src/ConnectionUSB.h src/ConnectionUSB.cc
|
---|
469 | src/ConnectionSSL.h src/ConnectionSSL.cc
|
---|
470 | # FACT.h ByteOrder.h
|
---|
471 | src/DimWriteStatistics.h src/DimWriteStatistics.cc)
|
---|
472 | TARGET_LINK_LIBRARIES(StateMachine PUBLIC
|
---|
473 | readline ${CURSES_LIBRARIES} panel
|
---|
474 | Tools Time Dim++
|
---|
475 | Boost::regex
|
---|
476 | Boost::thread
|
---|
477 | Boost::filesystem
|
---|
478 | OpenSSL::SSL)
|
---|
479 |
|
---|
480 | ENDIF (NOT TOOLS_ONLY AND NOT VIEWER_ONLY)
|
---|
481 |
|
---|
482 | # ================= libConfiguration.so ==================
|
---|
483 | ADD_LIBRARY(Configuration SHARED
|
---|
484 | src/Configuration.h src/Configuration.cc
|
---|
485 | src/FACT.h src/FACT.cc)
|
---|
486 | TARGET_LINK_LIBRARIES(Configuration PUBLIC
|
---|
487 | Boost::regex
|
---|
488 | Boost::system
|
---|
489 | Boost::filesystem
|
---|
490 | Boost::program_options
|
---|
491 | ${MYSQL_LIBRARY} ${MYSQLPP_LIBRARY})
|
---|
492 |
|
---|
493 | # ===================== libTime.so =======================
|
---|
494 | ADD_LIBRARY(Time SHARED
|
---|
495 | src/Time.h src/Time.cc)
|
---|
496 | TARGET_LINK_LIBRARIES(Time PUBLIC ${NOVA_LIBRARY})
|
---|
497 |
|
---|
498 | # ===================== libTools.so ======================
|
---|
499 | ADD_LIBRARY(Tools SHARED
|
---|
500 | src/tools.h src/tools.cc)
|
---|
501 |
|
---|
502 |
|
---|
503 |
|
---|
504 | # ********************************************************
|
---|
505 | # ********************** Manuals *************************
|
---|
506 | # ********************************************************
|
---|
507 |
|
---|
508 | IF (NOT VIEWER_ONLY)
|
---|
509 |
|
---|
510 | FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/man1)
|
---|
511 | FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/html)
|
---|
512 | FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/pdf)
|
---|
513 |
|
---|
514 | MACRO(MANPAGE program description)
|
---|
515 | # https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
|
---|
516 | IF (HELP2MAN_EXECUTABLE AND ROFF2HTML_EXECUTABLE AND ROFF2PDF_EXECUTABLE AND GROFF_EXECUTABLE)
|
---|
517 | ADD_CUSTOM_COMMAND(
|
---|
518 | OUTPUT
|
---|
519 | man1/${program}.1
|
---|
520 | DEPENDS
|
---|
521 | ${program}
|
---|
522 | COMMAND
|
---|
523 | ${HELP2MAN_EXECUTABLE}
|
---|
524 | ${PROJECT_BINARY_DIR}/${program}
|
---|
525 | -n "${description}"
|
---|
526 | --no-info
|
---|
527 | --output=man1/${program}.1
|
---|
528 | COMMAND
|
---|
529 | ${GROFF_EXECUTABLE}
|
---|
530 | -mandoc man1/${program}.1
|
---|
531 | -T html > html/${program}.html
|
---|
532 | COMMAND
|
---|
533 | ${GROFF_EXECUTABLE}
|
---|
534 | -mandoc man1/${program}.1
|
---|
535 | -T pdf > pdf/${program}.pdf
|
---|
536 | COMMENT
|
---|
537 | "Generating man-page ${program}.1"
|
---|
538 | VERBATIM)
|
---|
539 |
|
---|
540 | ADD_CUSTOM_TARGET(${program}.man ALL DEPENDS man1/${program}.1)
|
---|
541 |
|
---|
542 | INSTALL(FILES ${PROJECT_BINARY_DIR}/man1/${program}.1 DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
|
---|
543 | ENDIF()
|
---|
544 | ENDMACRO()
|
---|
545 |
|
---|
546 |
|
---|
547 |
|
---|
548 |
|
---|
549 | # ********************************************************
|
---|
550 | # *********************** Helpers ************************
|
---|
551 | # ********************************************************
|
---|
552 |
|
---|
553 | SET(HELP++LIBS Tools Configuration Time)
|
---|
554 |
|
---|
555 | # --------------------------------------------------------
|
---|
556 |
|
---|
557 | ADD_EXECUTABLE(fitsdump src/fitsdump.cc)
|
---|
558 | TARGET_LINK_LIBRARIES(fitsdump ${HELP++LIBS} ${ROOT_LIBRARIES} ZLIB::ZLIB)
|
---|
559 | MANPAGE(fitsdump "FACT++ - fitsdump - Read and dump contents of a FITStable")
|
---|
560 |
|
---|
561 | #ADD_EXECUTABLE(fitsloader src/fitsloader.cc)
|
---|
562 | #TARGET_LINK_LIBRARIES(fitsloader ${HELP++LIBS})
|
---|
563 | #MANPAGE(fitsloader "")
|
---|
564 |
|
---|
565 | #ADD_EXECUTABLE(fitscheck src/fitscheck.cc)
|
---|
566 | #TARGET_LINK_LIBRARIES(fitscheck ${HELP++LIBS} ZLIB::ZLIB)
|
---|
567 | #MANPAGE(fitscheck "")
|
---|
568 |
|
---|
569 | #ADD_EXECUTABLE(fitsCompressor src/fitsCompressor.cc)
|
---|
570 | #TARGET_LINK_LIBRARIES(fitsCompressor ${HELP++LIBS} ZLIB::ZLIB)
|
---|
571 | #MANPAGE(fitsCompressor "")
|
---|
572 |
|
---|
573 | #ADD_EXECUTABLE(fitsselect src/fitsselect.cc)
|
---|
574 | #TARGET_LINK_LIBRARIES(fitsselect ${HELP++LIBS} ZLIB::ZLIB)
|
---|
575 | #MANPAGE(fitsselect "")
|
---|
576 |
|
---|
577 | #ADD_EXECUTABLE(readfits src/readfits.cc)
|
---|
578 | #TARGET_LINK_LIBRARIES(readfits ${HELP++LIBS} ZLIB::ZLIB)
|
---|
579 | #MANPAGE(readfits "")
|
---|
580 |
|
---|
581 | ADD_EXECUTABLE(rootifysql src/rootifysql.cc)
|
---|
582 | TARGET_LINK_LIBRARIES(rootifysql ${HELP++LIBS} ${ROOT_LIBRARIES})
|
---|
583 | MANPAGE(rootifysql "FACT++ - rootifysql - Write result of a SQL query into a root-file")
|
---|
584 |
|
---|
585 | ADD_EXECUTABLE(root2sql src/root2sql.cc)
|
---|
586 | TARGET_LINK_LIBRARIES(root2sql ${HELP++LIBS} ${ROOT_LIBRARIES})
|
---|
587 | MANPAGE(root2sql "FACT++ - root2sql - Fill contents of a root-tree into a MySQL database")
|
---|
588 |
|
---|
589 | ADD_EXECUTABLE(fits2sql src/fits2sql.cc)
|
---|
590 | TARGET_LINK_LIBRARIES(fits2sql ${HELP++LIBS} ZLIB::ZLIB)
|
---|
591 | MANPAGE(fits2sql "FACT++ - fits2sql - Fill contents of a FITS table into a MySQL database")
|
---|
592 |
|
---|
593 | ADD_EXECUTABLE(showlog src/showlog.cc src/WindowLog.cc)
|
---|
594 | TARGET_LINK_LIBRARIES(showlog Threads::Threads ${HELP++LIBS} ${CURSES_LIBRARIES})
|
---|
595 | MANPAGE(showlog "")
|
---|
596 |
|
---|
597 | ADD_EXECUTABLE(zfits src/zfits.cc)
|
---|
598 | TARGET_LINK_LIBRARIES(zfits ${HELP++LIBS} ZLIB::ZLIB)
|
---|
599 | MANPAGE(zfits "")
|
---|
600 |
|
---|
601 | ADD_EXECUTABLE(calcsource src/calcsource.cc)
|
---|
602 | TARGET_LINK_LIBRARIES(calcsource ${HELP++LIBS} ${ROOT_LIBRARIES})
|
---|
603 | MANPAGE(calcsource "")
|
---|
604 |
|
---|
605 | ADD_EXECUTABLE(calcsourcemc src/calcsourcemc.cc)
|
---|
606 | TARGET_LINK_LIBRARIES(calcsourcemc ${HELP++LIBS} ${ROOT_LIBRARIES})
|
---|
607 | MANPAGE(calcsourcemc "")
|
---|
608 |
|
---|
609 | ADD_EXECUTABLE(getevent src/getevent.cc)
|
---|
610 | TARGET_LINK_LIBRARIES(getevent ${HELP++LIBS} ZLIB::ZLIB)
|
---|
611 | MANPAGE(getevent "")
|
---|
612 |
|
---|
613 | ENDIF(NOT VIEWER_ONLY)
|
---|
614 |
|
---|
615 | IF (NOT TOOLS_ONLY AND NOT VIEWER_ONLY)
|
---|
616 |
|
---|
617 | ADD_EXECUTABLE(makeplots src/makeplots.cc)
|
---|
618 | TARGET_LINK_LIBRARIES(makeplots ${HELP++LIBS} ${ROOT_LIBRARIES})
|
---|
619 | MANPAGE(makeplots "")
|
---|
620 |
|
---|
621 | ADD_EXECUTABLE(makedata src/makedata.cc)
|
---|
622 | TARGET_LINK_LIBRARIES(makedata ${HELP++LIBS})
|
---|
623 | MANPAGE(makedata "")
|
---|
624 |
|
---|
625 | ADD_EXECUTABLE(makeschedule src/makeschedule.cc)
|
---|
626 | TARGET_LINK_LIBRARIES(makeschedule ${HELP++LIBS})
|
---|
627 | MANPAGE(makeschedule "")
|
---|
628 |
|
---|
629 | ADD_EXECUTABLE(moon src/moon.cc)
|
---|
630 | TARGET_LINK_LIBRARIES(moon ${HELP++LIBS})
|
---|
631 | MANPAGE(moon "")
|
---|
632 |
|
---|
633 | # ********************************************************
|
---|
634 | # ********************* Operation ************************
|
---|
635 | # ********************************************************
|
---|
636 |
|
---|
637 | SET(FACT++LIBS StateMachine Configuration DimExtension)
|
---|
638 |
|
---|
639 | # --------------------------------------------------------
|
---|
640 |
|
---|
641 | ADD_EXECUTABLE(dns src/dns.c)
|
---|
642 | TARGET_LINK_LIBRARIES(dns ${FACT++LIBS})
|
---|
643 | MANPAGE(dns "")
|
---|
644 |
|
---|
645 | ADD_EXECUTABLE(agilentctrl src/agilentctrl.cc)
|
---|
646 | TARGET_LINK_LIBRARIES(agilentctrl ${FACT++LIBS})
|
---|
647 | MANPAGE(agilentctrl "")
|
---|
648 |
|
---|
649 | ADD_EXECUTABLE(biasctrl src/biasctrl.cc)
|
---|
650 | TARGET_LINK_LIBRARIES(biasctrl ${FACT++LIBS})
|
---|
651 | MANPAGE(biasctrl "")
|
---|
652 |
|
---|
653 | ADD_EXECUTABLE(biastemp src/biastemp.cc)
|
---|
654 | TARGET_LINK_LIBRARIES(biastemp ${FACT++LIBS})
|
---|
655 | MANPAGE(biastemp "")
|
---|
656 |
|
---|
657 | ADD_EXECUTABLE(gtcdust src/gtcdust.cc)
|
---|
658 | TARGET_LINK_LIBRARIES(gtcdust ${FACT++LIBS})
|
---|
659 | MANPAGE(gtcdust "")
|
---|
660 |
|
---|
661 | ADD_EXECUTABLE(chatserv src/chatserv.cc)
|
---|
662 | TARGET_LINK_LIBRARIES(chatserv ${FACT++LIBS}) # does not require libpanel
|
---|
663 | MANPAGE(chatserv "")
|
---|
664 |
|
---|
665 | ADD_EXECUTABLE(chatclient src/chatclient.cc)
|
---|
666 | TARGET_LINK_LIBRARIES(chatclient ${FACT++LIBS}) # does not require libpanel
|
---|
667 | MANPAGE(chatclient "")
|
---|
668 |
|
---|
669 | #ADD_EXECUTABLE(cosyctrl src/cosyctrl.cc)# src/LocalControl.h
|
---|
670 | #TARGET_LINK_LIBRARIES(cosyctrl
|
---|
671 | # StateMachine Tools Configuration Time Dim++ Dim DimExtension
|
---|
672 | # ${Boost_LIBRARIES} readline ${CURSES_LIBRARIES})
|
---|
673 |
|
---|
674 | ADD_EXECUTABLE(datalogger src/datalogger.cc
|
---|
675 | src/DimState.cc
|
---|
676 | src/FitsFile.cc src/Fits.cc)
|
---|
677 | TARGET_LINK_LIBRARIES(datalogger ${FACT++LIBS} cfitsio CCfits)
|
---|
678 | MANPAGE(datalogger "")
|
---|
679 |
|
---|
680 | ADD_EXECUTABLE(dimctrl src/dimctrl.cc
|
---|
681 | src/StateMachineDimControl.cc
|
---|
682 | src/RemoteControl.cc
|
---|
683 | src/InterpreterV8.cc
|
---|
684 | src/DimState.cc)
|
---|
685 | TARGET_LINK_LIBRARIES(dimctrl ${FACT++LIBS} Pointing ZLIB::ZLIB v8)
|
---|
686 | MANPAGE(dimctrl "")
|
---|
687 |
|
---|
688 | ADD_CUSTOM_TARGET(dimserver ALL
|
---|
689 | COMMAND ln -sf dimctrl dimserver
|
---|
690 | COMMENT "Creating symlink for dimserver"
|
---|
691 | DEPENDS dimctrl)
|
---|
692 |
|
---|
693 | ADD_EXECUTABLE(drivectrl src/drivectrl.cc)
|
---|
694 | TARGET_LINK_LIBRARIES(drivectrl ${FACT++LIBS} Pointing)
|
---|
695 | MANPAGE(drivectrl "")
|
---|
696 |
|
---|
697 | ADD_EXECUTABLE(evtserver src/evtserver.cc)
|
---|
698 | TARGET_LINK_LIBRARIES(evtserver ${FACT++LIBS} ZLIB::ZLIB)
|
---|
699 | MANPAGE(evtserver "")
|
---|
700 |
|
---|
701 | ADD_EXECUTABLE(fadctrl src/fadctrl.cc src/HeadersFAD.cc
|
---|
702 | src/EventBuilder.cc
|
---|
703 | src/FitsFile.cc
|
---|
704 | src/DataCalib.cc
|
---|
705 | src/DataWriteRaw.cc
|
---|
706 | src/DataWriteFits.cc
|
---|
707 | src/DataWriteFits2.cc
|
---|
708 | src/DataProcessorImp.cc)
|
---|
709 | TARGET_LINK_LIBRARIES(fadctrl ${FACT++LIBS} cfitsio CCfits ZLIB::ZLIB)
|
---|
710 | MANPAGE(fadctrl "")
|
---|
711 |
|
---|
712 | ADD_EXECUTABLE(feedback src/feedback.cc)
|
---|
713 | TARGET_LINK_LIBRARIES(feedback ${FACT++LIBS})
|
---|
714 | MANPAGE(feedback "")
|
---|
715 |
|
---|
716 | ADD_EXECUTABLE(fscctrl src/fscctrl.cc src/HeadersFTM.cc)
|
---|
717 | TARGET_LINK_LIBRARIES(fscctrl ${FACT++LIBS})
|
---|
718 | MANPAGE(fscctrl "")
|
---|
719 |
|
---|
720 | ADD_EXECUTABLE(ftmctrl src/ftmctrl.cc src/HeadersFTM.cc)
|
---|
721 | TARGET_LINK_LIBRARIES(ftmctrl ${FACT++LIBS})
|
---|
722 | MANPAGE(ftmctrl "")
|
---|
723 |
|
---|
724 | ADD_EXECUTABLE(gcn src/gcn.cc)
|
---|
725 | TARGET_LINK_LIBRARIES(gcn ${FACT++LIBS} Qt4::QtXml)
|
---|
726 | MANPAGE(gcn "")
|
---|
727 |
|
---|
728 | ADD_EXECUTABLE(scheduler src/scheduler.cc)
|
---|
729 | TARGET_LINK_LIBRARIES(scheduler ${FACT++LIBS})
|
---|
730 | MANPAGE(scheduler "")
|
---|
731 |
|
---|
732 | ADD_EXECUTABLE(gpsctrl src/gpsctrl.cc)
|
---|
733 | TARGET_LINK_LIBRARIES(gpsctrl ${FACT++LIBS})
|
---|
734 | MANPAGE(gpsctrl "")
|
---|
735 |
|
---|
736 | ADD_EXECUTABLE(lidctrl src/lidctrl.cc)
|
---|
737 | TARGET_LINK_LIBRARIES(lidctrl ${FACT++LIBS} Qt4::QtXml)
|
---|
738 | MANPAGE(lidctrl "")
|
---|
739 |
|
---|
740 | ADD_EXECUTABLE(magiclidar src/magiclidar.cc)
|
---|
741 | TARGET_LINK_LIBRARIES(magiclidar ${FACT++LIBS})
|
---|
742 | MANPAGE(magiclidar "")
|
---|
743 |
|
---|
744 | ADD_EXECUTABLE(magicweather src/magicweather.cc)
|
---|
745 | TARGET_LINK_LIBRARIES(magicweather ${FACT++LIBS})
|
---|
746 | MANPAGE(magicweather "")
|
---|
747 |
|
---|
748 | ADD_EXECUTABLE(mcp src/mcp.cc)
|
---|
749 | TARGET_LINK_LIBRARIES(mcp ${FACT++LIBS})
|
---|
750 | MANPAGE(mcp "")
|
---|
751 |
|
---|
752 | ADD_EXECUTABLE(pfminictrl src/pfminictrl.cc)
|
---|
753 | TARGET_LINK_LIBRARIES(pfminictrl ${FACT++LIBS})
|
---|
754 | MANPAGE(pfminictrl "")
|
---|
755 |
|
---|
756 | ADD_EXECUTABLE(pwrctrl src/pwrctrl.cc src/HeadersPower.cc)
|
---|
757 | TARGET_LINK_LIBRARIES(pwrctrl ${FACT++LIBS} Qt4::QtXml)
|
---|
758 | MANPAGE(pwrctrl "")
|
---|
759 |
|
---|
760 | ADD_EXECUTABLE(rainsensor src/rainsensor.cc)
|
---|
761 | TARGET_LINK_LIBRARIES(rainsensor ${FACT++LIBS})
|
---|
762 | MANPAGE(rainsensor "")
|
---|
763 |
|
---|
764 | ADD_EXECUTABLE(ratecontrol src/ratecontrol.cc)
|
---|
765 | TARGET_LINK_LIBRARIES(ratecontrol ${FACT++LIBS})
|
---|
766 | MANPAGE(ratecontrol "")
|
---|
767 |
|
---|
768 | ADD_EXECUTABLE(ratescan src/ratescan.cc)
|
---|
769 | TARGET_LINK_LIBRARIES(ratescan ${FACT++LIBS})
|
---|
770 | MANPAGE(ratescan "")
|
---|
771 |
|
---|
772 | #ADD_EXECUTABLE(scheduler src/scheduler.cc)
|
---|
773 | #TARGET_LINK_LIBRARIES(scheduler ${FACT++LIBS})
|
---|
774 | #MANPAGE(scheduler "")
|
---|
775 |
|
---|
776 | #ADD_EXECUTABLE(skypeclient src/skypeclient.cc)
|
---|
777 | #TARGET_LINK_LIBRARIES(skypeclient ${FACT++LIBS})
|
---|
778 | #MANPAGE(skypeclient "")
|
---|
779 |
|
---|
780 | ADD_EXECUTABLE(sqmctrl src/sqmctrl.cc)
|
---|
781 | TARGET_LINK_LIBRARIES(sqmctrl ${FACT++LIBS})
|
---|
782 | MANPAGE(sqmctrl "")
|
---|
783 |
|
---|
784 | ADD_EXECUTABLE(smartfact src/smartfact.cc)
|
---|
785 | TARGET_LINK_LIBRARIES(smartfact ${FACT++LIBS}) # HAVE_NOVA
|
---|
786 | MANPAGE(smartfact "")
|
---|
787 |
|
---|
788 | ADD_EXECUTABLE(temperature src/temperature.cc)
|
---|
789 | TARGET_LINK_LIBRARIES(temperature ${FACT++LIBS})
|
---|
790 | MANPAGE(temperature "")
|
---|
791 |
|
---|
792 | ADD_EXECUTABLE(timecheck src/timecheck.cc)
|
---|
793 | TARGET_LINK_LIBRARIES(timecheck ${FACT++LIBS})
|
---|
794 | MANPAGE(timecheck "")
|
---|
795 |
|
---|
796 | ADD_EXECUTABLE(tngweather src/tngweather.cc)
|
---|
797 | TARGET_LINK_LIBRARIES(tngweather ${FACT++LIBS} Qt4::QtXml)
|
---|
798 | MANPAGE(tngweather "")
|
---|
799 |
|
---|
800 | #ADD_EXECUTABLE(triggerschedule src/triggerschedule.cc)
|
---|
801 | #TARGET_LINK_LIBRARIES(triggerschedule ${FACT++LIBS})
|
---|
802 | #MANPAGE(triggerschedule "")
|
---|
803 |
|
---|
804 | ENDIF(NOT TOOLS_ONLY AND NOT VIEWER_ONLY)
|
---|
805 |
|
---|
806 | # ********************************************************
|
---|
807 | # ****************** GUI Applications ********************
|
---|
808 | # ********************************************************
|
---|
809 |
|
---|
810 | IF (NOT TOOLS_ONLY OR VIEWER_ONLY)
|
---|
811 |
|
---|
812 | INCLUDE_DIRECTORIES(${QWT_INCLUDE_DIR}/qwt-qt4 gui gui/RawEventsViewer)
|
---|
813 |
|
---|
814 | # --------------------------------------------------------
|
---|
815 |
|
---|
816 | QT4_WRAP_UI(VIEWER_QT_HEADERS gui/RawEventsViewer/viewer.ui)
|
---|
817 |
|
---|
818 | QT4_WRAP_CPP(VIEWER_QT_SOURCES
|
---|
819 | gui/RawEventsViewer/RawEventsViewer.h
|
---|
820 | gui/BasicGlCamera.h
|
---|
821 | gui/QCameraWidget.h
|
---|
822 | gui/Q3DCameraWidget.h)
|
---|
823 |
|
---|
824 | ADD_EXECUTABLE(viewer
|
---|
825 | gui/RawEventsViewer/RawEventsViewer.cc
|
---|
826 | gui/BasicGlCamera.cc
|
---|
827 | gui/QCameraWidget.cc
|
---|
828 | gui/Q3DCameraWidget.cc
|
---|
829 | ${VIEWER_QT_HEADERS}
|
---|
830 | ${VIEWER_QT_SOURCES})
|
---|
831 |
|
---|
832 | TARGET_LINK_LIBRARIES(viewer
|
---|
833 | ${Boost_LIBRARIES} Configuration
|
---|
834 | Qt4::QtGui Qt4::QtOpenGL
|
---|
835 | ${OPENGL_LIBRARIES} # OpenGL::GL OpenGL::GLU
|
---|
836 | qwt-qt4 ZLIB::ZLIB)
|
---|
837 |
|
---|
838 | ENDIF(NOT TOOLS_ONLY OR VIEWER_ONLY)
|
---|
839 |
|
---|
840 | # --------------------------------------------------------
|
---|
841 |
|
---|
842 | IF(NOT TOOLS_ONLY AND NOT VIEWER_ONLY AND ROOT_GQt_FOUND)
|
---|
843 |
|
---|
844 | QT4_ADD_RESOURCES(FACT_QT_RESOURCES gui/design.qrc)
|
---|
845 |
|
---|
846 | QT4_WRAP_UI(FACT_QT_HEADERS gui/design.ui)
|
---|
847 |
|
---|
848 | QT4_WRAP_CPP(FACT_QT_SOURCES
|
---|
849 | gui/DockWindow.h
|
---|
850 | gui/MainWindow.h
|
---|
851 | gui/QCameraWidget.h
|
---|
852 | gui/BasicGlCamera.h)
|
---|
853 |
|
---|
854 | ADD_EXECUTABLE(fact gui/fact.cc
|
---|
855 | gui/DockWindow.cc
|
---|
856 | gui/MainWindow.cc
|
---|
857 | gui/QCameraWidget.cc
|
---|
858 | gui/BasicGlCamera.cc
|
---|
859 | gui/HtmlDelegate.cc
|
---|
860 | gui/CheckBoxDelegate.cc
|
---|
861 | src/DimNetwork.cc
|
---|
862 | ${FACT_QT_HEADERS}
|
---|
863 | ${FACT_QT_SOURCES}
|
---|
864 | ${FACT_QT_RESOURCES})
|
---|
865 |
|
---|
866 | TARGET_LINK_LIBRARIES(fact
|
---|
867 | ${FACT++LIBS}
|
---|
868 | ${ROOT_LIBRARIES}
|
---|
869 | Qt4::QtGui Qt4::QtOpenGL Qt4::QtSql
|
---|
870 | ${OPENGL_LIBRARIES} # OpenGL::GL OpenGL::GLU
|
---|
871 | qwt-qt4 ZLIB::ZLIB)
|
---|
872 |
|
---|
873 |
|
---|
874 | #dclient5_SOURCES = src/dclient5.cc src/LocalControl.h
|
---|
875 | #dclient5_LDADD = libDim++.la libDim.la libStateMachine.la libTime.la libTools.la \
|
---|
876 | # libConfiguration.la
|
---|
877 |
|
---|
878 | #argv_SOURCES = src/argv.cc
|
---|
879 | #argv_LDADD = libConfiguration.la
|
---|
880 |
|
---|
881 | #time_SOURCES = src/time.cc
|
---|
882 | #time_LDADD = libTime.la
|
---|
883 |
|
---|
884 | #test_SOURCES = src/test.cc
|
---|
885 | #test_LDADD = libStateMachine.la libTools.la libTime.la libDim++.la libDim.la libConfiguration.la
|
---|
886 |
|
---|
887 | ENDIF(NOT TOOLS_ONLY AND NOT VIEWER_ONLY AND ROOT_GQt_FOUND)
|
---|
888 |
|
---|
889 |
|
---|
890 | # ********************************************************
|
---|
891 | # ********************** FAMOUS **************************
|
---|
892 | # ********************************************************
|
---|
893 |
|
---|
894 | IF(FOUND_FAMOUS)
|
---|
895 | INCLUDE_DIRECTORIES(famous/ui)
|
---|
896 | INCLUDE_DIRECTORIES(famous/src)
|
---|
897 |
|
---|
898 | ADD_EXECUTABLE(famousbias famous/src/famousbias.cc)
|
---|
899 | TARGET_LINK_LIBRARIES(famousbias ${FACT++LIBS})
|
---|
900 | MANPAGE(famousbias "")
|
---|
901 |
|
---|
902 | ADD_EXECUTABLE(famousui famous/ui/famousui.cc)
|
---|
903 | TARGET_LINK_LIBRARIES(famousui ${FACT++LIBS})
|
---|
904 | MANPAGE(famousui "")
|
---|
905 |
|
---|
906 | ADD_EXECUTABLE(ftuctrl famous/src/ftuctrl.cc)
|
---|
907 | TARGET_LINK_LIBRARIES(ftuctrl ${FACT++LIBS})
|
---|
908 | MANPAGE(ftuctrl "")
|
---|
909 |
|
---|
910 | ADD_EXECUTABLE(miniftmctrl famous/src/miniftmctrl.cc)
|
---|
911 | TARGET_LINK_LIBRARIES(miniftmctrl ${FACT++LIBS})
|
---|
912 | MANPAGE(miniftmctrl "")
|
---|
913 |
|
---|
914 | ADD_EXECUTABLE(fpgaftmctrl famous/src/fpgaftmctrl.cc)
|
---|
915 | TARGET_LINK_LIBRARIES(fpgaftmctrl ${FACT++LIBS})
|
---|
916 | MANPAGE(fpgaftmctrl "")
|
---|
917 |
|
---|
918 | ADD_EXECUTABLE(famousrate famous/src/famousrate.cc)
|
---|
919 | TARGET_LINK_LIBRARIES(famousrate ${FACT++LIBS})
|
---|
920 | MANPAGE(famousrate "")
|
---|
921 |
|
---|
922 | ADD_EXECUTABLE(famousscan famous/src/famousscan.cc)
|
---|
923 | TARGET_LINK_LIBRARIES(famousscan ${FACT++LIBS})
|
---|
924 | MANPAGE(famousscan "")
|
---|
925 |
|
---|
926 | ADD_EXECUTABLE(beaglectrl famous/src/beaglectrl.cc)
|
---|
927 | TARGET_LINK_LIBRARIES(beaglectrl ${FACT++LIBS} Qt4::QtXml)
|
---|
928 | MANPAGE(beaglectrl "")
|
---|
929 | ENDIF()
|
---|
930 |
|
---|
931 |
|
---|
932 |
|
---|
933 | # ********************************************************
|
---|
934 | # ********************** IceACT **************************
|
---|
935 | # ********************************************************
|
---|
936 |
|
---|
937 | IF(FOUND_ICEACT)
|
---|
938 | ADD_EXECUTABLE(iceactpsu iceact/src/psuctrl.cc)
|
---|
939 | TARGET_LINK_LIBRARIES(iceactpsu ${FACT++LIBS})
|
---|
940 | MANPAGE(iceactpsu "")
|
---|
941 |
|
---|
942 | ADD_EXECUTABLE(tmonctrl iceact/src/tmonctrl.cc)
|
---|
943 | TARGET_LINK_LIBRARIES(tmonctrl ${FACT++LIBS})
|
---|
944 | MANPAGE(tmonctrl "")
|
---|
945 | ENDIF()
|
---|
946 |
|
---|
947 |
|
---|
948 | # *********************************
|
---|
949 | # ********** Installation *********
|
---|
950 | # *********************************
|
---|
951 |
|
---|
952 | # ======== Setup directories ======
|
---|
953 |
|
---|
954 | # MESSAGE("")
|
---|
955 | # MESSAGE("PREFIX: "${CMAKE_INSTALL_PREFIX})
|
---|
956 | # MESSAGE("")
|
---|
957 | # MESSAGE("BINDIR: "${CMAKE_INSTALL_FULL_BINDIR})
|
---|
958 | # MESSAGE("SBINDIR: "${CMAKE_INSTALL_FULL_SBINDIR})
|
---|
959 | # MESSAGE("LIBEXECDIR: "${CMAKE_INSTALL_FULL_LIBEXECDIR})
|
---|
960 | # MESSAGE("SHAREDSTATEDIR: "${CMAKE_INSTALL_FULL_SHAREDSTATEDIR})
|
---|
961 | # MESSAGE("LOCALSTATEDIR: "${CMAKE_INSTALL_FULL_LOCALSTATEDIR})
|
---|
962 | # MESSAGE("RUNSTATEDIR: "${CMAKE_INSTALL_FULL_RUNSTATEDIR})
|
---|
963 | # MESSAGE("LIBDIR: "${CMAKE_INSTALL_FULL_LIBDIR})
|
---|
964 | # MESSAGE("INCLUDEDIR: "${CMAKE_INSTALL_FULL_INCLUDEDIR})
|
---|
965 | # MESSAGE("DATAROOTDIR: "${CMAKE_INSTALL_FULL_DATAROOTDIR})
|
---|
966 | # MESSAGE("DATADIR: "${CMAKE_INSTALL_FULL_DATADIR})
|
---|
967 | # MESSAGE("INFODIR: "${CMAKE_INSTALL_FULL_INFODIR})
|
---|
968 | # MESSAGE("LOCALDIR: "${CMAKE_INSTALL_FULL_LOCALDIR})
|
---|
969 | # MESSAGE("MANDIR: "${CMAKE_INSTALL_FULL_MANDIR})
|
---|
970 | # MESSAGE("DOCDIR: "${CMAKE_INSTALL_FULL_DOCDIR})
|
---|
971 | # MESSAGE("")
|
---|
972 | # MESSAGE("BINDIR: "${CMAKE_INSTALL_BINDIR})
|
---|
973 | # MESSAGE("SBINDIR: "${CMAKE_INSTALL_SBINDIR})
|
---|
974 | # MESSAGE("LIBEXECDIR: "${CMAKE_INSTALL_LIBEXECDIR})
|
---|
975 | # MESSAGE("SHAREDSTATEDIR: "${CMAKE_INSTALL_SHAREDSTATEDIR})
|
---|
976 | # MESSAGE("LOCALSTATEDIR: "${CMAKE_INSTALL_LOCALSTATEDIR})
|
---|
977 | # MESSAGE("RUNSTATEDIR: "${CMAKE_INSTALL_RUNSTATEDIR})
|
---|
978 | # MESSAGE("LIBDIR: "${CMAKE_INSTALL_LIBDIR})
|
---|
979 | # MESSAGE("INCLUDEDIR: "${CMAKE_INSTALL_INCLUDEDIR})
|
---|
980 | # MESSAGE("DATAROOTDIR: "${CMAKE_INSTALL_DATAROOTDIR})
|
---|
981 | # MESSAGE("DATADIR: "${CMAKE_INSTALL_DATADIR})
|
---|
982 | # MESSAGE("INFODIR: "${CMAKE_INSTALL_INFODIR})
|
---|
983 | # MESSAGE("LOCALDIR: "${CMAKE_INSTALL_LOCALDIR})
|
---|
984 | # MESSAGE("MANDIR: "${CMAKE_INSTALL_MANDIR})
|
---|
985 | # MESSAGE("DOCDIR: "${CMAKE_INSTALL_DOCDIR})
|
---|
986 | # MESSAGE("")
|
---|
987 |
|
---|
988 | SET(PKG_SHARE "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}")
|
---|
989 | SET(PKG_APPS "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
---|
990 | SET(PKG_PIXMAPS "${CMAKE_INSTALL_DATAROOTDIR}/pixmaps")
|
---|
991 |
|
---|
992 | # ====== Installation targets =====
|
---|
993 |
|
---|
994 | IF (NOT VIEWER_ONLY)
|
---|
995 | INSTALL(TARGETS fits2sql DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
---|
996 | INSTALL(TARGETS root2sql DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
---|
997 | INSTALL(TARGETS fitsdump DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
---|
998 | INSTALL(TARGETS zfits DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
---|
999 | INSTALL(TARGETS calcsource DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
---|
1000 | INSTALL(TARGETS showlog DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
---|
1001 | INSTALL(TARGETS rootifysql DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
---|
1002 | ENDIF(NOT VIEWER_ONLY)
|
---|
1003 |
|
---|
1004 | INSTALL(TARGETS Configuration DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
---|
1005 | INSTALL(TARGETS Time DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
---|
1006 | INSTALL(TARGETS Tools DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
---|
1007 |
|
---|
1008 |
|
---|
1009 | #INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/html DESTINATION "${PKG_SHARE}" FILES_MATCHING PATTERN "*.html")
|
---|
1010 | #INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/pdf DESTINATION "${PKG_SHARE}" FILES_MATCHING PATTERN "*.pdf")
|
---|
1011 |
|
---|
1012 | # *********************************
|
---|
1013 | # ************ Packaging **********
|
---|
1014 | # *********************************
|
---|
1015 |
|
---|
1016 | # ======== General packaging ======
|
---|
1017 | # https://cmake.org/cmake/help/latest/module/CPack.html
|
---|
1018 |
|
---|
1019 | INCLUDE(InstallRequiredSystemLibraries)
|
---|
1020 |
|
---|
1021 | # SET(CPACK_STRIP_FILES ON) # Strip debug sysmbold from files
|
---|
1022 |
|
---|
1023 | SET(CPACK_PACKAGE_VERSION "${fact++_VERSION}")
|
---|
1024 | SET(CPACK_PACKAGE_CONTACT "${PACKAGE_BUGREPORT}")
|
---|
1025 | SET(CPACK_PACKAGE_MAINTAINER "${PACKAGE_MAINTAINER}")
|
---|
1026 | SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
|
---|
1027 | #SET(CPACK_PACKAGE_VENDOR "Me, myself, and I")
|
---|
1028 |
|
---|
1029 |
|
---|
1030 | SET(CPACK_SOURCE_IGNORE_FILES "/old/;/build/;/[.].*/;/autom4te[.]cache/;.*~;.log$")
|
---|
1031 |
|
---|
1032 | # Maybe the text displayed in synaptic?
|
---|
1033 | SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README")
|
---|
1034 | SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "FACT++ - Toolset")
|
---|
1035 | #CPACK_RESOURCE_FILE_README ReadMe file to be embedded in the installer.
|
---|
1036 |
|
---|
1037 | SET(CPACK_GENERATOR TBZ2 DEB) # TGZ
|
---|
1038 | SET(CPACK_SOURCE_GENERATOR TBZ2) # TGZ
|
---|
1039 | #SET(CPACK_PROJECT_CONFIG_FILE ${CMAKE_SOURCE_DIR}/cmake/Package.txt)
|
---|
1040 | #SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
|
---|
1041 |
|
---|
1042 |
|
---|
1043 | # ======== Debian packaging =======
|
---|
1044 | # https://cmake.org/cmake/help/latest/module/CPackDeb.html
|
---|
1045 | # https://www.debian.org/doc/debian-policy
|
---|
1046 |
|
---|
1047 | #SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libao4 (>=1.0), libsfm-system2.3v5 (>=2.3), libsfml-graphicsv2.3v5 (>=2.3), libsfml-audio2.3v5 (>=2.3), libsfm-window2.3v5 (>2.3)")
|
---|
1048 | SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS 1) # generate better (atomatic?) dependecies
|
---|
1049 | SET(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=")
|
---|
1050 | SET(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
|
---|
1051 | SET(CPACK_DEBIAN_PACKAGE_SECTION utils)
|
---|
1052 | SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${PACKAGE_URL}")
|
---|
1053 | SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION
|
---|
1054 | "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}
|
---|
1055 | This package contains some tools which are part of FACT++ to deal with databases, fits files and root-files.")
|
---|
1056 | #indent the long description with spaces
|
---|
1057 |
|
---|
1058 | #CPACK_INSTALL_CMAKE_PROJECTS
|
---|
1059 | #List of four values that specify what project to install. Build directory, Project Name, Project Component, Directory.
|
---|
1060 |
|
---|
1061 | INCLUDE(CPack)
|
---|