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

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