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

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