source: trunk/FACT++/CMakeLists.txt

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