Changeset 20070 for trunk


Ignore:
Timestamp:
04/12/21 18:48:16 (4 years ago)
Author:
tbretz
Message:
Restructured to allow for 'make install' as a shortcut, added fpgaftmctrl.
File:
1 edited

Legend:

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

    r20068 r20070  
    2828#SET(CMAKE_VERBOSE_MAKEFILE ON)
    2929
     30# *********************************
     31# ************ System *************
     32# *********************************
     33
     34FIND_PROGRAM(LSB_RELEASE_EXE NAMES lsb_release)
     35IF (DEFINED LSB_RELEASE_EXE)
     36   EXECUTE_PROCESS(COMMAND ${LSB_RELEASE_EXE} -d OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
     37   MESSAGE(STATUS ${LSB_RELEASE})
     38ENDIF()
     39
    3040MESSAGE(STATUS "CMake Version " ${CMAKE_VERSION})
    3141
     42
     43
    3244# *********************************
    3345# ************ Project ************
     
    4052PROJECT(fact++ VERSION ${VERSION})
    4153
    42 INCLUDE(GNUInstallDirs)
     54# *************************************
     55# ************ Some checks  ***********
     56# *************************************
    4357
    4458IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
     
    7488
    7589
    76 # ======== For config.h.in =========
    77 SET(PACKAGE_MAINTAINER "Thomas Bretz")
    78 SET(PACKAGE_BUGREPORT  "tbretz@physik.rwth-aachen.de")
    79 SET(PACKAGE_URL        "https://www.fact-project.org")
    80 
    81 FIND_PROGRAM(LSB_RELEASE_EXE NAMES lsb_release)
    82 IF (DEFINED LSB_RELEASE_EXE)
    83    EXECUTE_PROCESS(COMMAND ${LSB_RELEASE_EXE} -d OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE)
    84    MESSAGE(STATUS ${LSB_RELEASE})
    85 ENDIF()
     90# *************************************
     91# ************ Installation ***********
     92# *************************************
     93
     94INCLUDE(GNUInstallDirs)
     95IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR CMAKE_INSTALL_PREFIX STREQUAL CMAKE_INSTALL_PREFIX_DEFAULT)
     96    MESSAGE(STATUS "Install Prefix: " ${CMAKE_INSTALL_PREFIX} " <default>")
     97    SET(CMAKE_INSTALL_PREFIX_DEFAULT ${CMAKE_INSTALL_PREFIX} CACHE INTERNAL "Default install prefix")
     98ELSE()
     99    MESSAGE(STATUS "Install Prefix: " ${CMAKE_INSTALL_PREFIX})
     100ENDIF()
     101
     102# Compiling and installation with full RAPTH
     103
     104# Taken from
     105# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
     106
     107# use, i.e. don't skip the full RPATH for the build tree
     108SET(CMAKE_SKIP_BUILD_RPATH FALSE)
     109# when building, don't use the install RPATH already
     110# (but later on when installing)
     111SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
     112SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
     113# add then automatically determined parts of the RPATH
     114# which point to directories outside the build tree to the install RPATH
     115SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
     116# the RPATH to be used when installing, but only if it's not a system directory
     117#LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" IsSystemDir)
     118#IF("${IsSystemDir}" STREQUAL "-1")
     119#    SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
     120#ENDIF()
     121
     122INSTALL(PROGRAMS start.sh DESTINATION ${CMAKE_INSTALL_BINDIR})
     123
     124# USAGE:
     125#   INSTALL_LINK(executable)
     126#   INSTALL_LINK(executable link)
     127FUNCTION(INSTALL_LINK)
     128
     129    IF (NOT CMAKE_INSTALL_PREFIX STREQUAL CMAKE_INSTALL_PREFIX_DEFAULT)
     130
     131        LIST(LENGTH ARGN LIST_COUNT)
     132        IF (LIST_COUNT GREATER 2)
     133            MESSAGE(FATAL_ERROR "LINK only suppted with a maximum of two arguments")
     134        ENDIF()
     135
     136        LIST(GET ARGN 0 executable)
     137        IF (LIST_COUNT EQUAL 1)
     138            LIST(GET ARGN 0 link)
     139        ELSE()
     140            LIST(GET ARGN 1 link)
     141        ENDIF()
     142
     143        INSTALL(CODE "MESSAGE(STATUS \"Creating symlink for ${executable}\")")
     144        INSTALL(CODE "EXECUTE_PROCESS(COMMAND ln -sf bin/${link} ${executable} WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX})")
     145    ENDIF()
     146
     147ENDFUNCTION()
     148
    86149
    87150# *********************************
     
    436499# *********************************
    437500
    438 SET(CMAKE_CXX_STANDARD 11)
     501#SET(CMAKE_CXX_STANDARD 11)
    439502SET(CMAKE_C_STANDARD   99)
    440503
     
    469532SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -DMIPSEL -DPROTOCOL=1 -Dunix -Dlinux")
    470533
     534
     535# ======== For config.h.in =========
     536SET(PACKAGE_MAINTAINER "Thomas Bretz")
     537SET(PACKAGE_BUGREPORT  "tbretz@physik.rwth-aachen.de")
     538SET(PACKAGE_URL        "https://www.fact-project.org")
     539
     540
     541# ********************************************************
     542# ******************** Compilation ***********************
     543# ********************************************************
    471544
    472545# -------------------------------------------------------
     
    526599        erfa/src/tr.c           erfa/src/falp03.c)
    527600TARGET_LINK_LIBRARIES(Pointing PUBLIC m)
     601INSTALL(TARGETS Pointing)
    528602
    529603# ======================= libDim.so ======================
     
    549623        dim/src/utilities.c)
    550624
     625INSTALL(TARGETS Dim)
     626
    551627# ================= libDimExtension.so ===================
    552628ADD_LIBRARY(DimExtension SHARED
     
    555631TARGET_LINK_LIBRARIES(DimExtension PUBLIC
    556632        Boost::system)
     633INSTALL(TARGETS DimExtension)
    557634
    558635# ===================== libDim++.so ======================
     
    572649        dim/src/tokenstring.cxx)
    573650TARGET_LINK_LIBRARIES(Dim++ PUBLIC Dim)
     651INSTALL(TARGETS Dim++)
    574652
    575653# ================= libStateMachine.so ===================
     
    612690        Boost::filesystem
    613691        OpenSSL::SSL)
     692INSTALL(TARGETS StateMachine)
    614693
    615694ENDIF (NOT TOOLS_ONLY AND NOT VIEWER_ONLY)
     
    625704        Boost::program_options
    626705        ${MYSQL_LIBRARY} ${MYSQLPP_LIBRARY})
     706INSTALL(TARGETS Configuration)
    627707
    628708# ===================== libTime.so =======================
     
    630710        src/Time.h src/Time.cc)
    631711TARGET_LINK_LIBRARIES(Time PUBLIC ${NOVA_LIBRARY})
     712INSTALL(TARGETS Time)
    632713
    633714# ===================== libTools.so ======================
    634715ADD_LIBRARY(Tools SHARED
    635716        src/tools.h src/tools.cc)
     717INSTALL(TARGETS Tools)
    636718
    637719
     
    731813   ADD_EXECUTABLE(fitsdump src/fitsdump.cc)
    732814   TARGET_LINK_LIBRARIES(fitsdump ${HELP++LIBS} ${ROOT_LIBRARIES} ZLIB::ZLIB)
     815   INSTALL(TARGETS fitsdump)
     816   INSTALL_LINK(fitsdump)
    733817   MANPAGE(fitsdump "FACT++ - fitsdump - Read and dump contents of a FITStable")
    734818   # This is a hack to suppress warnings from root headers (-isystem)
     
    737821   ADD_EXECUTABLE(rootifysql src/rootifysql.cc)
    738822   TARGET_LINK_LIBRARIES(rootifysql ${HELP++LIBS} OpenSSL::SSL ${ROOT_LIBRARIES})
     823   INSTALL(TARGETS rootifysql)
     824   INSTALL_LINK(rootifysql)
    739825   MANPAGE(rootifysql "FACT++ - rootifysql - Write result of a SQL query into a root-file")
    740826   # This is a hack to suppress warnings from root headers (-isystem)
     
    743829   ADD_EXECUTABLE(root2sql src/root2sql.cc)
    744830   TARGET_LINK_LIBRARIES(root2sql ${HELP++LIBS} OpenSSL::SSL ${MYSQLPP_LIBRARY} ${ROOT_LIBRARIES})
     831   INSTALL(TARGETS root2sql)
     832   INSTALL_LINK(root2sql)
    745833   MANPAGE(root2sql "FACT++ - root2sql - Fill contents of a root-tree into a MySQL database")
    746834   # This is a hack to suppress warnings from root headers (-isystem)
     
    749837   ADD_EXECUTABLE(root2csv src/root2csv.cc)
    750838   TARGET_LINK_LIBRARIES(root2csv ${HELP++LIBS} ${ROOT_LIBRARIES})
     839   INSTALL(TARGETS root2csv)
     840   INSTALL_LINK(root2csv)
    751841   MANPAGE(root2csv "FACT++ - root2csv - Convert a root-tree to a csv file")
    752842   # This is a hack to suppress warnings from root headers (-isystem)
     
    755845   ADD_EXECUTABLE(csv2root src/csv2root.cc)
    756846   TARGET_LINK_LIBRARIES(csv2root ${HELP++LIBS} ${ROOT_LIBRARIES})
     847   INSTALL(TARGETS csv2root)
     848   INSTALL_LINK(csv2root)
    757849   MANPAGE(csv2root "FACT++ - csv2root - Convert a csv file to a root-tree")
    758850   # This is a hack to suppress warnings from root headers (-isystem)
     
    762854ADD_EXECUTABLE(fits2sql src/fits2sql.cc)
    763855TARGET_LINK_LIBRARIES(fits2sql ${HELP++LIBS}  ZLIB::ZLIB)
     856INSTALL(TARGETS fits2sql)
     857INSTALL_LINK(fits2sql)
    764858MANPAGE(fits2sql "FACT++ - fits2sql - Fill contents of a FITS table into a MySQL database")
    765859
    766860ADD_EXECUTABLE(corsika2sql src/corsika2sql.cc)
    767861TARGET_LINK_LIBRARIES(corsika2sql ${HELP++LIBS})
     862INSTALL(TARGETS corsika2sql)
     863INSTALL_LINK(corsika2sql)
    768864MANPAGE(corsika2sql "Fills a Corsika Input Card into a SQL table")
    769865
    770866ADD_EXECUTABLE(showlog src/showlog.cc src/WindowLog.cc)
    771867TARGET_LINK_LIBRARIES(showlog Threads::Threads ${HELP++LIBS} ${CURSES_LIBRARIES})
     868INSTALL(TARGETS showlog)
     869INSTALL_LINK(showlog)
    772870MANPAGE(showlog "")
    773871
    774872ADD_EXECUTABLE(zfits src/zfits.cc)
    775873TARGET_LINK_LIBRARIES(zfits ${HELP++LIBS} ZLIB::ZLIB)
     874INSTALL(TARGETS zfits)
     875INSTALL_LINK(zfits)
    776876MANPAGE(zfits "")
    777877
    778878ADD_EXECUTABLE(fixfits src/fixfits.cc)
    779879TARGET_LINK_LIBRARIES(fixfits ${HELP++LIBS} ZLIB::ZLIB)
     880INSTALL(TARGETS fixfits)
     881INSTALL_LINK(fixfits)
    780882MANPAGE(fixfits "FACT++ - fixfits - Fix the header of a none closed raw-data file")
    781883
     
    783885   ADD_EXECUTABLE(calcsource src/calcsource.cc)
    784886   TARGET_LINK_LIBRARIES(calcsource ${HELP++LIBS} ${ROOT_LIBRARIES})
     887   INSTALL(TARGETS calcsource)
     888   INSTALL_LINK(calcsource)
    785889   MANPAGE(calcsource "")
    786890   # This is a hack to suppress warnings from root headers (-isystem)
     
    789893   ADD_EXECUTABLE(calcsourcemc src/calcsourcemc.cc)
    790894   TARGET_LINK_LIBRARIES(calcsourcemc ${HELP++LIBS} ${ROOT_LIBRARIES})
     895   INSTALL(TARGETS calcsourcemc)
     896   INSTALL_LINK(calcsourcemc)
    791897   MANPAGE(calcsourcemc "")
    792898   # This is a hack to suppress warnings from root headers (-isystem)
     
    797903TARGET_LINK_LIBRARIES(spectrum Threads::Threads ${CURSES_LIBRARIES} ${HIGHLIGHT_LIBRARY} ${HELP++LIBS} ${ROOT_LIBRARIES})
    798904ADD_RESOURCES(spectrum/analysis.sql spectrum/data.sql spectrum/simulation.sql spectrum/spectrum.sql spectrum/summary-est.sql spectrum/summary-sim.sql)
     905INSTALL(TARGETS spectrum)
     906INSTALL_LINK(spectrum)
     907INSTALL(FILES spectrum/analysis.sql spectrum/data.sql spectrum/simulation.sql spectrum/spectrum.sql spectrum/summary-est.sql spectrum/summary-sim.sql DESTINATION share/sql)
    799908MANPAGE(spectrum "")
    800909# This is a hack to suppress warnings from root headers (-isystem)
     
    803912ADD_EXECUTABLE(getevent src/getevent.cc)
    804913TARGET_LINK_LIBRARIES(getevent ${HELP++LIBS} ZLIB::ZLIB Threads::Threads)
     914INSTALL(TARGETS getevent)
     915INSTALL_LINK(getevent)
    805916MANPAGE(getevent "")
    806917
     
    811922IF(NOT NO_ROOT)
    812923   ADD_EXECUTABLE(makeplots src/makeplots.cc)
    813    TARGET_LINK_LIBRARIES(makeplots  ${HELP++LIBS} ${ROOT_LIBRARIES})
     924   TARGET_LINK_LIBRARIES(makeplots ${HELP++LIBS} ${ROOT_LIBRARIES})
     925   INSTALL(TARGETS makeplots)
     926   INSTALL_LINK(makeplots)
    814927   # This is a hack to suppress warnings from root headers (-isystem)
    815928   TARGET_INCLUDE_DIRECTORIES(makeplots SYSTEM PUBLIC ${ROOT_INCLUDE_DIRS})
     
    819932ADD_EXECUTABLE(makedata src/makedata.cc)
    820933TARGET_LINK_LIBRARIES(makedata ${HELP++LIBS})
     934INSTALL(TARGETS makedata)
     935INSTALL_LINK(makedata)
    821936MANPAGE(makedata "")
    822937
    823938ADD_EXECUTABLE(makeschedule src/makeschedule.cc)
    824939TARGET_LINK_LIBRARIES(makeschedule ${HELP++LIBS})
     940INSTALL(TARGETS makeschedule)
     941INSTALL_LINK(makeschedule)
    825942MANPAGE(makeschedule "")
    826943
    827944ADD_EXECUTABLE(moon src/moon.cc)
    828945TARGET_LINK_LIBRARIES(moon ${HELP++LIBS})
     946INSTALL(TARGETS moon)
     947INSTALL_LINK(moon)
    829948MANPAGE(moon "")
    830949
     
    839958ADD_EXECUTABLE(dns src/dns.c)
    840959TARGET_LINK_LIBRARIES(dns ${FACT++LIBS})
     960INSTALL(TARGETS dns)
     961INSTALL_LINK(dns)
    841962MANPAGE(dns "")
    842963
    843964ADD_EXECUTABLE(agilentctrl src/agilentctrl.cc)
    844965TARGET_LINK_LIBRARIES(agilentctrl ${FACT++LIBS})
     966INSTALL(TARGETS agilentctrl)
     967INSTALL_LINK(agilentctrl start.sh)
    845968MANPAGE(agilentctrl "")
    846969
    847970ADD_EXECUTABLE(biasctrl src/biasctrl.cc)
    848971TARGET_LINK_LIBRARIES(biasctrl ${FACT++LIBS})
     972INSTALL(TARGETS biasctrl)
     973INSTALL_LINK(biasctrl start.sh)
    849974MANPAGE(biasctrl "")
    850975
    851976ADD_EXECUTABLE(biastemp src/biastemp.cc)
    852977TARGET_LINK_LIBRARIES(biastemp ${FACT++LIBS})
     978INSTALL(TARGETS biastemp)
     979INSTALL_LINK(biastemp start.sh)
    853980MANPAGE(biastemp "")
    854981
    855982ADD_EXECUTABLE(gudectrl src/gudectrl.cc)
    856983TARGET_LINK_LIBRARIES(gudectrl ${FACT++LIBS})
     984INSTALL(TARGETS gudectrl)
     985INSTALL_LINK(gudectrl start.sh)
    857986MANPAGE(gudectrl "")
    858987
    859988ADD_EXECUTABLE(gtcdust src/gtcdust.cc)
    860989TARGET_LINK_LIBRARIES(gtcdust ${FACT++LIBS})
     990INSTALL(TARGETS gtcdust)
     991INSTALL_LINK(gtcdust start.sh)
    861992MANPAGE(gtcdust "")
    862993
    863994ADD_EXECUTABLE(chatserv src/chatserv.cc)
    864995TARGET_LINK_LIBRARIES(chatserv ${FACT++LIBS}) # does not require libpanel
     996INSTALL(TARGETS chatserv)
     997INSTALL_LINK(chatserv start.sh)
    865998MANPAGE(chatserv "")
    866999
    8671000ADD_EXECUTABLE(chatclient src/chatclient.cc)
    8681001TARGET_LINK_LIBRARIES(chatclient ${FACT++LIBS}) # does not require libpanel
     1002INSTALL(TARGETS chatclient)
     1003INSTALL_LINK(chatclient start.sh)
    8691004MANPAGE(chatclient "")
    8701005
     
    8781013        src/FitsFile.cc src/Fits.cc)
    8791014TARGET_LINK_LIBRARIES(datalogger ${FACT++LIBS} cfitsio CCfits)
     1015INSTALL(TARGETS datalogger)
     1016INSTALL_LINK(datalogger start.sh)
    8801017MANPAGE(datalogger "")
    8811018
     
    8871024                src/DimState.cc)
    8881025        TARGET_LINK_LIBRARIES(dimctrl ${FACT++LIBS} Pointing ZLIB::ZLIB v8)
     1026        INSTALL(TARGETS dimctrl)
     1027        INSTALL_LINK(dimctrl start.sh)
    8891028        MANPAGE(dimctrl "")
    8901029
     
    8931032                COMMENT "Creating symlink for dimserver"
    8941033                DEPENDS dimctrl)
     1034
     1035        INSTALL(FILES ${CMAKE_BINARY_DIR}/dimserver DESTINATION ${CMAKE_INSTALL_BINDIR})
     1036        INSTALL_LINK(dimserver start.sh)
    8951037ENDIF()
    8961038
    8971039ADD_EXECUTABLE(drivectrl src/drivectrl.cc)
    8981040TARGET_LINK_LIBRARIES(drivectrl ${FACT++LIBS} Pointing)
     1041INSTALL(TARGETS drivectrl)
     1042INSTALL_LINK(drivectrl start.sh)
    8991043MANPAGE(drivectrl "")
    9001044
    9011045ADD_EXECUTABLE(evtserver src/evtserver.cc)
    9021046TARGET_LINK_LIBRARIES(evtserver ${FACT++LIBS} ZLIB::ZLIB)
     1047INSTALL(TARGETS evtserver)
     1048INSTALL_LINK(evtserver start.sh)
    9031049MANPAGE(evtserver "")
    9041050
     
    9121058        src/DataProcessorImp.cc)
    9131059TARGET_LINK_LIBRARIES(fadctrl ${FACT++LIBS} cfitsio CCfits ZLIB::ZLIB)
     1060INSTALL(TARGETS fadctrl)
     1061INSTALL_LINK(fadctrl start.sh)
    9141062MANPAGE(fadctrl "")
    9151063
    9161064ADD_EXECUTABLE(feedback src/feedback.cc)
    9171065TARGET_LINK_LIBRARIES(feedback ${FACT++LIBS})
     1066INSTALL(TARGETS feedback)
     1067INSTALL_LINK(feedback start.sh)
    9181068MANPAGE(feedback "")
    9191069
    9201070ADD_EXECUTABLE(fscctrl src/fscctrl.cc src/HeadersFTM.cc)
    9211071TARGET_LINK_LIBRARIES(fscctrl ${FACT++LIBS})
     1072INSTALL(TARGETS fscctrl)
     1073INSTALL_LINK(fscctrl start.sh)
    9221074MANPAGE(fscctrl "")
    9231075
    9241076ADD_EXECUTABLE(miniftmctrl src/miniftmctrl.cc)
    9251077TARGET_LINK_LIBRARIES(miniftmctrl ${FACT++LIBS})
     1078INSTALL(TARGETS miniftmctrl)
     1079INSTALL_LINK(miniftmctrl start.sh)
    9261080MANPAGE(miniftmctrl "")
     1081
     1082ADD_EXECUTABLE(fpgaftmctrl src/fpgaftmctrl.cc)
     1083TARGET_LINK_LIBRARIES(fpgaftmctrl ${FACT++LIBS})
     1084INSTALL(TARGETS fpgaftmctrl)
     1085INSTALL_LINK(fpgaftmctrl start.sh)
     1086MANPAGE(fpgaftmctrl "")
    9271087
    9281088IF(NOT FOUND_FAMOUS)
    9291089    ADD_EXECUTABLE(ftmctrl src/ftmctrl.cc src/HeadersFTM.cc)
    9301090    TARGET_LINK_LIBRARIES(ftmctrl ${FACT++LIBS})
     1091    INSTALL(TARGETS ftmctrl)
     1092    INSTALL_LINK(ftmctrl start.sh)
    9311093    MANPAGE(ftmctrl "")
    9321094ELSE()
    9331095    ADD_CUSTOM_TARGET(ftmctrl ALL
    934         COMMAND ln -sf miniftmctrl ftmctrl
    935         COMMENT "Creating symlink for ftmctrl"
    936         DEPENDS miniftmctrl)
     1096        COMMAND ln -sf fpgaftmctrl ftmctrl
     1097        COMMENT "Creating symlink for fpgaftmctrl"
     1098        DEPENDS fpgaftmctrl)
     1099    INSTALL(FILES ${CMAKE_BINARY_DIR}/fpgaftmctrl DESTINATION ${CMAKE_INSTALL_BINDIR})
     1100    INSTALL_LINK(fpgaftmctrl start.sh)
    9371101ENDIF()
    9381102
    9391103ADD_EXECUTABLE(gcn src/gcn.cc)
    9401104TARGET_LINK_LIBRARIES(gcn ${FACT++LIBS} ${Qt}::${QtXml})
     1105INSTALL(TARGETS gcn)
     1106INSTALL_LINK(gcn start.sh)
    9411107MANPAGE(gcn "")
    9421108
    9431109ADD_EXECUTABLE(scheduler src/scheduler.cc)
    9441110TARGET_LINK_LIBRARIES(scheduler ${FACT++LIBS})
     1111INSTALL(TARGETS scheduler)
     1112INSTALL_LINK(scheduler start.sh)
    9451113MANPAGE(scheduler "")
    9461114
    9471115ADD_EXECUTABLE(gpsctrl src/gpsctrl.cc)
    9481116TARGET_LINK_LIBRARIES(gpsctrl ${FACT++LIBS})
     1117INSTALL(TARGETS gpsctrl)
     1118INSTALL_LINK(gpsctrl start.sh)
    9491119MANPAGE(gpsctrl "")
    9501120
    9511121ADD_EXECUTABLE(lidctrl src/lidctrl.cc)
    9521122TARGET_LINK_LIBRARIES(lidctrl ${FACT++LIBS} ${Qt}::${QtXml})
     1123INSTALL(TARGETS lidctrl)
     1124INSTALL_LINK(lidctrl start.sh)
    9531125MANPAGE(lidctrl "")
    9541126
    9551127ADD_EXECUTABLE(magiclidar src/magiclidar.cc)
    9561128TARGET_LINK_LIBRARIES(magiclidar ${FACT++LIBS})
     1129INSTALL(TARGETS magiclidar)
     1130INSTALL_LINK(magiclidar start.sh)
    9571131MANPAGE(magiclidar "")
    9581132
    9591133ADD_EXECUTABLE(magicweather src/magicweather.cc)
    9601134TARGET_LINK_LIBRARIES(magicweather ${FACT++LIBS})
     1135INSTALL(TARGETS magicweather)
     1136INSTALL_LINK(magicweather start.sh)
    9611137MANPAGE(magicweather "")
    9621138
    9631139ADD_EXECUTABLE(mcp src/mcp.cc)
    9641140TARGET_LINK_LIBRARIES(mcp ${FACT++LIBS})
     1141INSTALL(TARGETS mcp)
     1142INSTALL_LINK(mcp start.sh)
    9651143MANPAGE(mcp "")
    9661144
    9671145ADD_EXECUTABLE(pfminictrl src/pfminictrl.cc)
    9681146TARGET_LINK_LIBRARIES(pfminictrl ${FACT++LIBS})
     1147INSTALL(TARGETS pfminictrl)
     1148INSTALL_LINK(pfminictrl start.sh)
    9691149MANPAGE(pfminictrl "")
    9701150
    9711151ADD_EXECUTABLE(pwrctrl src/pwrctrl.cc src/HeadersPower.cc)
    9721152TARGET_LINK_LIBRARIES(pwrctrl ${FACT++LIBS} ${Qt}::${QtXml})
     1153INSTALL(TARGETS pwrctrl)
     1154INSTALL_LINK(pwrctrl start.sh)
    9731155MANPAGE(pwrctrl "")
    9741156
    9751157ADD_EXECUTABLE(rainsensor src/rainsensor.cc)
    9761158TARGET_LINK_LIBRARIES(rainsensor ${FACT++LIBS})
     1159INSTALL(TARGETS rainsensor)
     1160INSTALL_LINK(rainsensor start.sh)
    9771161MANPAGE(rainsensor "")
    9781162
    9791163ADD_EXECUTABLE(ratecontrol src/ratecontrol.cc)
    9801164TARGET_LINK_LIBRARIES(ratecontrol ${FACT++LIBS})
     1165INSTALL(TARGETS ratecontrol)
     1166INSTALL_LINK(ratecontrol start.sh)
    9811167MANPAGE(ratecontrol "")
    9821168
    9831169ADD_EXECUTABLE(ratescan src/ratescan.cc)
    9841170TARGET_LINK_LIBRARIES(ratescan ${FACT++LIBS})
     1171INSTALL(TARGETS ratescan)
     1172INSTALL_LINK(ratescan start.sh)
    9851173MANPAGE(ratescan "")
    9861174
     
    9951183ADD_EXECUTABLE(sqmctrl src/sqmctrl.cc)
    9961184TARGET_LINK_LIBRARIES(sqmctrl ${FACT++LIBS})
     1185INSTALL(TARGETS sqmctrl)
     1186INSTALL_LINK(sqmctrl start.sh)
    9971187MANPAGE(sqmctrl "")
    9981188
    9991189ADD_EXECUTABLE(smartfact src/smartfact.cc)
    10001190TARGET_LINK_LIBRARIES(smartfact ${FACT++LIBS}) # HAVE_NOVA
     1191INSTALL(TARGETS smartfact)
     1192INSTALL_LINK(smartfact start.sh)
    10011193MANPAGE(smartfact "")
    10021194
    10031195ADD_EXECUTABLE(temperature src/temperature.cc)
    10041196TARGET_LINK_LIBRARIES(temperature ${FACT++LIBS})
     1197INSTALL(TARGETS temperature)
     1198INSTALL_LINK(temperature start.sh)
    10051199MANPAGE(temperature "")
    10061200
    10071201ADD_EXECUTABLE(timecheck src/timecheck.cc)
    10081202TARGET_LINK_LIBRARIES(timecheck ${FACT++LIBS})
     1203INSTALL(TARGETS timecheck)
     1204INSTALL_LINK(timecheck start.sh)
    10091205MANPAGE(timecheck "")
    10101206
    10111207ADD_EXECUTABLE(tngweather src/tngweather.cc)
    10121208TARGET_LINK_LIBRARIES(tngweather ${FACT++LIBS} ${Qt}::${QtXml})
     1209INSTALL(TARGETS tngweather)
     1210INSTALL_LINK(tngweather start.sh)
    10131211MANPAGE(tngweather "")
    10141212
     
    10591257        ${QWT_LIBRARY} ZLIB::ZLIB)
    10601258
     1259INSTALL(TARGETS viewer)
     1260INSTALL_LINK(viewer)
     1261
    10611262#ENDIF(NOT TOOLS_ONLY OR VIEWER_ONLY)
    10621263
     
    10941295        ${QWT_LIBRARY} ZLIB::ZLIB)
    10951296
     1297INSTALL(TARGETS fact)
     1298INSTALL_LINK(fact)
    10961299
    10971300#dclient5_SOURCES = src/dclient5.cc src/LocalControl.h
     
    11221325        ADD_EXECUTABLE(famousbias famous/src/famousbias.cc)
    11231326        TARGET_LINK_LIBRARIES(famousbias ${FACT++LIBS})
     1327        INSTALL(TARGETS famousbias)
     1328        INSTALL_LINK(famousbias start.sh)
    11241329        MANPAGE(famousbias "")
    11251330
    11261331        ADD_EXECUTABLE(famousui famous/ui/famousui.cc)
    11271332        TARGET_LINK_LIBRARIES(famousui ${FACT++LIBS})
     1333        INSTALL(TARGETS famousui)
     1334        INSTALL_LINK(famousui start.sh)
    11281335        MANPAGE(famousui "")
    11291336
    11301337        ADD_EXECUTABLE(ftuctrl famous/src/ftuctrl.cc)
    11311338        TARGET_LINK_LIBRARIES(ftuctrl ${FACT++LIBS})
     1339        INSTALL(TARGETS ftuctrl)
     1340        INSTALL_LINK(ftuctrl start.sh)
    11321341        MANPAGE(ftuctrl "")
    1133 
    1134         ADD_EXECUTABLE(fpgaftmctrl famous/src/fpgaftmctrl.cc)
    1135         TARGET_LINK_LIBRARIES(fpgaftmctrl ${FACT++LIBS})
    1136         MANPAGE(fpgaftmctrl "")
    11371342
    11381343        ADD_EXECUTABLE(famousrate famous/src/famousrate.cc)
    11391344        TARGET_LINK_LIBRARIES(famousrate ${FACT++LIBS})
     1345        INSTALL(TARGETS famousrate)
     1346        INSTALL_LINK(famousrate start.sh)
    11401347        MANPAGE(famousrate "")
    11411348
    11421349        ADD_EXECUTABLE(famousscan famous/src/famousscan.cc)
    11431350        TARGET_LINK_LIBRARIES(famousscan ${FACT++LIBS})
     1351        INSTALL(TARGETS famousscan)
     1352        INSTALL_LINK(famousscan start.sh)
    11441353        MANPAGE(famousscan "")
    11451354
    11461355        ADD_EXECUTABLE(beaglectrl famous/src/beaglectrl.cc)
    11471356        TARGET_LINK_LIBRARIES(beaglectrl ${FACT++LIBS} ${Qt}::${QtXml})
     1357        INSTALL(TARGETS beaglectrl)
     1358        INSTALL_LINK(beaglectrl start.sh)
    11481359        MANPAGE(beaglectrl "")
    11491360ENDIF()
     
    11581369        ADD_EXECUTABLE(iceactpsu iceact/src/psuctrl.cc)
    11591370        TARGET_LINK_LIBRARIES(iceactpsu ${FACT++LIBS})
     1371        INSTALL(TARGETS iceactpsu)
     1372        INSTALLLINK(iceactpsu start.sh)
    11601373        MANPAGE(iceactpsu "")
    11611374
    11621375        ADD_EXECUTABLE(tmonctrl iceact/src/tmonctrl.cc)
    11631376        TARGET_LINK_LIBRARIES(tmonctrl ${FACT++LIBS})
     1377        INSTALL(TARGETS tmonctrl)
     1378        INSTALL_LINK(tmonctrl start.sh)
    11641379        MANPAGE(tmonctrl "")
    11651380ENDIF()
     
    11701385# *********************************
    11711386
     1387SET(DNS "10.0.100.10" CACHE STRING "Default IP of the DNS used to create default fact++.rc")
     1388
     1389# Prepare the file for build interface
     1390SET(INSTALL_PREFIX ${CMAKE_BINARY_DIR})
     1391CONFIGURE_FILE(fact++.rc.in fact++.rc @ONLY)
     1392
     1393FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/rc)
     1394FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/log)
     1395
     1396IF(NOT CMAKE_INSTALL_PREFIX STREQUAL CMAKE_INSTALL_PREFIX_DEFAULT)
     1397
     1398    # Prepare default fact++.rc for installation
     1399    SET(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
     1400    CONFIGURE_FILE(fact++.rc.in fact++rc.install @ONLY)
     1401    INSTALL(FILES ${CMAKE_BINARY_DIR}/fact++rc.install DESTINATION ${CMAKE_INSTALL_PREFIX} RENAME fact++.rc)
     1402
     1403    # Create empty directories during installation
     1404    INSTALL(DIRECTORY "log" DESTINATION ${CMAKE_INSTALL_PREFIX})
     1405    INSTALL(DIRECTORY "rc"  DESTINATION ${CMAKE_INSTALL_PREFIX})
     1406
     1407    INSTALL(CODE "MESSAGE(STATUS \"Preparing environment.\")")
     1408ENDIF()
     1409
     1410
    11721411# ======== Setup directories ======
    11731412
    11741413# MESSAGE("")
    1175 # MESSAGE("PREFIX:         "${CMAKE_INSTALL_PREFIX})
    11761414# MESSAGE("")
    11771415# MESSAGE("BINDIR:         "${CMAKE_INSTALL_FULL_BINDIR})
     
    12061444# MESSAGE("")
    12071445
    1208 SET(PKG_SHARE    "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}")
    1209 SET(PKG_APPS     "${CMAKE_INSTALL_DATAROOTDIR}/applications")
    1210 SET(PKG_PIXMAPS  "${CMAKE_INSTALL_DATAROOTDIR}/pixmaps")
    1211 
    1212 # ====== Installation targets =====
    1213 
    1214 IF (NOT VIEWER_ONLY)
    1215 
    1216    INSTALL(TARGETS  fits2sql       DESTINATION "${CMAKE_INSTALL_BINDIR}")
    1217    INSTALL(TARGETS  zfits          DESTINATION "${CMAKE_INSTALL_BINDIR}")
    1218    INSTALL(TARGETS  showlog        DESTINATION "${CMAKE_INSTALL_BINDIR}")
    1219 
    1220    IF(NOT NO_ROOT)
    1221       INSTALL(TARGETS  rootifysql     DESTINATION "${CMAKE_INSTALL_BINDIR}")
    1222       INSTALL(TARGETS  root2sql       DESTINATION "${CMAKE_INSTALL_BINDIR}")
    1223       INSTALL(TARGETS  root2csv       DESTINATION "${CMAKE_INSTALL_BINDIR}")
    1224       INSTALL(TARGETS  csv2root       DESTINATION "${CMAKE_INSTALL_BINDIR}")
    1225       INSTALL(TARGETS  fitsdump       DESTINATION "${CMAKE_INSTALL_BINDIR}")
    1226       INSTALL(TARGETS  calcsource     DESTINATION "${CMAKE_INSTALL_BINDIR}")
    1227       INSTALL(TARGETS  calcsourcemc   DESTINATION "${CMAKE_INSTALL_BINDIR}")
    1228    ENDIF()
    1229 
    1230 ENDIF(NOT VIEWER_ONLY)
    1231 
    1232 INSTALL(TARGETS  Configuration  DESTINATION "${CMAKE_INSTALL_LIBDIR}")
    1233 INSTALL(TARGETS  Time           DESTINATION "${CMAKE_INSTALL_LIBDIR}")
    1234 INSTALL(TARGETS  Tools          DESTINATION "${CMAKE_INSTALL_LIBDIR}")
    1235 
     1446#SET(PKG_SHARE    "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}")
     1447#SET(PKG_APPS     "${CMAKE_INSTALL_DATAROOTDIR}/applications")
     1448#SET(PKG_PIXMAPS  "${CMAKE_INSTALL_DATAROOTDIR}/pixmaps")
    12361449
    12371450#INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/html DESTINATION  "${PKG_SHARE}" FILES_MATCHING PATTERN "*.html")
Note: See TracChangeset for help on using the changeset viewer.