Changeset 19141


Ignore:
Timestamp:
08/05/18 12:49:49 (6 years ago)
Author:
tbretz
Message:
Implemented packaging and an option to keep only the general tools.
File:
1 edited

Legend:

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

    r19099 r19141  
    5050
    5151
    52 
    5352# *********************************
    5453# ******** FAMOUS / IceACT ********
    5554# *********************************
     55
     56IF (NOT TOOLS_ONLY)
    5657
    5758IF(EXISTS "${CMAKE_SOURCE_DIR}/famous")
     
    6566ENDIF()
    6667
     68ENDIF(NOT TOOLS_ONLY)
    6769
    6870
     
    7880# ========== executables ==========
    7981FIND_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
    8089FIND_PROGRAM(JSDOC_EXECUTABLE    jsdoc)
    8190FIND_PROGRAM(MAILX_EXECUTABLE    mailx)
    8291FIND_PROGRAM(CURL_EXECUTABLE     curl)
    83 FIND_PROGRAM(GROFF_EXECUTABLE    groff)
    84 
    85 FIND_PACKAGE_HANDLE_STANDARD_ARGS(groff    DEFAULT_MSG GROFF_EXECUTABLE)
     92
    8693FIND_PACKAGE_HANDLE_STANDARD_ARGS(curl     DEFAULT_MSG CURL_EXECUTABLE)
    8794FIND_PACKAGE_HANDLE_STANDARD_ARGS(mailx    DEFAULT_MSG MAILX_EXECUTABLE)
    8895FIND_PACKAGE_HANDLE_STANDARD_ARGS(jsdoc    DEFAULT_MSG JSDOC_EXECUTABLE)
    89 FIND_PACKAGE_HANDLE_STANDARD_ARGS(help2man DEFAULT_MSG HELP2MAN_EXECUTABLE)
     96
     97ENDIF (NOT TOOLS_ONLY)
    9098
    9199#IF(NOT SOME_COND)
     
    101109FIND_PACKAGE(Threads  REQUIRED)  # Threads::Threads
    102110FIND_PACKAGE(ZLIB     REQUIRED)  # ZLIB::ZLIB
    103 FIND_PACKAGE(OpenGL   REQUIRED)  # OpenGL::GL OpenGL::GLU / OPENGL_FOUND OPENGL_GLU_FOUND
    104111
    105112SET(CURSES_NEED_NCURSES ON)
     
    107114# FIXME : Require  panel
    108115
     116IF(NOT TOOLS_ONLY)
     117
     118FIND_PACKAGE(OpenGL   REQUIRED)  # OpenGL::GL OpenGL::GLU / OPENGL_FOUND OPENGL_GLU_FOUND
     119
    109120# FIND_PACKAGE(DBus)    => skaypeclient
    110121# FIND_PACKAGE(Motif)   => did   # MOTIF_FOUND
     122
    111123FIND_PACKAGE(Readline REQUIRED)
    112124FIND_PACKAGE(Panel    REQUIRED)
     125FIND_PACKAGE(V8       REQUIRED)
     126FIND_PACKAGE(Cfitsio  REQUIRED)
     127FIND_PACKAGE(CCfits   REQUIRED)
     128
     129ENDIF(NOT TOOLS_ONLY)
     130
    113131FIND_PACKAGE(Nova     REQUIRED)
    114132FIND_PACKAGE(MySQL    REQUIRED)
    115133FIND_PACKAGE(MySQL++  REQUIRED)
    116 FIND_PACKAGE(V8       REQUIRED)
    117 FIND_PACKAGE(Cfitsio  REQUIRED)
    118 FIND_PACKAGE(CCfits   REQUIRED)
    119134FIND_PACKAGE(OpenSSL  REQUIRED)  # Required for boost::asio::ssl
    120135
     
    150165
    151166# =============== QT4 ==============
     167IF(NOT TOOLS_ONLY)
     168
    152169SET(CMAKE_INCLUDE_CURRENT_DIR ON)
    153170FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtOpenGL QtSql QtXml)
    154171FIND_PACKAGE(Qwt REQUIRED)
     172
     173ENDIF(NOT TOOLS_ONLY)
    155174
    156175# =========== Enable C++11 ===========
     
    236255# ********************** Libraries ***********************
    237256# ********************************************************
     257IF (NOT TOOLS_ONLY)
    238258
    239259# =================== libPointing.so ======================
     
    354374TARGET_LINK_LIBRARIES(StateMachine OpenSSL::SSL)
    355375
     376ENDIF (NOT TOOLS_ONLY)
     377
    356378# ================= libConfiguration.so ==================
    357379ADD_LIBRARY(Configuration SHARED
     
    410432        ADD_CUSTOM_TARGET(${program}.man ALL DEPENDS man1/${program}.1)
    411433
    412 #       INSTALL(FILES ${PROJECT_BINARY_DIR}/${program}.1 DESTINATION "${PKG_MAN}")
     434        INSTALL(FILES ${PROJECT_BINARY_DIR}/man1/${program}.1 DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
    413435
    414436ENDMACRO()
     
    427449ADD_EXECUTABLE(fitsdump src/fitsdump.cc)
    428450TARGET_LINK_LIBRARIES(fitsdump ${HELP++LIBS} ${ROOT_LIBRARIES} ZLIB::ZLIB)
    429 MANPAGE(fitsdump "")
     451MANPAGE(fitsdump "FACT++ - fitsdump - Read and dump contents of a FITStable")
    430452
    431453#ADD_EXECUTABLE(fitsloader src/fitsloader.cc)
     
    445467#MANPAGE(fitsselect "")
    446468
     469#ADD_EXECUTABLE(readfits src/readfits.cc)
     470#TARGET_LINK_LIBRARIES(readfits ${HELP++LIBS} ZLIB::ZLIB)
     471#MANPAGE(readfits "")
     472
     473ADD_EXECUTABLE(rootifysql src/rootifysql.cc)
     474TARGET_LINK_LIBRARIES(rootifysql ${HELP++LIBS} ${ROOT_LIBRARIES})
     475MANPAGE(rootifysql "FACT++ - rootifysql - Write result of a SQL query into a root-file")
     476
     477ADD_EXECUTABLE(root2sql src/root2sql.cc)
     478TARGET_LINK_LIBRARIES(root2sql ${HELP++LIBS} ${ROOT_LIBRARIES})
     479MANPAGE(root2sql "FACT++ - root2sql - Fill contents of a root-tree into a MySQL database")
     480
     481ADD_EXECUTABLE(fits2sql src/fits2sql.cc)
     482TARGET_LINK_LIBRARIES(fits2sql ${HELP++LIBS}  ZLIB::ZLIB)
     483MANPAGE(fits2sql "FACT++ - fits2sql - Fill contents of a FITS table into a MySQL database")
     484
     485ADD_EXECUTABLE(showlog src/showlog.cc src/WindowLog.cc)
     486TARGET_LINK_LIBRARIES(showlog Threads::Threads ${HELP++LIBS} ${CURSES_LIBRARIES})
     487MANPAGE(showlog "")
     488
     489ADD_EXECUTABLE(zfits src/zfits.cc)
     490TARGET_LINK_LIBRARIES(zfits ${HELP++LIBS} ZLIB::ZLIB)
     491MANPAGE(zfits "")
     492
     493IF (NOT TOOLS_ONLY)
     494
    447495ADD_EXECUTABLE(getevent src/getevent.cc)
    448496TARGET_LINK_LIBRARIES(getevent ${HELP++LIBS} ZLIB::ZLIB)
    449497MANPAGE(getevent "")
    450498
    451 #ADD_EXECUTABLE(readfits src/readfits.cc)
    452 #TARGET_LINK_LIBRARIES(readfits ${HELP++LIBS} ZLIB::ZLIB)
    453 #MANPAGE(readfits "")
    454 
    455 ADD_EXECUTABLE(rootifysql src/rootifysql.cc)
    456 TARGET_LINK_LIBRARIES(rootifysql ${HELP++LIBS} ${ROOT_LIBRARIES})
    457 MANPAGE(rootifysql "")
    458 
    459 ADD_EXECUTABLE(root2sql src/root2sql.cc)
    460 TARGET_LINK_LIBRARIES(root2sql ${HELP++LIBS} ${ROOT_LIBRARIES})
    461 MANPAGE(root2sql "")
    462 
    463 ADD_EXECUTABLE(fits2sql src/fits2sql.cc)
    464 TARGET_LINK_LIBRARIES(fits2sql ${HELP++LIBS}  ZLIB::ZLIB)
    465 MANPAGE(fits2sql "")
    466 
    467499ADD_EXECUTABLE(calcsource src/calcsource.cc)
    468500TARGET_LINK_LIBRARIES(calcsource ${HELP++LIBS} ${ROOT_LIBRARIES} ${NOVA_LIBRARY})
     
    480512TARGET_LINK_LIBRARIES(makeschedule ${HELP++LIBS} ${NOVA_LIBRARY})
    481513MANPAGE(makeschedule "")
    482 
    483 ADD_EXECUTABLE(showlog src/showlog.cc src/WindowLog.cc)
    484 TARGET_LINK_LIBRARIES(showlog Threads::Threads ${HELP++LIBS} ${CURSES_LIBRARIES})
    485 MANPAGE(showlog "")
    486 
    487 ADD_EXECUTABLE(zfits src/zfits.cc)
    488 TARGET_LINK_LIBRARIES(zfits ${HELP++LIBS} ZLIB::ZLIB)
    489 MANPAGE(zfits "")
    490 
    491 
    492514
    493515# ********************************************************
     
    735757#test_LDADD = libStateMachine.la libTools.la libTime.la libDim++.la libDim.la libConfiguration.la
    736758
    737 
     759ENDIF(NOT TOOLS_ONLY)
    738760
    739761
     
    787809ENDIF()
    788810
     811
     812# *********************************
     813# ********** Installation *********
     814# *********************************
     815
     816# ======== Setup directories ======
     817
     818# MESSAGE("")
     819# MESSAGE("PREFIX:         "${CMAKE_INSTALL_PREFIX})
     820# MESSAGE("")
     821# MESSAGE("BINDIR:         "${CMAKE_INSTALL_FULL_BINDIR})
     822# MESSAGE("SBINDIR:        "${CMAKE_INSTALL_FULL_SBINDIR})
     823# MESSAGE("LIBEXECDIR:     "${CMAKE_INSTALL_FULL_LIBEXECDIR})
     824# MESSAGE("SHAREDSTATEDIR: "${CMAKE_INSTALL_FULL_SHAREDSTATEDIR})
     825# MESSAGE("LOCALSTATEDIR:  "${CMAKE_INSTALL_FULL_LOCALSTATEDIR})
     826# MESSAGE("RUNSTATEDIR:    "${CMAKE_INSTALL_FULL_RUNSTATEDIR})
     827# MESSAGE("LIBDIR:         "${CMAKE_INSTALL_FULL_LIBDIR})
     828# MESSAGE("INCLUDEDIR:     "${CMAKE_INSTALL_FULL_INCLUDEDIR})
     829# MESSAGE("DATAROOTDIR:    "${CMAKE_INSTALL_FULL_DATAROOTDIR})
     830# MESSAGE("DATADIR:        "${CMAKE_INSTALL_FULL_DATADIR})
     831# MESSAGE("INFODIR:        "${CMAKE_INSTALL_FULL_INFODIR})
     832# MESSAGE("LOCALDIR:       "${CMAKE_INSTALL_FULL_LOCALDIR})
     833# MESSAGE("MANDIR:         "${CMAKE_INSTALL_FULL_MANDIR})
     834# MESSAGE("DOCDIR:         "${CMAKE_INSTALL_FULL_DOCDIR})
     835# MESSAGE("")
     836# MESSAGE("BINDIR:         "${CMAKE_INSTALL_BINDIR})
     837# MESSAGE("SBINDIR:        "${CMAKE_INSTALL_SBINDIR})
     838# MESSAGE("LIBEXECDIR:     "${CMAKE_INSTALL_LIBEXECDIR})
     839# MESSAGE("SHAREDSTATEDIR: "${CMAKE_INSTALL_SHAREDSTATEDIR})
     840# MESSAGE("LOCALSTATEDIR:  "${CMAKE_INSTALL_LOCALSTATEDIR})
     841# MESSAGE("RUNSTATEDIR:    "${CMAKE_INSTALL_RUNSTATEDIR})
     842# MESSAGE("LIBDIR:         "${CMAKE_INSTALL_LIBDIR})
     843# MESSAGE("INCLUDEDIR:     "${CMAKE_INSTALL_INCLUDEDIR})
     844# MESSAGE("DATAROOTDIR:    "${CMAKE_INSTALL_DATAROOTDIR})
     845# MESSAGE("DATADIR:        "${CMAKE_INSTALL_DATADIR})
     846# MESSAGE("INFODIR:        "${CMAKE_INSTALL_INFODIR})
     847# MESSAGE("LOCALDIR:       "${CMAKE_INSTALL_LOCALDIR})
     848# MESSAGE("MANDIR:         "${CMAKE_INSTALL_MANDIR})
     849# MESSAGE("DOCDIR:         "${CMAKE_INSTALL_DOCDIR})
     850# MESSAGE("")
     851
     852SET(PKG_SHARE    "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}")
     853SET(PKG_APPS     "${CMAKE_INSTALL_DATAROOTDIR}/applications")
     854SET(PKG_PIXMAPS  "${CMAKE_INSTALL_DATAROOTDIR}/pixmaps")
     855
     856# ====== Installation targets =====
     857
     858INSTALL(TARGETS  fits2sql       DESTINATION "${CMAKE_INSTALL_BINDIR}")
     859INSTALL(TARGETS  root2sql       DESTINATION "${CMAKE_INSTALL_BINDIR}")
     860INSTALL(TARGETS  fitsdump       DESTINATION "${CMAKE_INSTALL_BINDIR}")
     861INSTALL(TARGETS  zfits          DESTINATION "${CMAKE_INSTALL_BINDIR}")
     862INSTALL(TARGETS  showlog        DESTINATION "${CMAKE_INSTALL_BINDIR}")
     863INSTALL(TARGETS  rootifysql     DESTINATION "${CMAKE_INSTALL_BINDIR}")
     864INSTALL(TARGETS  Configuration  DESTINATION "${CMAKE_INSTALL_LIBDIR}")
     865INSTALL(TARGETS  Time           DESTINATION "${CMAKE_INSTALL_LIBDIR}")
     866INSTALL(TARGETS  Tools          DESTINATION "${CMAKE_INSTALL_LIBDIR}")
     867
     868#INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/html DESTINATION  "${PKG_SHARE}" FILES_MATCHING PATTERN "*.html")
     869#INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/pdf  DESTINATION  "${PKG_SHARE}" FILES_MATCHING PATTERN "*.pdf")
     870
     871# *********************************
     872# ************ Packaging **********
     873# *********************************
     874
     875# ======== General packaging ======
     876# https://cmake.org/cmake/help/latest/module/CPack.html
     877
     878INCLUDE(InstallRequiredSystemLibraries)
     879
     880# SET(CPACK_STRIP_FILES ON) # Strip debug sysmbold from files
     881
     882SET(CPACK_PACKAGE_VERSION       "${fact++_VERSION}")
     883SET(CPACK_PACKAGE_CONTACT       "${PACKAGE_BUGREPORT}")
     884SET(CPACK_PACKAGE_MAINTAINER    "${PACKAGE_MAINTAINER}")
     885SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
     886#SET(CPACK_PACKAGE_VENDOR "Me, myself, and I")
     887
     888
     889SET(CPACK_SOURCE_IGNORE_FILES "/old/;/build/;/[.].*/;/autom4te[.]cache/;.*~;.log$")
     890
     891# Maybe the text displayed in synaptic?
     892SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README")
     893SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "FACT++ - Toolset")
     894#CPACK_RESOURCE_FILE_README     ReadMe file to be embedded in the installer.
     895
     896SET(CPACK_GENERATOR        TBZ2 DEB) # TGZ
     897SET(CPACK_SOURCE_GENERATOR TBZ2)     # TGZ
     898#SET(CPACK_PROJECT_CONFIG_FILE ${CMAKE_SOURCE_DIR}/cmake/Package.txt)
     899#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
     900
     901
     902# ======== Debian packaging =======
     903# https://cmake.org/cmake/help/latest/module/CPackDeb.html
     904# https://www.debian.org/doc/debian-policy
     905
     906#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)")
     907SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS 1) # generate better (atomatic?) dependecies
     908SET(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=")
     909SET(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
     910SET(CPACK_DEBIAN_PACKAGE_SECTION utils)
     911SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "${PACKAGE_URL}")
     912SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION
     913"${CPACK_PACKAGE_DESCRIPTION_SUMMARY}
     914 This package contains some tools which are part of FACT++ to deal with databases, fits files and root-files.")
     915#indent the long description with spaces
     916
     917#CPACK_INSTALL_CMAKE_PROJECTS
     918#List of four values that specify what project to install. Build directory, Project Name, Project Component, Directory.
     919
     920INCLUDE(CPack)
Note: See TracChangeset for help on using the changeset viewer.