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

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