Changeset 18990 for trunk


Ignore:
Timestamp:
04/06/18 17:00:47 (7 years ago)
Author:
tbretz
Message:
Mostly changes to properly implement Qt support and get the GUIs compiled.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/CMakeLists.txt

    r18980 r18990  
    9797FIND_PACKAGE(GLUT)
    9898FIND_PACKAGE(Curses) # FIXME : Requires ncurses panel
    99 FIND_PACKAGE(ZLIB REQUIRED)
    100 FIND_PACKAGE(Threads REQUIRED)
     99FIND_PACKAGE(ZLIB REQUIRED)     # ZLIB::ZLIB
     100FIND_PACKAGE(Threads REQUIRED)  # Threads::Threads
     101FIND_PACKAGE(OpenGL REQUIRED)   # OpenGL::GL OpenGL::GLU
    101102
    102103INCLUDE_DIRECTORIES("/usr/include/mysql")
     
    116117LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
    117118
    118 # =============== QT5 ==============
    119 #find_package(Qt5Widgets)
     119# =============== QT4 ==============
    120120#SET(CMAKE_AUTOMOC ON)
    121121#SET(CMAKE_AUTORCC ON)
    122 SET(CMAKE_INCLUDE_CURRENT_DIR)
    123 FIND_PACKAGE(Qt5 COMPONENTS Core Widgets Xml REQUIRED)
    124 #INCLUDE_DIRECTORIES(${Qt5_INCLUDE_DIR})
     122SET(CMAKE_INCLUDE_CURRENT_DIR ON)
     123
     124#    set(CMAKE_AUTOMOC ON)
     125#    set(CMAKE_INCLUDE_CURRENT_DIR ON)
     126#    find_package(Qt4 4.4.3 REQUIRED QtGui QtXml)
     127#    add_executable(myexe main.cpp)
     128#    target_link_libraries(myexe Qt4::QtGui Qt4::QtXml)
     129
     130# QtCore QtSql QtOpenGL QtXml
     131FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtOpenGL QtSql QtXml)
     132INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})
     133INCLUDE_DIRECTORIES(${QT_QTGUI_INCLUDE_DIR})
     134INCLUDE_DIRECTORIES(${QT_QTSQL_INCLUDE_DIR})
     135INCLUDE_DIRECTORIES(${QT_QTXML_INCLUDE_DIR})
     136INCLUDE_DIRECTORIES(${QT_QTCORE_INCLUDE_DIR})
     137INCLUDE_DIRECTORIES(${QT_QTOPENGL_INCLUDE_DIR})
     138
     139MESSAGE(${QT_INCLUDE_DIR})
     140MESSAGE(${QT_QTGUI_INCLUDE_DIR})
     141MESSAGE(${QT_QTSQL_INCLUDE_DIR})
     142MESSAGE(${QT_QTXML_INCLUDE_DIR})
     143MESSAGE(${QT_QTCORE_INCLUDE_DIR})
     144MESSAGE(${QT_QTOPENGL_INCLUDE_DIR})
    125145
    126146# dbus-1 dbus-glib-1
     
    155175SET(CMAKE_CXX_FLAGS
    156176        "${CMAKE_CXX_FLAGS} \
    157          -D_REENTRANT -D__LINUX__ -DHAVE_ZLIB -DHAVE_V8 -DHAVE_SQL -DHAVE_NOVA \
     177         -D_REENTRANT -D__LINUX__ \
     178         -DHAVE_ZLIB -DHAVE_ROOT -DHAVE_V8 -DHAVE_SQL -DHAVE_NOVA -DHAVE_FITS \
    158179         -DMARSVER=\\\"${VERSION}\\\" \
    159180         -DPACKAGE_VERSION=\\\"${VERSION}\\\" \
    160181         -DREVISION=\\\"${REVISION}\\\" \
     182         -DPACKAGE_NAME=\\\"FACT++\\\" \
    161183         -DPACKAGE_STRING=\\\"FACT++\\\" \
    162184         -DPACKAGE_URL=\\\"${PACKAGE_URL}\\\" \
     
    185207# -lASImage -lMinuit -lHistPainter -lThread
    186208
    187 FIND_PACKAGE(ROOT REQUIRED COMPONENTS Gui Minuit)
     209FIND_PACKAGE(ROOT REQUIRED COMPONENTS GQt)
    188210INCLUDE_DIRECTORIES(${ROOT_INCLUDE_DIRS})
    189211
     
    200222#ROOT_<command>_CMD     PATH    Full path for each ROOT executable (rootcling, root, hadd, etc.)
    201223#ROOT_<option>_FOUND    BOOL    True for each enabled build option (e.g. cocoa, python, xrootd, etc.)
     224
     225MESSAGE(${ROOT_LIBRARIES})
     226
    202227
    203228# -------------------------------------------------------
     
    395420
    396421ADD_EXECUTABLE(fitsdump src/fitsdump.cc)
    397 TARGET_LINK_LIBRARIES(fitsdump ${HELP++LIBS} ZLIB::ZLIB)
     422TARGET_LINK_LIBRARIES(fitsdump ${HELP++LIBS} ${ROOT_LIBRARIES} ZLIB::ZLIB)
    398423MANPAGE(fitsdump "")
    399424
     
    488513#       StateMachine Tools Configuration Time Dim++ Dim DimExtension
    489514#        ${Boost_LIBRARIES} readline ncurses)
     515
     516ADD_EXECUTABLE(datalogger src/datalogger.cc
     517        src/DimState.cc
     518        src/FitsFile.cc src/Fits.cc)
     519TARGET_LINK_LIBRARIES(datalogger ${FACT++LIBS} cfitsio CCfits)
     520MANPAGE(datalogger "")
    490521
    491522ADD_EXECUTABLE(dimctrl src/dimctrl.cc
     
    510541MANPAGE(evtserver "")
    511542
     543ADD_EXECUTABLE(fadctrl src/fadctrl.cc src/HeadersFAD.cc
     544        src/EventBuilder.cc
     545        src/FitsFile.cc
     546        src/DataCalib.cc
     547        src/DataWriteRaw.cc
     548        src/DataWriteFits.cc
     549        src/DataWriteFits2.cc
     550        src/DataProcessorImp.cc)
     551TARGET_LINK_LIBRARIES(fadctrl ${FACT++LIBS} cfitsio CCfits ZLIB::ZLIB)
     552MANPAGE(fadctrl "")
     553
    512554ADD_EXECUTABLE(feedback src/feedback.cc)
    513555TARGET_LINK_LIBRARIES(feedback ${FACT++LIBS})
     
    523565
    524566ADD_EXECUTABLE(gcn src/gcn.cc)
    525 TARGET_LINK_LIBRARIES(gcn ${FACT++LIBS} ${NOVA_LIBRARY})
     567TARGET_LINK_LIBRARIES(gcn ${FACT++LIBS} ${NOVA_LIBRARY} Qt4::QtXml)
    526568MANPAGE(gcn "")
    527 QT5_USE_MODULES(gcn Xml)
    528569
    529570ADD_EXECUTABLE(gpsctrl src/gpsctrl.cc)
     
    532573
    533574ADD_EXECUTABLE(lidctrl src/lidctrl.cc)
    534 TARGET_LINK_LIBRARIES(lidctrl ${FACT++LIBS})
    535 QT5_USE_MODULES(lidctrl Xml)
     575TARGET_LINK_LIBRARIES(lidctrl ${FACT++LIBS} Qt4::QtXml)
    536576MANPAGE(lidctrl "")
    537577
     
    553593
    554594ADD_EXECUTABLE(pwrctrl src/pwrctrl.cc src/HeadersPower.cc)
    555 TARGET_LINK_LIBRARIES(pwrctrl ${FACT++LIBS})
     595TARGET_LINK_LIBRARIES(pwrctrl ${FACT++LIBS} Qt4::QtXml)
    556596MANPAGE(pwrctrl "")
    557 QT5_USE_MODULES(pwrctrl Xml)
    558597
    559598ADD_EXECUTABLE(ratecontrol src/ratecontrol.cc)
     
    590629
    591630ADD_EXECUTABLE(tngweather src/tngweather.cc)
    592 TARGET_LINK_LIBRARIES(tngweather ${FACT++LIBS})
     631TARGET_LINK_LIBRARIES(tngweather ${FACT++LIBS} Qt4::QtXml)
    593632MANPAGE(tngweather "")
    594 QT5_USE_MODULES(tngweather Xml)
    595633
    596634#ADD_EXECUTABLE(triggerschedule src/triggerschedule.cc)
     
    598636#MANPAGE(triggerschedule "")
    599637
    600 # *****************************************************************
     638
     639
     640# ********************************************************
     641# ****************** GUI Applications ********************
     642# ********************************************************
     643
     644INCLUDE_DIRECTORIES(/usr/include/qwt-qt4 gui gui/RawEventsViewer)
     645FILE(WRITE ${CMAKE_BINARY_DIR}/design.h "#include \"ui_design.h\"")
     646
     647# --------------------------------------------------------
     648
     649QT4_WRAP_UI(VIEWER_QT_HEADERS gui/RawEventsViewer/viewer.ui)
     650
     651QT4_WRAP_CPP(VIEWER_QT_SOURCES
     652        gui/RawEventsViewer/RawEventsViewer.h
     653        gui/BasicGlCamera.h
     654        gui/QCameraWidget.h
     655        gui/Q3DCameraWidget.h)
     656
     657ADD_EXECUTABLE(viewer
     658        gui/RawEventsViewer/RawEventsViewer.cc
     659        gui/BasicGlCamera.cc
     660        gui/QCameraWidget.cc
     661        gui/Q3DCameraWidget.cc
     662        ${VIEWER_QT_HEADERS}
     663        ${VIEWER_QT_SOURCES})
     664
     665TARGET_LINK_LIBRARIES(viewer
     666        ${Boost_LIBRARIES} Configuration mysqlpp
     667        Qt4::QtGui Qt4::QtOpenGL
     668        GL GLU qwt-qt4 ZLIB::ZLIB)
     669
     670# --------------------------------------------------------
     671
     672QT4_ADD_RESOURCES(FACT_QT_RESOURCES gui/design.qrc)
     673
     674QT4_WRAP_UI(FACT_QT_HEADERS gui/design.ui)
     675
     676QT4_WRAP_CPP(FACT_QT_SOURCES
     677        gui/DockWindow.h
     678        gui/MainWindow.h
     679        gui/QCameraWidget.h
     680        gui/BasicGlCamera.h)
     681
     682ADD_EXECUTABLE(fact gui/fact.cc
     683        gui/DockWindow.cc
     684        gui/MainWindow.cc
     685        gui/QCameraWidget.cc
     686        gui/BasicGlCamera.cc
     687        gui/HtmlDelegate.cc
     688        gui/CheckBoxDelegate.cc
     689        src/DimNetwork.cc
     690        ${FACT_QT_HEADERS}
     691        ${FACT_QT_SOURCES}
     692        ${FACT_QT_RESOURCES})
     693
     694TARGET_LINK_LIBRARIES(fact
     695        ${FACT++LIBS}
     696        ${ROOT_LIBRARIES}
     697        Qt4::QtGui Qt4::QtOpenGL Qt4::QtSql
     698        GL GLU qwt-qt4 ZLIB::ZLIB)
     699
    601700
    602701#dclient5_SOURCES = src/dclient5.cc src/LocalControl.h
     
    604703#    libConfiguration.la
    605704
    606 #fadctrl_SOURCES = src/fadctrl.cc src/LocalControl.h src/HeadersFAD.cc \
    607 #       src/EventBuilder.cc     src/EventBuilder.h \
    608 #       src/DataProcessorImp.cc src/DataProcessorImp.h \
    609 #       src/DataCalib.cc        src/DataCalib.h \
    610 #       src/DataWriteRaw.cc     src/DataWriteRaw.h \
    611 #       src/DrsCalib.h
    612 #if HAS_FITS
    613 #fadctrl_SOURCES += src/FitsFile.h src/FitsFile.cc \
    614 #       src/DataWriteFits.cc    src/DataWriteFits.h \
    615 #       src/DataWriteFits2.cc   src/DataWriteFits2.h
    616 #endif
    617 ##fadctrl_LDADD   = libDim++.la libDim.la  libDimExtension.la \
    618 #       libStateMachine.la libTools.la libTime.la \
    619 #       libConfiguration.la
    620 
    621705#argv_SOURCES = src/argv.cc
    622706#argv_LDADD = libConfiguration.la
     
    628712#test_LDADD = libStateMachine.la libTools.la libTime.la libDim++.la libDim.la libConfiguration.la
    629713
    630 #datalogger_SOURCES = src/datalogger.cc src/LocalControl.h src/DimState.cc src/DimState.h
    631 #if HAS_FITS
    632 #datalogger_SOURCES += src/FitsFile.h src/FitsFile.cc src/Fits.h src/Fits.cc
    633 #endif
    634 #datalogger_LDADD  = libDim++.la libDim.la libDimExtension.la \
    635 #       libStateMachine.la libTools.la libTime.la \
    636 #       libConfiguration.la
    637 
    638 # -----
    639 
    640 #if HAS_GUI
    641 
    642 #fact_DIALOGS = \
    643 #       gui/design.ui
    644 
    645 #fact_RESOURCES = \
    646 #       gui/design.qrc
    647 
    648 #fact_QT_SOURCES = \
    649 #       gui/DockWindow.cc \
    650 #       gui/MainWindow.cc \
    651 #       gui/QCameraWidget.cc \
    652 #       gui/BasicGlCamera.cc
    653 
    654 #fact_SRCADD = $(fact_DIALOGS:.ui=.h) $(fact_RESOURCES:.qrc=.cc) $(fact_QT_SOURCES:.cc=.moc.cc)
    655 
    656 #endif
    657 
    658 # -----
    659 
    660 #if HAS_VIEWER
    661 
    662 #viewer_DIALOGS = \
    663 #       gui/RawEventsViewer/viewer.ui
    664 
    665 #viewer_QT_SOURCES = \
    666 #       gui/RawEventsViewer/RawEventsViewer.cc \
    667 #       gui/BasicGlCamera.cc \
    668 #       gui/QCameraWidget.cc \
    669 #       gui/Q3DCameraWidget.cc
    670 
    671 #viewer_SRCADD = $(viewer_DIALOGS:.ui=.h) $(viewer_RESOURCES:.qrc=.cc) $(viewer_QT_SOURCES:.cc=.moc.cc)
    672 
    673 #endif
    674 
     714
     715
     716
     717# ********************************************************
     718# ********************** FAMOUS **************************
     719# ********************************************************
    675720
    676721IF(FOUND_FAMOUS)
     
    702747#       MANPAGE(ratecontrol "")
    703748ENDIF()
     749
     750
     751
     752# ********************************************************
     753# ********************** IceACT **************************
     754# ********************************************************
    704755
    705756IF(FOUND_ICEACT)
Note: See TracChangeset for help on using the changeset viewer.