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

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