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

Last change on this file since 19285 was 19285, checked in by tbretz, 9 months ago
This should (hopefully) make compilation compatible with root version compiled with and without cmake.
File size: 32.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# *********************************
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)
206SET(CMAKE_C_FLAGS "-pedantic")
207
208SET(CMAKE_CXX_FLAGS
209        "${CMAKE_CXX_FLAGS} -Wall -Winit-self -Wpointer-arith \
210         -Wcast-align -Wformat=2 -Woverloaded-virtual \
211         -Wnon-virtual-dtor -Wshadow -Wno-unknown-pragmas") # -Wextra
212
213# FIXME: Move that to config.h.in
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} -DMIPSEL -DPROTOCOL=1 -Dunix -Dlinux")
236
237# --------- ROOT -------------
238
239#IF(EXISTS "$ENV{ROOTSYS}/ROOTConfig.cmake")
240IF(DEFINED $ENV{CMAKE_PREFIX_PATH}) # -- This is supposed to be root 6 --
241   # You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
242   #   - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
243   #   - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
244   LIST(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
245   #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
246   FIND_PACKAGE(ROOT REQUIRED COMPONENTS Gui Minuit ASImage HistPainter)
247   #---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
248   INCLUDE(${ROOT_USE_FILE})
249ELSE()
250   # You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
251   #   - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
252   #   - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
253   SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "$ENV{ROOTSYS}/etc/cmake")
254   #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
255   FIND_PACKAGE(ROOT REQUIRED COMPONENTS GQt)
256   # From RootUseFile.cmake (root 6)
257   INCLUDE_DIRECTORIES(${ROOT_INCLUDE_DIRS})
258   LINK_DIRECTORIES(${ROOT_LIBRARY_DIR})
259   ADD_DEFINITIONS(${ROOT_DEFINITIONS})
260   SET(CMAKE_CXX_FLAGS     "${CMAKE_CXX_FLAGS} ${ROOT_CXX_FLAGS}")
261   SET(CMAKE_C_FLAGS       "${CMAKE_C_FLAGS} ${ROOT_C_FLAGS}")
262   SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${ROOT_fortran_FLAGS}")
263ENDIF()
264
265# -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree
266# -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread
267# -lASImage -lMinuit -lHistPainter -lThread
268
269#MESSAGE("INCL_DIRS: ${ROOT_INCLUDE_DIRS}")
270#MESSAGE("LIBS:      ${ROOT_LIBRARIES}")
271#MESSAGE("DEFS:      ${ROOT_DEFINITIONS}")
272#MESSAGE("CXXFLAGS:  ${ROOT_CXX_FLAGS}")
273#MESSAGE("CXFLAGS:   ${ROOT_CC_FLAGS}")
274#MESSAGE("FOUND:     ${ROOT_FOUND}")
275#MESSAGE("FILE:      ${ROOT_USE_FILE}")
276#MESSAGE("DIR:       ${CMAKE_CURRENT_SOURCE_DIR}")
277#ROOT_<library>_LIBRARY PATH    Full path for each of the ROOT libraries listed in COMPONENTS
278#ROOT_<command>_CMD     PATH    Full path for each ROOT executable (rootcling, root, hadd, etc.)
279#ROOT_<option>_FOUND    BOOL    True for each enabled build option (e.g. cocoa, python, xrootd, etc.)
280
281# function ROOT_GENERATE_DICTIONARY( dictionary
282#                                    header1 header2 ...
283#                                    LINKDEF linkdef1 ...
284#                                    OPTIONS opt1...)
285
286# -------------------------------------------------------
287
288INCLUDE_DIRECTORIES(pal)
289INCLUDE_DIRECTORIES(erfa/src)
290INCLUDE_DIRECTORIES(dim/dim)
291INCLUDE_DIRECTORIES(externals)
292INCLUDE_DIRECTORIES(src)
293
294# ********************************************************
295# ********************** Libraries ***********************
296# ********************************************************
297IF (NOT TOOLS_ONLY)
298
299# =================== libPointing.so ======================
300ADD_LIBRARY(Pointing SHARED
301        pal/pal.h
302        pal/palDtt.c            pal/palDat.c            pal/palMappa.c
303        pal/palPrenut.c         pal/palEvp.c            pal/palAoppa.c
304        pal/palAoppat.c         pal/palRefco.c          pal/palRefro.c
305        pal/pal1Atmt.c          pal/palDrange.c         pal/palOne2One.c
306        pal/pal1Atms.c          pal/palMapqkz.c         pal/palAopqk.c
307        pal/palRefz.c           pal/palAmpqk.c          pal/palRdplan.c
308        pal/palDt.c             pal/palPvobs.c          pal/palNut.c
309        pal/palDmoon.c          pal/palPlanet.c         pal/palNutc.c
310        pal/palDeuler.c
311        erfa/src/gd2gc.c        erfa/src/p06e.c         erfa/src/c2s.c
312        erfa/src/eform.c        erfa/src/s2c.c          erfa/src/pas.c
313        erfa/src/pmat06.c       erfa/src/epv00.c        erfa/src/plan94.c
314        erfa/src/anpm.c         erfa/src/obl06.c        erfa/src/dat.c
315        erfa/src/af2a.c         erfa/src/rxr.c          erfa/src/gmst06.c
316        erfa/src/sepp.c         erfa/src/rz.c           erfa/src/zp.c
317        erfa/src/rxpv.c         erfa/src/pn.c           erfa/src/cr.c
318        erfa/src/seps.c         erfa/src/ry.c           erfa/src/pdp.c
319        erfa/src/pnm06a.c       erfa/src/hfk5z.c        erfa/src/epj2jd.c
320        erfa/src/pv2s.c         erfa/src/tf2a.c         erfa/src/pm.c
321        erfa/src/sxp.c          erfa/src/a2af.c         erfa/src/rxp.c
322        erfa/src/pxp.c          erfa/src/fk5hip.c       erfa/src/fw2m.c
323        erfa/src/rx.c           erfa/src/tf2d.c         erfa/src/cal2jd.c
324        erfa/src/cp.c           erfa/src/nut06a.c       erfa/src/rm2v.c
325        erfa/src/nut00a.c       erfa/src/ee06a.c        erfa/src/fk5hz.c
326        erfa/src/epb2jd.c       erfa/src/refco.c        erfa/src/a2tf.c
327        erfa/src/fapa03.c       erfa/src/gst06a.c       erfa/src/faf03.c
328        erfa/src/faur03.c       erfa/src/faju03.c       erfa/src/fal03.c
329        erfa/src/fasa03.c       erfa/src/fame03.c       erfa/src/fave03.c
330        erfa/src/fama03.c       erfa/src/faom03.c       erfa/src/gst06.c
331        erfa/src/jd2cal.c       erfa/src/gd2gce.c       erfa/src/anp.c
332        erfa/src/fae03.c        erfa/src/ir.c           erfa/src/pfw06.c
333        erfa/src/bpn2xy.c       erfa/src/eors.c         erfa/src/s06.c
334        erfa/src/trxp.c         erfa/src/era00.c        erfa/src/epj.c
335        erfa/src/d2tf.c         erfa/src/epb.c          erfa/src/rv2m.c
336        erfa/src/pap.c          erfa/src/fad03.c        erfa/src/pmp.c
337        erfa/src/tr.c           erfa/src/falp03.c)
338
339# ======================= libDim.so ======================
340ADD_LIBRARY(Dim SHARED
341#       dim/dim/dic.h
342#       dim/dim/dim_common.h
343#       dim/dim/dim.h
344#       dim/dim/dim_tcpip.h
345#       dim/dim/dis.h
346        dim/src/dic.c
347        dim/src/dis.c
348        dim/src/dna.c
349        dim/src/sll.c
350        dim/src/dll.c
351        dim/src/hash.c
352        dim/src/swap.c
353        dim/src/copy_swap.c
354        dim/src/open_dns.c
355        dim/src/conn_handler.c
356        dim/src/tcpip.c
357        dim/src/dtq.c
358        dim/src/dim_thr.c
359        dim/src/utilities.c)
360
361# ================= libDimExtension.so ===================
362ADD_LIBRARY(DimExtension SHARED
363#        src/DimSetup.h
364        src/DimSetup.cc)
365
366# ===================== libDim++.so ======================
367ADD_LIBRARY(Dim++ SHARED
368#       dim/dim/dic.hxx
369#       dim/dim/dis.hxx
370#       dim/dim/dim_core.hxx
371#       dim/dim/dim.hxx
372#       dim/dim/dim_tcpip.h
373#       dim/dim/dllist.hxx
374#       dim/dim/sllist.hxx
375#       dim/dim/tokenstring.hxx
376#       src/Dim.h
377        dim/src/diccpp.cxx
378        dim/src/dimcpp.cxx
379        dim/src/discpp.cxx
380        dim/src/tokenstring.cxx)
381
382# ================= libStateMachine.so ===================
383ADD_LIBRARY(StateMachine SHARED
384        src/WindowLog.h       src/WindowLog.cc
385        src/Readline.h        src/Readline.cc
386        src/ReadlineColor.h   src/ReadlineColor.cc
387        src/ReadlineWindow.h  src/ReadlineWindow.cc
388        src/Console.h         src/Console.cc
389        src/Shell.h           src/Shell.cc
390        src/EventImp.h        src/EventImp.cc
391        src/Event.h           src/Event.cc
392        src/State.h           src/State.cc
393        src/Description.h     src/Description.cc
394        src/MessageImp.h      src/MessageImp.cc
395        src/Converter.h       src/Converter.cc
396        src/StateMachineImp.h src/StateMachineImp.cc
397        src/StateMachine.h    src/StateMachine.cc
398        src/EventDim.h
399        src/MessageDim.h         src/MessageDim.cc
400        src/StateMachineDim.h    src/StateMachineDim.cc
401        src/DimServerList.h      src/DimServerList.cc
402        src/DimServiceInfoList.h src/DimServiceInfoList.cc
403#       src/DimNetworkList.h     src/DimNetwork.cc
404        src/ServiceList.h        src/ServiceList.cc
405        src/DimErrorRedirecter.h
406        src/DimErrorRedirecter.cc
407        src/DimDescriptionService.h
408        src/DimDescriptionService.cc
409        src/Connection.h      src/Connection.cc
410        src/ConnectionUSB.h   src/ConnectionUSB.cc
411        src/ConnectionSSL.h   src/ConnectionSSL.cc
412#       FACT.h ByteOrder.h
413        src/DimWriteStatistics.h src/DimWriteStatistics.cc)
414TARGET_LINK_LIBRARIES(StateMachine OpenSSL::SSL)
415
416ENDIF (NOT TOOLS_ONLY)
417
418# ================= libConfiguration.so ==================
419ADD_LIBRARY(Configuration SHARED
420        src/Configuration.h src/Configuration.cc
421        src/FACT.h src/FACT.cc)
422TARGET_LINK_LIBRARIES(Configuration
423        Boost::regex
424        Boost::system
425        Boost::filesystem
426        Boost::program_options
427        ${MYSQL_LIBRARY} ${MYSQLPP_LIBRARY})
428
429# ===================== libTime.so =======================
430ADD_LIBRARY(Time SHARED
431        src/Time.h src/Time.cc)
432TARGET_LINK_LIBRARIES(Time ${NOVA_LIBRARY})
433
434# ===================== libTools.so ======================
435ADD_LIBRARY(Tools SHARED
436        src/tools.h src/tools.cc)
437
438
439
440# ********************************************************
441# ********************** Manuals *************************
442# ********************************************************
443
444FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/man1)
445FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/html)
446FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/pdf)
447
448MACRO(MANPAGE program description)
449# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
450IF (HELP2MAN_EXECUTABLE AND ROFF2HTML_EXECUTABLE AND ROFF2PDF_EXECUTABLE AND GROFF_EXECUTABLE)
451        ADD_CUSTOM_COMMAND(
452                OUTPUT
453                   man1/${program}.1
454                DEPENDS
455                   ${program}
456                COMMAND
457                   ${HELP2MAN_EXECUTABLE}
458                   ${PROJECT_BINARY_DIR}/${program}
459                   -n "${description}"
460                   --no-info
461                   --output=man1/${program}.1
462                COMMAND
463                   ${GROFF_EXECUTABLE}
464                   -mandoc man1/${program}.1
465                   -T html > html/${program}.html
466                COMMAND
467                   ${GROFF_EXECUTABLE}
468                   -mandoc man1/${program}.1
469                   -T pdf > pdf/${program}.pdf
470                COMMENT
471                   "Generating man-page ${program}.1"
472                VERBATIM)
473
474        ADD_CUSTOM_TARGET(${program}.man ALL DEPENDS man1/${program}.1)
475
476        INSTALL(FILES ${PROJECT_BINARY_DIR}/man1/${program}.1 DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
477ENDIF()
478ENDMACRO()
479
480
481
482
483# ********************************************************
484# *********************** Helpers ************************
485# ********************************************************
486
487SET(HELP++LIBS Tools Configuration Time)
488
489# --------------------------------------------------------
490
491ADD_EXECUTABLE(fitsdump src/fitsdump.cc)
492TARGET_LINK_LIBRARIES(fitsdump ${HELP++LIBS} ${ROOT_LIBRARIES} ZLIB::ZLIB)
493MANPAGE(fitsdump "FACT++ - fitsdump - Read and dump contents of a FITStable")
494
495#ADD_EXECUTABLE(fitsloader src/fitsloader.cc)
496#TARGET_LINK_LIBRARIES(fitsloader ${HELP++LIBS})
497#MANPAGE(fitsloader "")
498
499#ADD_EXECUTABLE(fitscheck src/fitscheck.cc)
500#TARGET_LINK_LIBRARIES(fitscheck ${HELP++LIBS} ZLIB::ZLIB)
501#MANPAGE(fitscheck "")
502
503#ADD_EXECUTABLE(fitsCompressor src/fitsCompressor.cc)
504#TARGET_LINK_LIBRARIES(fitsCompressor ${HELP++LIBS} ZLIB::ZLIB)
505#MANPAGE(fitsCompressor "")
506
507#ADD_EXECUTABLE(fitsselect src/fitsselect.cc)
508#TARGET_LINK_LIBRARIES(fitsselect ${HELP++LIBS} ZLIB::ZLIB)
509#MANPAGE(fitsselect "")
510
511#ADD_EXECUTABLE(readfits src/readfits.cc)
512#TARGET_LINK_LIBRARIES(readfits ${HELP++LIBS} ZLIB::ZLIB)
513#MANPAGE(readfits "")
514
515ADD_EXECUTABLE(rootifysql src/rootifysql.cc)
516TARGET_LINK_LIBRARIES(rootifysql ${HELP++LIBS} ${ROOT_LIBRARIES})
517MANPAGE(rootifysql "FACT++ - rootifysql - Write result of a SQL query into a root-file")
518
519ADD_EXECUTABLE(root2sql src/root2sql.cc)
520TARGET_LINK_LIBRARIES(root2sql ${HELP++LIBS} ${ROOT_LIBRARIES})
521MANPAGE(root2sql "FACT++ - root2sql - Fill contents of a root-tree into a MySQL database")
522
523ADD_EXECUTABLE(fits2sql src/fits2sql.cc)
524TARGET_LINK_LIBRARIES(fits2sql ${HELP++LIBS}  ZLIB::ZLIB)
525MANPAGE(fits2sql "FACT++ - fits2sql - Fill contents of a FITS table into a MySQL database")
526
527ADD_EXECUTABLE(showlog src/showlog.cc src/WindowLog.cc)
528TARGET_LINK_LIBRARIES(showlog Threads::Threads ${HELP++LIBS} ${CURSES_LIBRARIES})
529MANPAGE(showlog "")
530
531ADD_EXECUTABLE(zfits src/zfits.cc)
532TARGET_LINK_LIBRARIES(zfits ${HELP++LIBS} ZLIB::ZLIB)
533MANPAGE(zfits "")
534
535ADD_EXECUTABLE(calcsource src/calcsource.cc)
536TARGET_LINK_LIBRARIES(calcsource ${HELP++LIBS} ${ROOT_LIBRARIES})
537MANPAGE(calcsource "")
538
539IF (NOT TOOLS_ONLY)
540
541ADD_EXECUTABLE(getevent src/getevent.cc)
542TARGET_LINK_LIBRARIES(getevent ${HELP++LIBS} ZLIB::ZLIB)
543MANPAGE(getevent "")
544
545ADD_EXECUTABLE(makeplots src/makeplots.cc)
546TARGET_LINK_LIBRARIES(makeplots  ${HELP++LIBS} ${ROOT_LIBRARIES})
547MANPAGE(makeplots "")
548
549ADD_EXECUTABLE(makedata src/makedata.cc)
550TARGET_LINK_LIBRARIES(makedata ${HELP++LIBS})
551MANPAGE(makedata "")
552
553ADD_EXECUTABLE(makeschedule src/makeschedule.cc)
554TARGET_LINK_LIBRARIES(makeschedule ${HELP++LIBS})
555MANPAGE(makeschedule "")
556
557# ********************************************************
558# ********************* Operation ************************
559# ********************************************************
560
561SET(FACT++LIBS
562        StateMachine Tools Configuration Time Dim++ Dim DimExtension
563        mysqlpp readline ${CURSES_LIBRARIES} panel Boost::thread) # HAVE_SQL
564
565# --------------------------------------------------------
566
567ADD_EXECUTABLE(dns src/dns.c)
568TARGET_LINK_LIBRARIES(dns ${FACT++LIBS})
569MANPAGE(dns "")
570
571ADD_EXECUTABLE(agilentctrl src/agilentctrl.cc)
572TARGET_LINK_LIBRARIES(agilentctrl ${FACT++LIBS})
573MANPAGE(agilentctrl "")
574
575ADD_EXECUTABLE(biasctrl src/biasctrl.cc)
576TARGET_LINK_LIBRARIES(biasctrl ${FACT++LIBS})
577MANPAGE(biasctrl "")
578
579ADD_EXECUTABLE(biastemp src/biastemp.cc)
580TARGET_LINK_LIBRARIES(biastemp ${FACT++LIBS})
581MANPAGE(biastemp "")
582
583ADD_EXECUTABLE(chatserv src/chatserv.cc)
584TARGET_LINK_LIBRARIES(chatserv ${FACT++LIBS}) # does not require libpanel
585MANPAGE(chatserv "")
586
587ADD_EXECUTABLE(chatclient src/chatclient.cc)
588TARGET_LINK_LIBRARIES(chatclient ${FACT++LIBS}) # does not require libpanel
589MANPAGE(chatclient "")
590
591#ADD_EXECUTABLE(cosyctrl src/cosyctrl.cc)# src/LocalControl.h
592#TARGET_LINK_LIBRARIES(cosyctrl
593#       StateMachine Tools Configuration Time Dim++ Dim DimExtension
594#        ${Boost_LIBRARIES} readline ${CURSES_LIBRARIES})
595
596ADD_EXECUTABLE(datalogger src/datalogger.cc
597        src/DimState.cc
598        src/FitsFile.cc src/Fits.cc)
599TARGET_LINK_LIBRARIES(datalogger ${FACT++LIBS} cfitsio CCfits)
600MANPAGE(datalogger "")
601
602ADD_EXECUTABLE(dimctrl src/dimctrl.cc
603        src/StateMachineDimControl.cc
604        src/RemoteControl.cc
605        src/InterpreterV8.cc
606        src/DimState.cc)
607TARGET_LINK_LIBRARIES(dimctrl ${FACT++LIBS} Pointing ZLIB::ZLIB v8)
608MANPAGE(dimctrl "")
609
610ADD_CUSTOM_TARGET(dimserver ALL
611        COMMAND ln -sf dimctrl dimserver
612        COMMENT "Creating symlink for dimserver"
613        DEPENDS dimctrl)
614
615ADD_EXECUTABLE(drivectrl src/drivectrl.cc)
616TARGET_LINK_LIBRARIES(drivectrl ${FACT++LIBS} Pointing)
617MANPAGE(drivectrl "")
618
619ADD_EXECUTABLE(evtserver src/evtserver.cc)
620TARGET_LINK_LIBRARIES(evtserver ${FACT++LIBS} ZLIB::ZLIB)
621MANPAGE(evtserver "")
622
623ADD_EXECUTABLE(fadctrl src/fadctrl.cc src/HeadersFAD.cc
624        src/EventBuilder.cc
625        src/FitsFile.cc
626        src/DataCalib.cc
627        src/DataWriteRaw.cc
628        src/DataWriteFits.cc
629        src/DataWriteFits2.cc
630        src/DataProcessorImp.cc)
631TARGET_LINK_LIBRARIES(fadctrl ${FACT++LIBS} cfitsio CCfits ZLIB::ZLIB)
632MANPAGE(fadctrl "")
633
634ADD_EXECUTABLE(feedback src/feedback.cc)
635TARGET_LINK_LIBRARIES(feedback ${FACT++LIBS})
636MANPAGE(feedback "")
637
638ADD_EXECUTABLE(fscctrl src/fscctrl.cc src/HeadersFTM.cc)
639TARGET_LINK_LIBRARIES(fscctrl ${FACT++LIBS})
640MANPAGE(fscctrl "")
641
642ADD_EXECUTABLE(ftmctrl src/ftmctrl.cc src/HeadersFTM.cc)
643TARGET_LINK_LIBRARIES(ftmctrl ${FACT++LIBS})
644MANPAGE(ftmctrl "")
645
646ADD_EXECUTABLE(gcn src/gcn.cc)
647TARGET_LINK_LIBRARIES(gcn ${FACT++LIBS} Qt4::QtXml)
648MANPAGE(gcn "")
649
650ADD_EXECUTABLE(gpsctrl src/gpsctrl.cc)
651TARGET_LINK_LIBRARIES(gpsctrl ${FACT++LIBS})
652MANPAGE(gpsctrl "")
653
654ADD_EXECUTABLE(lidctrl src/lidctrl.cc)
655TARGET_LINK_LIBRARIES(lidctrl ${FACT++LIBS} Qt4::QtXml)
656MANPAGE(lidctrl "")
657
658ADD_EXECUTABLE(magiclidar src/magiclidar.cc)
659TARGET_LINK_LIBRARIES(magiclidar ${FACT++LIBS})
660MANPAGE(magiclidar "")
661
662ADD_EXECUTABLE(magicweather src/magicweather.cc)
663TARGET_LINK_LIBRARIES(magicweather ${FACT++LIBS})
664MANPAGE(magicweather "")
665
666ADD_EXECUTABLE(mcp src/mcp.cc)
667TARGET_LINK_LIBRARIES(mcp ${FACT++LIBS})
668MANPAGE(mcp "")
669
670ADD_EXECUTABLE(pfminictrl src/pfminictrl.cc)
671TARGET_LINK_LIBRARIES(pfminictrl ${FACT++LIBS})
672MANPAGE(pfminictrl "")
673
674ADD_EXECUTABLE(pwrctrl src/pwrctrl.cc src/HeadersPower.cc)
675TARGET_LINK_LIBRARIES(pwrctrl ${FACT++LIBS} Qt4::QtXml)
676MANPAGE(pwrctrl "")
677
678ADD_EXECUTABLE(rainsensor src/rainsensor.cc)
679TARGET_LINK_LIBRARIES(rainsensor ${FACT++LIBS})
680MANPAGE(rainsensor "")
681
682ADD_EXECUTABLE(ratecontrol src/ratecontrol.cc)
683TARGET_LINK_LIBRARIES(ratecontrol ${FACT++LIBS})
684MANPAGE(ratecontrol "")
685
686ADD_EXECUTABLE(ratescan src/ratescan.cc)
687TARGET_LINK_LIBRARIES(ratescan ${FACT++LIBS})
688MANPAGE(ratescan "")
689
690#ADD_EXECUTABLE(scheduler src/scheduler.cc)
691#TARGET_LINK_LIBRARIES(scheduler ${FACT++LIBS})
692#MANPAGE(scheduler "")
693
694#ADD_EXECUTABLE(skypeclient src/skypeclient.cc)
695#TARGET_LINK_LIBRARIES(skypeclient ${FACT++LIBS})
696#MANPAGE(skypeclient "")
697
698ADD_EXECUTABLE(sqmctrl src/sqmctrl.cc)
699TARGET_LINK_LIBRARIES(sqmctrl ${FACT++LIBS})
700MANPAGE(sqmctrl "")
701
702ADD_EXECUTABLE(smartfact src/smartfact.cc)
703TARGET_LINK_LIBRARIES(smartfact ${FACT++LIBS}) # HAVE_NOVA
704MANPAGE(smartfact "")
705
706ADD_EXECUTABLE(temperature src/temperature.cc)
707TARGET_LINK_LIBRARIES(temperature ${FACT++LIBS})
708MANPAGE(temperature "")
709
710ADD_EXECUTABLE(timecheck src/timecheck.cc)
711TARGET_LINK_LIBRARIES(timecheck ${FACT++LIBS})
712MANPAGE(timecheck "")
713
714ADD_EXECUTABLE(tngweather src/tngweather.cc)
715TARGET_LINK_LIBRARIES(tngweather ${FACT++LIBS} Qt4::QtXml)
716MANPAGE(tngweather "")
717
718#ADD_EXECUTABLE(triggerschedule src/triggerschedule.cc)
719#TARGET_LINK_LIBRARIES(triggerschedule ${FACT++LIBS})
720#MANPAGE(triggerschedule "")
721
722
723
724# ********************************************************
725# ****************** GUI Applications ********************
726# ********************************************************
727
728INCLUDE_DIRECTORIES(/usr/include/qwt-qt4 gui gui/RawEventsViewer)
729FILE(WRITE ${CMAKE_BINARY_DIR}/design.h "#include \"ui_design.h\"")
730FILE(WRITE ${CMAKE_BINARY_DIR}/viewer.h "#include \"ui_viewer.h\"")
731
732# --------------------------------------------------------
733
734QT4_WRAP_UI(VIEWER_QT_HEADERS gui/RawEventsViewer/viewer.ui)
735
736QT4_WRAP_CPP(VIEWER_QT_SOURCES
737        gui/RawEventsViewer/RawEventsViewer.h
738        gui/BasicGlCamera.h
739        gui/QCameraWidget.h
740        gui/Q3DCameraWidget.h)
741
742ADD_EXECUTABLE(viewer
743        gui/RawEventsViewer/RawEventsViewer.cc
744        gui/BasicGlCamera.cc
745        gui/QCameraWidget.cc
746        gui/Q3DCameraWidget.cc
747        ${VIEWER_QT_HEADERS}
748        ${VIEWER_QT_SOURCES})
749
750TARGET_LINK_LIBRARIES(viewer
751        ${Boost_LIBRARIES} Configuration mysqlpp
752        Qt4::QtGui Qt4::QtOpenGL
753        ${OPENGL_LIBRARIES} # OpenGL::GL OpenGL::GLU
754        qwt-qt4 ZLIB::ZLIB)
755
756# --------------------------------------------------------
757
758QT4_ADD_RESOURCES(FACT_QT_RESOURCES gui/design.qrc)
759
760QT4_WRAP_UI(FACT_QT_HEADERS gui/design.ui)
761
762QT4_WRAP_CPP(FACT_QT_SOURCES
763        gui/DockWindow.h
764        gui/MainWindow.h
765        gui/QCameraWidget.h
766        gui/BasicGlCamera.h)
767
768ADD_EXECUTABLE(fact gui/fact.cc
769        gui/DockWindow.cc
770        gui/MainWindow.cc
771        gui/QCameraWidget.cc
772        gui/BasicGlCamera.cc
773        gui/HtmlDelegate.cc
774        gui/CheckBoxDelegate.cc
775        src/DimNetwork.cc
776        ${FACT_QT_HEADERS}
777        ${FACT_QT_SOURCES}
778        ${FACT_QT_RESOURCES})
779
780TARGET_LINK_LIBRARIES(fact
781        ${FACT++LIBS}
782        ${ROOT_LIBRARIES}
783        Qt4::QtGui Qt4::QtOpenGL Qt4::QtSql
784        ${OPENGL_LIBRARIES} # OpenGL::GL OpenGL::GLU
785        qwt-qt4 ZLIB::ZLIB)
786
787
788#dclient5_SOURCES = src/dclient5.cc src/LocalControl.h
789#dclient5_LDADD   = libDim++.la libDim.la libStateMachine.la libTime.la libTools.la \
790#    libConfiguration.la
791
792#argv_SOURCES = src/argv.cc
793#argv_LDADD = libConfiguration.la
794
795#time_SOURCES = src/time.cc
796#time_LDADD = libTime.la
797
798#test_SOURCES = src/test.cc
799#test_LDADD = libStateMachine.la libTools.la libTime.la libDim++.la libDim.la libConfiguration.la
800
801ENDIF(NOT TOOLS_ONLY)
802
803
804# ********************************************************
805# ********************** FAMOUS **************************
806# ********************************************************
807
808IF(FOUND_FAMOUS)
809        INCLUDE_DIRECTORIES(famous/ui)
810        INCLUDE_DIRECTORIES(famous/src)
811
812        ADD_EXECUTABLE(famousbias famous/src/biasctrl.cc)
813        TARGET_LINK_LIBRARIES(famousbias ${FACT++LIBS})
814        MANPAGE(famousbias "")
815
816        ADD_EXECUTABLE(famousui famous/ui/famousui.cc)
817        TARGET_LINK_LIBRARIES(famousui ${FACT++LIBS})
818        MANPAGE(famousui "")
819
820        ADD_EXECUTABLE(ftuctrl famous/src/ftuctrl.cc)
821        TARGET_LINK_LIBRARIES(ftuctrl ${FACT++LIBS})
822        MANPAGE(ftuctrl "")
823
824        ADD_EXECUTABLE(miniftmctrl famous/src/miniftmctrl.cc)
825        TARGET_LINK_LIBRARIES(miniftmctrl ${FACT++LIBS})
826        MANPAGE(miniftmctrl "")
827
828        ADD_EXECUTABLE(fpgaftmctrl famous/src/fpgaftmctrl.cc)
829        TARGET_LINK_LIBRARIES(fpgaftmctrl ${FACT++LIBS})
830        MANPAGE(fpgaftmctrl "")
831
832        ADD_EXECUTABLE(famousrate famous/src/ratecontrol.cc)
833        TARGET_LINK_LIBRARIES(famousrate ${FACT++LIBS})
834        MANPAGE(famousrate "")
835ENDIF()
836
837
838
839# ********************************************************
840# ********************** IceACT **************************
841# ********************************************************
842
843IF(FOUND_ICEACT)
844        ADD_EXECUTABLE(iceactpsu iceact/src/psuctrl.cc)
845        TARGET_LINK_LIBRARIES(iceactpsu ${FACT++LIBS})
846        MANPAGE(iceactpsu "")
847
848        ADD_EXECUTABLE(tmonctrl iceact/src/tmonctrl.cc)
849        TARGET_LINK_LIBRARIES(tmonctrl ${FACT++LIBS})
850        MANPAGE(tmonctrl "")
851ENDIF()
852
853
854# *********************************
855# ********** Installation *********
856# *********************************
857
858# ======== Setup directories ======
859
860# MESSAGE("")
861# MESSAGE("PREFIX:         "${CMAKE_INSTALL_PREFIX})
862# MESSAGE("")
863# MESSAGE("BINDIR:         "${CMAKE_INSTALL_FULL_BINDIR})
864# MESSAGE("SBINDIR:        "${CMAKE_INSTALL_FULL_SBINDIR})
865# MESSAGE("LIBEXECDIR:     "${CMAKE_INSTALL_FULL_LIBEXECDIR})
866# MESSAGE("SHAREDSTATEDIR: "${CMAKE_INSTALL_FULL_SHAREDSTATEDIR})
867# MESSAGE("LOCALSTATEDIR:  "${CMAKE_INSTALL_FULL_LOCALSTATEDIR})
868# MESSAGE("RUNSTATEDIR:    "${CMAKE_INSTALL_FULL_RUNSTATEDIR})
869# MESSAGE("LIBDIR:         "${CMAKE_INSTALL_FULL_LIBDIR})
870# MESSAGE("INCLUDEDIR:     "${CMAKE_INSTALL_FULL_INCLUDEDIR})
871# MESSAGE("DATAROOTDIR:    "${CMAKE_INSTALL_FULL_DATAROOTDIR})
872# MESSAGE("DATADIR:        "${CMAKE_INSTALL_FULL_DATADIR})
873# MESSAGE("INFODIR:        "${CMAKE_INSTALL_FULL_INFODIR})
874# MESSAGE("LOCALDIR:       "${CMAKE_INSTALL_FULL_LOCALDIR})
875# MESSAGE("MANDIR:         "${CMAKE_INSTALL_FULL_MANDIR})
876# MESSAGE("DOCDIR:         "${CMAKE_INSTALL_FULL_DOCDIR})
877# MESSAGE("")
878# MESSAGE("BINDIR:         "${CMAKE_INSTALL_BINDIR})
879# MESSAGE("SBINDIR:        "${CMAKE_INSTALL_SBINDIR})
880# MESSAGE("LIBEXECDIR:     "${CMAKE_INSTALL_LIBEXECDIR})
881# MESSAGE("SHAREDSTATEDIR: "${CMAKE_INSTALL_SHAREDSTATEDIR})
882# MESSAGE("LOCALSTATEDIR:  "${CMAKE_INSTALL_LOCALSTATEDIR})
883# MESSAGE("RUNSTATEDIR:    "${CMAKE_INSTALL_RUNSTATEDIR})
884# MESSAGE("LIBDIR:         "${CMAKE_INSTALL_LIBDIR})
885# MESSAGE("INCLUDEDIR:     "${CMAKE_INSTALL_INCLUDEDIR})
886# MESSAGE("DATAROOTDIR:    "${CMAKE_INSTALL_DATAROOTDIR})
887# MESSAGE("DATADIR:        "${CMAKE_INSTALL_DATADIR})
888# MESSAGE("INFODIR:        "${CMAKE_INSTALL_INFODIR})
889# MESSAGE("LOCALDIR:       "${CMAKE_INSTALL_LOCALDIR})
890# MESSAGE("MANDIR:         "${CMAKE_INSTALL_MANDIR})
891# MESSAGE("DOCDIR:         "${CMAKE_INSTALL_DOCDIR})
892# MESSAGE("")
893
894SET(PKG_SHARE    "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}")
895SET(PKG_APPS     "${CMAKE_INSTALL_DATAROOTDIR}/applications")
896SET(PKG_PIXMAPS  "${CMAKE_INSTALL_DATAROOTDIR}/pixmaps")
897
898# ====== Installation targets =====
899
900INSTALL(TARGETS  fits2sql       DESTINATION "${CMAKE_INSTALL_BINDIR}")
901INSTALL(TARGETS  root2sql       DESTINATION "${CMAKE_INSTALL_BINDIR}")
902INSTALL(TARGETS  fitsdump       DESTINATION "${CMAKE_INSTALL_BINDIR}")
903INSTALL(TARGETS  zfits          DESTINATION "${CMAKE_INSTALL_BINDIR}")
904INSTALL(TARGETS  calcsource     DESTINATION "${CMAKE_INSTALL_BINDIR}")
905INSTALL(TARGETS  showlog        DESTINATION "${CMAKE_INSTALL_BINDIR}")
906INSTALL(TARGETS  rootifysql     DESTINATION "${CMAKE_INSTALL_BINDIR}")
907INSTALL(TARGETS  Configuration  DESTINATION "${CMAKE_INSTALL_LIBDIR}")
908INSTALL(TARGETS  Time           DESTINATION "${CMAKE_INSTALL_LIBDIR}")
909INSTALL(TARGETS  Tools          DESTINATION "${CMAKE_INSTALL_LIBDIR}")
910
911#INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/html DESTINATION  "${PKG_SHARE}" FILES_MATCHING PATTERN "*.html")
912#INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/pdf  DESTINATION  "${PKG_SHARE}" FILES_MATCHING PATTERN "*.pdf")
913
914# *********************************
915# ************ Packaging **********
916# *********************************
917
918# ======== General packaging ======
919# https://cmake.org/cmake/help/latest/module/CPack.html
920
921INCLUDE(InstallRequiredSystemLibraries)
922
923# SET(CPACK_STRIP_FILES ON) # Strip debug sysmbold from files
924
925SET(CPACK_PACKAGE_VERSION       "${fact++_VERSION}")
926SET(CPACK_PACKAGE_CONTACT       "${PACKAGE_BUGREPORT}")
927SET(CPACK_PACKAGE_MAINTAINER    "${PACKAGE_MAINTAINER}")
928SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
929#SET(CPACK_PACKAGE_VENDOR "Me, myself, and I")
930
931
932SET(CPACK_SOURCE_IGNORE_FILES "/old/;/build/;/[.].*/;/autom4te[.]cache/;.*~;.log$")
933
934# Maybe the text displayed in synaptic?
935SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README")
936SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "FACT++ - Toolset")
937#CPACK_RESOURCE_FILE_README     ReadMe file to be embedded in the installer.
938
939SET(CPACK_GENERATOR        TBZ2 DEB) # TGZ
940SET(CPACK_SOURCE_GENERATOR TBZ2)     # TGZ
941#SET(CPACK_PROJECT_CONFIG_FILE ${CMAKE_SOURCE_DIR}/cmake/Package.txt)
942#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
943
944
945# ======== Debian packaging =======
946# https://cmake.org/cmake/help/latest/module/CPackDeb.html
947# https://www.debian.org/doc/debian-policy
948
949#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)")
950SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS 1) # generate better (atomatic?) dependecies
951SET(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=")
952SET(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
953SET(CPACK_DEBIAN_PACKAGE_SECTION utils)
954SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${PACKAGE_URL}")
955SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION
956"${CPACK_PACKAGE_DESCRIPTION_SUMMARY}
957 This package contains some tools which are part of FACT++ to deal with databases, fits files and root-files.")
958#indent the long description with spaces
959
960#CPACK_INSTALL_CMAKE_PROJECTS
961#List of four values that specify what project to install. Build directory, Project Name, Project Component, Directory.
962
963INCLUDE(CPack)
Note: See TracBrowser for help on using the repository browser.