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

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