source: trunk/FACT++/CMakeLists.txt@ 19975

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