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

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