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

Last change on this file since 19008 was 18993, checked in by tbretz, 7 years ago
Implemented a program to read the rain sensor data from MAGIC.
File size: 23.6 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# *********************************
54# ******** FAMOUS / IceACT ********
55# *********************************
56
57IF(EXISTS "${CMAKE_SOURCE_DIR}/famous")
58 MESSAGE(STATUS "Compilation of 'famous' enabled.")
59 SET(FOUND_FAMOUS ON)
60ENDIF()
61
62IF(EXISTS "${CMAKE_SOURCE_DIR}/iceact")
63 MESSAGE(STATUS "Compilation of 'iceact' enabled.")
64 SET(FOUND_ICEACT ON)
65ENDIF()
66
67
68
69# *********************************
70# ********* Requirements **********
71# *********************************
72
73# =========== pkg-config ============
74FIND_PACKAGE(PkgConfig)
75FIND_PACKAGE(PackageHandleStandardArgs)
76
77
78# ========== executables ==========
79FIND_PROGRAM(HELP2MAN_EXECUTABLE help2man)
80FIND_PROGRAM(JSDOC_EXECUTABLE jsdoc)
81FIND_PROGRAM(MAILX_EXECUTABLE mailx)
82FIND_PROGRAM(CURL_EXECUTABLE curl)
83FIND_PROGRAM(GROFF_EXECUTABLE groff)
84
85FIND_PACKAGE_HANDLE_STANDARD_ARGS(groff DEFAULT_MSG GROFF_EXECUTABLE)
86FIND_PACKAGE_HANDLE_STANDARD_ARGS(curl DEFAULT_MSG CURL_EXECUTABLE)
87FIND_PACKAGE_HANDLE_STANDARD_ARGS(mailx DEFAULT_MSG MAILX_EXECUTABLE)
88FIND_PACKAGE_HANDLE_STANDARD_ARGS(jsdoc DEFAULT_MSG JSDOC_EXECUTABLE)
89FIND_PACKAGE_HANDLE_STANDARD_ARGS(help2man DEFAULT_MSG HELP2MAN_EXECUTABLE)
90
91#IF(NOT SOME_COND)
92# MESSAGE(FATAL_ERROR "At least one required executable was not found")
93#ENDIF()
94
95# =========== libraries =============
96
97SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
98
99# FIXME: Need to check which package finders accept REQUIERED. For all others implement checks
100
101FIND_PACKAGE(Threads REQUIRED) # Threads::Threads
102FIND_PACKAGE(ZLIB REQUIRED) # ZLIB::ZLIB
103FIND_PACKAGE(OpenGL REQUIRED) # OpenGL::GL OpenGL::GLU / OPENGL_FOUND OPENGL_GLU_FOUND
104
105SET(CURSES_NEED_NCURSES ON)
106FIND_PACKAGE(Curses REQUIRED) # CURSES_FOUND
107# FIXME : Require panel
108
109# FIND_PACKAGE(DBus) => skaypeclient
110# FIND_PACKAGE(Motif) => did # MOTIF_FOUND
111FIND_PACKAGE(Readline REQUIRED)
112FIND_PACKAGE(Panel REQUIRED)
113FIND_PACKAGE(Nova REQUIRED)
114FIND_PACKAGE(MySQL REQUIRED)
115FIND_PACKAGE(MySQL++ REQUIRED)
116FIND_PACKAGE(V8 REQUIRED)
117FIND_PACKAGE(Cfitsio REQUIRED)
118FIND_PACKAGE(CCfits REQUIRED)
119
120#INCLUDE_DIRECTORIES("/usr/include/mysql")
121# dbus-1 dbus-glib-1
122# doxygen
123
124MESSAGE("")
125MESSAGE(${V8_LIBRARY})
126MESSAGE(${MYSQLPP_LIBRARY})
127MESSAGE(${PANEL_LIBRARY})
128MESSAGE(${CURSES_LIBRARIES})
129MESSAGE(${CCFITS_LIBRARY})
130MESSAGE(${CFITSIO_LIBRARY})
131MESSAGE(${MYSQL_LIBRARY})
132MESSAGE(${NOVA_LIBRARY})
133MESSAGE(${READLINE_LIBRARY})
134MESSAGE("")
135
136INCLUDE_DIRECTORIES(${MYSQL_INCLUDE_DIR})
137
138
139# =============== BOOST ============
140#SET(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0")
141FIND_PACKAGE(Boost 1.58.0 REQUIRED
142 date_time
143 filesystem
144 program_options
145 regex
146 system
147 thread)
148
149# =============== QT4 ==============
150SET(CMAKE_INCLUDE_CURRENT_DIR ON)
151FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtOpenGL QtSql QtXml)
152
153
154# =========== Enable C++11 ===========
155
156SET(CMAKE_CXX_STANDARD 11)
157SET(CMAKE_C_FLAGS "-pedantic")
158
159SET(CMAKE_CXX_FLAGS
160 "${CMAKE_CXX_FLAGS} -Wall -Winit-self -Wpointer-arith \
161 -Wcast-align -Wformat=2 -Woverloaded-virtual \
162 -Wnon-virtual-dtor -Wshadow") # -Wextra
163
164# FIXME: Move that to config.h.in
165# -D__MARS__
166SET(CMAKE_CXX_FLAGS
167 "${CMAKE_CXX_FLAGS} \
168 -D_REENTRANT -D__LINUX__ \
169 -DHAVE_ZLIB -DHAVE_ROOT -DHAVE_V8 -DHAVE_SQL -DHAVE_NOVA -DHAVE_FITS \
170 -DMARSVER=\\\"${VERSION}\\\" \
171 -DPACKAGE_VERSION=\\\"${VERSION}\\\" \
172 -DREVISION=\\\"${REVISION}\\\" \
173 -DPACKAGE_NAME=\\\"FACT++\\\" \
174 -DPACKAGE_STRING=\\\"FACT++\\\" \
175 -DPACKAGE_URL=\\\"${PACKAGE_URL}\\\" \
176 -DPACKAGE_BUGREPORT=\\\"${PACKAGE_BUGREPORT}\\\""
177 )
178
179# -DBOOST_DISABLE_ASSERTS \
180# -DBOOST_NO_STD_LOCALE=1 \
181# -DBOOST_REXEG_NO_FWD=1 \
182# -DBOOST_NO_MEMBER_TEMPLATES=1 \
183# -DBOOST_HAS_ABI_HEADERS=1 \
184
185# Flags required for Dim
186SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMIPSEL -DPROTOCOL=1 -Dunix -Dlinux")
187
188# --------- config.h -------------
189
190#CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/config.h.in" "${PROJECT_BINARY_DIR}/config.h")
191#INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
192
193SET(CMAKE_MODULE_PATH $ENV{ROOTSYS}/etc/cmake ${CMAKE_MODULE_PATH})
194
195# You need to tell CMake where to find the ROOT installation. This can be done in a number of ways:
196# - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake
197# - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT
198#LIST(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
199
200#---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS)
201
202# -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree
203# -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread
204# -lASImage -lMinuit -lHistPainter -lThread
205
206FIND_PACKAGE(ROOT REQUIRED COMPONENTS GQt)
207INCLUDE_DIRECTORIES(${ROOT_INCLUDE_DIRS})
208
209
210#MESSAGE("INCL_DIRS: ${ROOT_INCLUDE_DIRS}")
211#MESSAGE("LIBS: ${ROOT_LIBRARIES}")
212#MESSAGE("DEFS: ${ROOT_DEFINITIONS}")
213#MESSAGE("CXXFLAGS: ${ROOT_CXX_FLAGS}")
214#MESSAGE("CXFLAGS: ${ROOT_CC_FLAGS}")
215#MESSAGE("FOUND: ${ROOT_FOUND}")
216#MESSAGE("FILE: ${ROOT_USE_FILE}")
217#MESSAGE("DIR: ${CMAKE_CURRENT_SOURCE_DIR}")
218#ROOT_<library>_LIBRARY PATH Full path for each of the ROOT libraries listed in COMPONENTS
219#ROOT_<command>_CMD PATH Full path for each ROOT executable (rootcling, root, hadd, etc.)
220#ROOT_<option>_FOUND BOOL True for each enabled build option (e.g. cocoa, python, xrootd, etc.)
221
222MESSAGE(${ROOT_LIBRARIES})
223
224
225# -------------------------------------------------------
226
227INCLUDE_DIRECTORIES(pal)
228INCLUDE_DIRECTORIES(erfa/src)
229INCLUDE_DIRECTORIES(dim/dim)
230INCLUDE_DIRECTORIES(externals)
231INCLUDE_DIRECTORIES(src)
232
233# ********************************************************
234# ********************** Libraries ***********************
235# ********************************************************
236
237# =================== libPointing.so ======================
238ADD_LIBRARY(Pointing SHARED
239 pal/pal.h
240 pal/palDtt.c pal/palDat.c pal/palMappa.c
241 pal/palPrenut.c pal/palEvp.c pal/palAoppa.c
242 pal/palAoppat.c pal/palRefco.c pal/palRefro.c
243 pal/pal1Atmt.c pal/palDrange.c pal/palOne2One.c
244 pal/pal1Atms.c pal/palMapqkz.c pal/palAopqk.c
245 pal/palRefz.c pal/palAmpqk.c pal/palRdplan.c
246 pal/palDt.c pal/palPvobs.c pal/palNut.c
247 pal/palDmoon.c pal/palPlanet.c pal/palNutc.c
248 pal/palDeuler.c
249 erfa/src/gd2gc.c erfa/src/p06e.c erfa/src/c2s.c
250 erfa/src/eform.c erfa/src/s2c.c erfa/src/pas.c
251 erfa/src/pmat06.c erfa/src/epv00.c erfa/src/plan94.c
252 erfa/src/anpm.c erfa/src/obl06.c erfa/src/dat.c
253 erfa/src/af2a.c erfa/src/rxr.c erfa/src/gmst06.c
254 erfa/src/sepp.c erfa/src/rz.c erfa/src/zp.c
255 erfa/src/rxpv.c erfa/src/pn.c erfa/src/cr.c
256 erfa/src/seps.c erfa/src/ry.c erfa/src/pdp.c
257 erfa/src/pnm06a.c erfa/src/hfk5z.c erfa/src/epj2jd.c
258 erfa/src/pv2s.c erfa/src/tf2a.c erfa/src/pm.c
259 erfa/src/sxp.c erfa/src/a2af.c erfa/src/rxp.c
260 erfa/src/pxp.c erfa/src/fk5hip.c erfa/src/fw2m.c
261 erfa/src/rx.c erfa/src/tf2d.c erfa/src/cal2jd.c
262 erfa/src/cp.c erfa/src/nut06a.c erfa/src/rm2v.c
263 erfa/src/nut00a.c erfa/src/ee06a.c erfa/src/fk5hz.c
264 erfa/src/epb2jd.c erfa/src/refco.c erfa/src/a2tf.c
265 erfa/src/fapa03.c erfa/src/gst06a.c erfa/src/faf03.c
266 erfa/src/faur03.c erfa/src/faju03.c erfa/src/fal03.c
267 erfa/src/fasa03.c erfa/src/fame03.c erfa/src/fave03.c
268 erfa/src/fama03.c erfa/src/faom03.c erfa/src/gst06.c
269 erfa/src/jd2cal.c erfa/src/gd2gce.c erfa/src/anp.c
270 erfa/src/fae03.c erfa/src/ir.c erfa/src/pfw06.c
271 erfa/src/bpn2xy.c erfa/src/eors.c erfa/src/s06.c
272 erfa/src/trxp.c erfa/src/era00.c erfa/src/epj.c
273 erfa/src/d2tf.c erfa/src/epb.c erfa/src/rv2m.c
274 erfa/src/pap.c erfa/src/fad03.c erfa/src/pmp.c
275 erfa/src/tr.c erfa/src/falp03.c)
276
277# ======================= libDim.so ======================
278ADD_LIBRARY(Dim SHARED
279# dim/dim/dic.h
280# dim/dim/dim_common.h
281# dim/dim/dim.h
282# dim/dim/dim_tcpip.h
283# dim/dim/dis.h
284 dim/src/dic.c
285 dim/src/dis.c
286 dim/src/dna.c
287 dim/src/sll.c
288 dim/src/dll.c
289 dim/src/hash.c
290 dim/src/swap.c
291 dim/src/copy_swap.c
292 dim/src/open_dns.c
293 dim/src/conn_handler.c
294 dim/src/tcpip.c
295 dim/src/dtq.c
296 dim/src/dim_thr.c
297 dim/src/utilities.c)
298
299# ================= libDimExtension.so ===================
300ADD_LIBRARY(DimExtension SHARED
301# src/DimSetup.h
302 src/DimSetup.cc)
303
304# ===================== libDim++.so ======================
305ADD_LIBRARY(Dim++ SHARED
306# dim/dim/dic.hxx
307# dim/dim/dis.hxx
308# dim/dim/dim_core.hxx
309# dim/dim/dim.hxx
310# dim/dim/dim_tcpip.h
311# dim/dim/dllist.hxx
312# dim/dim/sllist.hxx
313# dim/dim/tokenstring.hxx
314# src/Dim.h
315 dim/src/diccpp.cxx
316 dim/src/dimcpp.cxx
317 dim/src/discpp.cxx
318 dim/src/tokenstring.cxx)
319
320# ================= libStateMachine.so ===================
321ADD_LIBRARY(StateMachine SHARED
322 src/WindowLog.h src/WindowLog.cc
323 src/Readline.h src/Readline.cc
324 src/ReadlineColor.h src/ReadlineColor.cc
325 src/ReadlineWindow.h src/ReadlineWindow.cc
326 src/Console.h src/Console.cc
327 src/Shell.h src/Shell.cc
328 src/EventImp.h src/EventImp.cc
329 src/Event.h src/Event.cc
330 src/State.h src/State.cc
331 src/Description.h src/Description.cc
332 src/MessageImp.h src/MessageImp.cc
333 src/Converter.h src/Converter.cc
334 src/StateMachineImp.h src/StateMachineImp.cc
335 src/StateMachine.h src/StateMachine.cc
336 src/EventDim.h
337 src/MessageDim.h src/MessageDim.cc
338 src/StateMachineDim.h src/StateMachineDim.cc
339 src/DimServerList.h src/DimServerList.cc
340 src/DimServiceInfoList.h src/DimServiceInfoList.cc
341# src/DimNetworkList.h src/DimNetwork.cc
342 src/ServiceList.h src/ServiceList.cc
343 src/DimErrorRedirecter.h
344 src/DimErrorRedirecter.cc
345 src/DimDescriptionService.h
346 src/DimDescriptionService.cc
347 src/Connection.h src/Connection.cc
348 src/ConnectionUSB.h src/ConnectionUSB.cc
349# FACT.h ByteOrder.h
350 src/DimWriteStatistics.h src/DimWriteStatistics.cc)
351
352# ================= libConfiguration.so ==================
353ADD_LIBRARY(Configuration SHARED
354 src/Configuration.h src/Configuration.cc
355 src/FACT.h src/FACT.cc)
356TARGET_LINK_LIBRARIES(Configuration
357 Boost::regex
358 Boost::system
359 Boost::filesystem
360 Boost::program_options)
361
362# ===================== libTime.so =======================
363ADD_LIBRARY(Time SHARED
364 src/Time.h src/Time.cc)
365#TARGET_LINK_LIBRARIES(Time)# ${NOVA_LIBRARY})
366
367# ===================== libTools.so ======================
368ADD_LIBRARY(Tools SHARED
369 src/tools.h src/tools.cc)
370
371
372
373# ********************************************************
374# ********************** Manuals *************************
375# ********************************************************
376
377FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/man1)
378FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/html)
379FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/pdf)
380
381MACRO(MANPAGE program description)
382# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
383 ADD_CUSTOM_COMMAND(
384 OUTPUT
385 man1/${program}.1
386 DEPENDS
387 ${program}
388 COMMAND
389 ${HELP2MAN_EXECUTABLE}
390 ${PROJECT_BINARY_DIR}/${program}
391 -n "${description}"
392 --no-info
393 --output=man1/${program}.1
394 COMMAND
395 ${GROFF_EXECUTABLE}
396 -mandoc man1/${program}.1
397 -T html > html/${program}.html
398 COMMAND
399 ${GROFF_EXECUTABLE}
400 -mandoc man1/${program}.1
401 -T pdf > pdf/${program}.pdf
402 COMMENT
403 "Generating man-page ${program}.1"
404 VERBATIM)
405
406 ADD_CUSTOM_TARGET(${program}.man ALL DEPENDS man1/${program}.1)
407
408# INSTALL(FILES ${PROJECT_BINARY_DIR}/${program}.1 DESTINATION "${PKG_MAN}")
409
410ENDMACRO()
411
412
413
414
415# ********************************************************
416# *********************** Helpers ************************
417# ********************************************************
418
419SET(HELP++LIBS Tools Configuration Time mysqlpp ${MYSQL_LIBRARIES})
420
421# --------------------------------------------------------
422
423ADD_EXECUTABLE(fitsdump src/fitsdump.cc)
424TARGET_LINK_LIBRARIES(fitsdump ${HELP++LIBS} ${ROOT_LIBRARIES} ZLIB::ZLIB)
425MANPAGE(fitsdump "")
426
427#ADD_EXECUTABLE(fitsloader src/fitsloader.cc)
428#TARGET_LINK_LIBRARIES(fitsloader ${HELP++LIBS})
429#MANPAGE(fitsloader "")
430
431#ADD_EXECUTABLE(fitscheck src/fitscheck.cc)
432#TARGET_LINK_LIBRARIES(fitscheck ${HELP++LIBS} ZLIB::ZLIB)
433#MANPAGE(fitscheck "")
434
435#ADD_EXECUTABLE(fitsCompressor src/fitsCompressor.cc)
436#TARGET_LINK_LIBRARIES(fitsCompressor ${HELP++LIBS} ZLIB::ZLIB)
437#MANPAGE(fitsCompressor "")
438
439#ADD_EXECUTABLE(fitsselect src/fitsselect.cc)
440#TARGET_LINK_LIBRARIES(fitsselect ${HELP++LIBS} ZLIB::ZLIB)
441#MANPAGE(fitsselect "")
442
443ADD_EXECUTABLE(getevent src/getevent.cc)
444TARGET_LINK_LIBRARIES(getevent ${HELP++LIBS} ZLIB::ZLIB)
445MANPAGE(getevent "")
446
447#ADD_EXECUTABLE(readfits src/readfits.cc)
448#TARGET_LINK_LIBRARIES(readfits ${HELP++LIBS} ZLIB::ZLIB)
449#MANPAGE(readfits "")
450
451ADD_EXECUTABLE(rootifysql src/rootifysql.cc)
452TARGET_LINK_LIBRARIES(rootifysql ${HELP++LIBS} ${ROOT_LIBRARIES})
453MANPAGE(rootifysql "")
454
455ADD_EXECUTABLE(root2sql src/root2sql.cc)
456TARGET_LINK_LIBRARIES(root2sql ${HELP++LIBS} ${ROOT_LIBRARIES})
457MANPAGE(root2sql "")
458
459#ADD_EXECUTABLE(calcsource src/calcsource.cc)
460#TARGET_LINK_LIBRARIES(calcsource ${HELP++LIBS} ${ROOT_LIBRARIES} ${NOVA_LIBRARY} Pointing)
461
462ADD_EXECUTABLE(makeplots src/makeplots.cc)
463TARGET_LINK_LIBRARIES(makeplots ${HELP++LIBS} ${ROOT_LIBRARIES} ${NOVA_LIBRARY})
464MANPAGE(makeplots "")
465
466ADD_EXECUTABLE(makedata src/makedata.cc)
467TARGET_LINK_LIBRARIES(makedata ${HELP++LIBS} ${NOVA_LIBRARY})
468MANPAGE(makedata "")
469
470ADD_EXECUTABLE(makeschedule src/makeschedule.cc)
471TARGET_LINK_LIBRARIES(makeschedule ${HELP++LIBS} ${NOVA_LIBRARY})
472MANPAGE(makeschedule "")
473
474ADD_EXECUTABLE(showlog src/showlog.cc src/WindowLog.cc)
475TARGET_LINK_LIBRARIES(showlog Threads::Threads ${HELP++LIBS} ${CURSES_LIBRARIES})
476MANPAGE(showlog "")
477
478ADD_EXECUTABLE(zfits src/zfits.cc)
479TARGET_LINK_LIBRARIES(zfits ${HELP++LIBS} ZLIB::ZLIB)
480MANPAGE(zfits "")
481
482
483
484# ********************************************************
485# ********************* Operation ************************
486# ********************************************************
487
488SET(FACT++LIBS
489 StateMachine Tools Configuration Time Dim++ Dim DimExtension
490 mysqlpp readline ${CURSES_LIBRARIES} panel Boost::thread) # HAVE_SQL
491
492# --------------------------------------------------------
493
494ADD_EXECUTABLE(agilentctrl src/agilentctrl.cc)
495TARGET_LINK_LIBRARIES(agilentctrl ${FACT++LIBS})
496MANPAGE(agilentctrl "")
497
498ADD_EXECUTABLE(biasctrl src/biasctrl.cc)
499TARGET_LINK_LIBRARIES(biasctrl ${FACT++LIBS})
500MANPAGE(biasctrl "")
501
502ADD_EXECUTABLE(biastemp src/biastemp.cc)
503TARGET_LINK_LIBRARIES(biastemp ${FACT++LIBS})
504MANPAGE(biastemp "")
505
506ADD_EXECUTABLE(chatserv src/chatserv.cc)
507TARGET_LINK_LIBRARIES(chatserv ${FACT++LIBS}) # does not require libpanel
508MANPAGE(chatserv "")
509
510ADD_EXECUTABLE(chatclient src/chatclient.cc)
511TARGET_LINK_LIBRARIES(chatclient ${FACT++LIBS}) # does not require libpanel
512MANPAGE(chatclient "")
513
514#ADD_EXECUTABLE(cosyctrl src/cosyctrl.cc)# src/LocalControl.h
515#TARGET_LINK_LIBRARIES(cosyctrl
516# StateMachine Tools Configuration Time Dim++ Dim DimExtension
517# ${Boost_LIBRARIES} readline ${CURSES_LIBRARIES})
518
519ADD_EXECUTABLE(datalogger src/datalogger.cc
520 src/DimState.cc
521 src/FitsFile.cc src/Fits.cc)
522TARGET_LINK_LIBRARIES(datalogger ${FACT++LIBS} cfitsio CCfits)
523MANPAGE(datalogger "")
524
525ADD_EXECUTABLE(dimctrl src/dimctrl.cc
526 src/StateMachineDimControl.cc
527 src/RemoteControl.cc
528 src/InterpreterV8.cc
529 src/DimState.cc)
530TARGET_LINK_LIBRARIES(dimctrl ${FACT++LIBS} ${NOVA_LIBRARY} Pointing ZLIB::ZLIB v8)
531MANPAGE(dimctrl "")
532
533ADD_CUSTOM_TARGET(dimserver ALL
534 COMMAND ln -sf dimctrl dimserver
535 COMMENT "Creating symlink for dimserver"
536 DEPENDS dimctrl)
537
538ADD_EXECUTABLE(drivectrl src/drivectrl.cc)
539TARGET_LINK_LIBRARIES(drivectrl ${FACT++LIBS} ${NOVA_LIBRARY} Pointing)
540MANPAGE(drivectrl "")
541
542ADD_EXECUTABLE(evtserver src/evtserver.cc)
543TARGET_LINK_LIBRARIES(evtserver ${FACT++LIBS} ${NOVA_LIBRARY} ZLIB::ZLIB)
544MANPAGE(evtserver "")
545
546ADD_EXECUTABLE(fadctrl src/fadctrl.cc src/HeadersFAD.cc
547 src/EventBuilder.cc
548 src/FitsFile.cc
549 src/DataCalib.cc
550 src/DataWriteRaw.cc
551 src/DataWriteFits.cc
552 src/DataWriteFits2.cc
553 src/DataProcessorImp.cc)
554TARGET_LINK_LIBRARIES(fadctrl ${FACT++LIBS} cfitsio CCfits ZLIB::ZLIB)
555MANPAGE(fadctrl "")
556
557ADD_EXECUTABLE(feedback src/feedback.cc)
558TARGET_LINK_LIBRARIES(feedback ${FACT++LIBS})
559MANPAGE(feedback "")
560
561ADD_EXECUTABLE(fscctrl src/fscctrl.cc src/HeadersFTM.cc)
562TARGET_LINK_LIBRARIES(fscctrl ${FACT++LIBS})
563MANPAGE(fscctrl "")
564
565ADD_EXECUTABLE(ftmctrl src/ftmctrl.cc src/HeadersFTM.cc)
566TARGET_LINK_LIBRARIES(ftmctrl ${FACT++LIBS})
567MANPAGE(ftmctrl "")
568
569ADD_EXECUTABLE(gcn src/gcn.cc)
570TARGET_LINK_LIBRARIES(gcn ${FACT++LIBS} ${NOVA_LIBRARY} Qt4::QtXml)
571MANPAGE(gcn "")
572
573ADD_EXECUTABLE(gpsctrl src/gpsctrl.cc)
574TARGET_LINK_LIBRARIES(gpsctrl ${FACT++LIBS})
575MANPAGE(gpsctrl "")
576
577ADD_EXECUTABLE(lidctrl src/lidctrl.cc)
578TARGET_LINK_LIBRARIES(lidctrl ${FACT++LIBS} Qt4::QtXml)
579MANPAGE(lidctrl "")
580
581ADD_EXECUTABLE(magiclidar src/magiclidar.cc)
582TARGET_LINK_LIBRARIES(magiclidar ${FACT++LIBS})
583MANPAGE(magiclidar "")
584
585ADD_EXECUTABLE(magicweather src/magicweather.cc)
586TARGET_LINK_LIBRARIES(magicweather ${FACT++LIBS})
587MANPAGE(magicweather "")
588
589ADD_EXECUTABLE(mcp src/mcp.cc)
590TARGET_LINK_LIBRARIES(mcp ${FACT++LIBS})
591MANPAGE(mcp "")
592
593ADD_EXECUTABLE(pfminictrl src/pfminictrl.cc)
594TARGET_LINK_LIBRARIES(pfminictrl ${FACT++LIBS})
595MANPAGE(pfminictrl "")
596
597ADD_EXECUTABLE(pwrctrl src/pwrctrl.cc src/HeadersPower.cc)
598TARGET_LINK_LIBRARIES(pwrctrl ${FACT++LIBS} Qt4::QtXml)
599MANPAGE(pwrctrl "")
600
601ADD_EXECUTABLE(rainsensor src/rainsensor.cc)
602TARGET_LINK_LIBRARIES(rainsensor ${FACT++LIBS})
603MANPAGE(rainsensor "")
604
605ADD_EXECUTABLE(ratecontrol src/ratecontrol.cc)
606TARGET_LINK_LIBRARIES(ratecontrol ${FACT++LIBS})
607MANPAGE(ratecontrol "")
608
609ADD_EXECUTABLE(ratescan src/ratescan.cc)
610TARGET_LINK_LIBRARIES(ratescan ${FACT++LIBS})
611MANPAGE(ratescan "")
612
613#ADD_EXECUTABLE(scheduler src/scheduler.cc)
614#TARGET_LINK_LIBRARIES(scheduler ${FACT++LIBS})
615#MANPAGE(scheduler "")
616
617#ADD_EXECUTABLE(skypeclient src/skypeclient.cc)
618#TARGET_LINK_LIBRARIES(skypeclient ${FACT++LIBS})
619#MANPAGE(skypeclient "")
620
621ADD_EXECUTABLE(sqmctrl src/sqmctrl.cc)
622TARGET_LINK_LIBRARIES(sqmctrl ${FACT++LIBS})
623MANPAGE(sqmctrl "")
624
625ADD_EXECUTABLE(smartfact src/smartfact.cc)
626TARGET_LINK_LIBRARIES(smartfact ${FACT++LIBS} ${NOVA_LIBRARY}) # HAVE_NOVA
627MANPAGE(smartfact "")
628
629ADD_EXECUTABLE(temperature src/temperature.cc)
630TARGET_LINK_LIBRARIES(temperature ${FACT++LIBS})
631MANPAGE(temperature "")
632
633ADD_EXECUTABLE(timecheck src/timecheck.cc)
634TARGET_LINK_LIBRARIES(timecheck ${FACT++LIBS})
635MANPAGE(timecheck "")
636
637ADD_EXECUTABLE(tngweather src/tngweather.cc)
638TARGET_LINK_LIBRARIES(tngweather ${FACT++LIBS} Qt4::QtXml)
639MANPAGE(tngweather "")
640
641#ADD_EXECUTABLE(triggerschedule src/triggerschedule.cc)
642#TARGET_LINK_LIBRARIES(triggerschedule ${FACT++LIBS})
643#MANPAGE(triggerschedule "")
644
645
646
647# ********************************************************
648# ****************** GUI Applications ********************
649# ********************************************************
650
651INCLUDE_DIRECTORIES(/usr/include/qwt-qt4 gui gui/RawEventsViewer)
652FILE(WRITE ${CMAKE_BINARY_DIR}/design.h "#include \"ui_design.h\"")
653FILE(WRITE ${CMAKE_BINARY_DIR}/viewer.h "#include \"ui_viewer.h\"")
654
655# --------------------------------------------------------
656
657QT4_WRAP_UI(VIEWER_QT_HEADERS gui/RawEventsViewer/viewer.ui)
658
659QT4_WRAP_CPP(VIEWER_QT_SOURCES
660 gui/RawEventsViewer/RawEventsViewer.h
661 gui/BasicGlCamera.h
662 gui/QCameraWidget.h
663 gui/Q3DCameraWidget.h)
664
665ADD_EXECUTABLE(viewer
666 gui/RawEventsViewer/RawEventsViewer.cc
667 gui/BasicGlCamera.cc
668 gui/QCameraWidget.cc
669 gui/Q3DCameraWidget.cc
670 ${VIEWER_QT_HEADERS}
671 ${VIEWER_QT_SOURCES})
672
673TARGET_LINK_LIBRARIES(viewer
674 ${Boost_LIBRARIES} Configuration mysqlpp
675 Qt4::QtGui Qt4::QtOpenGL
676 ${OPENGL_LIBRARIES} # OpenGL::GL OpenGL::GLU
677 qwt-qt4 ZLIB::ZLIB)
678
679# --------------------------------------------------------
680
681QT4_ADD_RESOURCES(FACT_QT_RESOURCES gui/design.qrc)
682
683QT4_WRAP_UI(FACT_QT_HEADERS gui/design.ui)
684
685QT4_WRAP_CPP(FACT_QT_SOURCES
686 gui/DockWindow.h
687 gui/MainWindow.h
688 gui/QCameraWidget.h
689 gui/BasicGlCamera.h)
690
691ADD_EXECUTABLE(fact gui/fact.cc
692 gui/DockWindow.cc
693 gui/MainWindow.cc
694 gui/QCameraWidget.cc
695 gui/BasicGlCamera.cc
696 gui/HtmlDelegate.cc
697 gui/CheckBoxDelegate.cc
698 src/DimNetwork.cc
699 ${FACT_QT_HEADERS}
700 ${FACT_QT_SOURCES}
701 ${FACT_QT_RESOURCES})
702
703TARGET_LINK_LIBRARIES(fact
704 ${FACT++LIBS}
705 ${ROOT_LIBRARIES}
706 Qt4::QtGui Qt4::QtOpenGL Qt4::QtSql
707 ${OPENGL_LIBRARIES} # OpenGL::GL OpenGL::GLU
708 qwt-qt4 ZLIB::ZLIB)
709
710
711#dclient5_SOURCES = src/dclient5.cc src/LocalControl.h
712#dclient5_LDADD = libDim++.la libDim.la libStateMachine.la libTime.la libTools.la \
713# libConfiguration.la
714
715#argv_SOURCES = src/argv.cc
716#argv_LDADD = libConfiguration.la
717
718#time_SOURCES = src/time.cc
719#time_LDADD = libTime.la
720
721#test_SOURCES = src/test.cc
722#test_LDADD = libStateMachine.la libTools.la libTime.la libDim++.la libDim.la libConfiguration.la
723
724
725
726
727# ********************************************************
728# ********************** FAMOUS **************************
729# ********************************************************
730
731IF(FOUND_FAMOUS)
732 INCLUDE_DIRECTORIES(famous/ui)
733 INCLUDE_DIRECTORIES(famous/src)
734
735 ADD_EXECUTABLE(famousbias famous/src/biasctrl.cc)
736 TARGET_LINK_LIBRARIES(famousbias ${FACT++LIBS})
737 MANPAGE(famousbias "")
738
739 ADD_EXECUTABLE(famousui famous/ui/famousui.cc)
740 TARGET_LINK_LIBRARIES(famousui ${FACT++LIBS})
741 MANPAGE(famousui "")
742
743 ADD_EXECUTABLE(ftuctrl famous/src/ftuctrl.cc)
744 TARGET_LINK_LIBRARIES(ftuctrl ${FACT++LIBS})
745 MANPAGE(ftuctrl "")
746
747 ADD_EXECUTABLE(miniftmctrl famous/src/miniftmctrl.cc)
748 TARGET_LINK_LIBRARIES(miniftmctrl ${FACT++LIBS})
749 MANPAGE(miniftmctrl "")
750
751 ADD_EXECUTABLE(famousrate famous/src/ratecontrol.cc)
752 TARGET_LINK_LIBRARIES(famousrate ${FACT++LIBS})
753 MANPAGE(famousrate "")
754ENDIF()
755
756
757
758# ********************************************************
759# ********************** IceACT **************************
760# ********************************************************
761
762IF(FOUND_ICEACT)
763 ADD_EXECUTABLE(iceactpsu iceact/src/psuctrl.cc)
764 TARGET_LINK_LIBRARIES(iceactpsu ${FACT++LIBS})
765 MANPAGE(iceactpsu "")
766
767 ADD_EXECUTABLE(tmonctrl iceact/src/tmonctrl.cc)
768 TARGET_LINK_LIBRARIES(tmonctrl ${FACT++LIBS})
769 MANPAGE(tmonctrl "")
770ENDIF()
771
Note: See TracBrowser for help on using the repository browser.