Changeset 19883


Ignore:
Timestamp:
12/11/19 20:09:33 (5 years ago)
Author:
tbretz
Message:
Added spectrum program, added support for binary resources linked into the executable, define HAVE_ROOT only if ROOT was found, look for GNU Highlight, set HAVE_HIGHLIGHT if found.
File:
1 edited

Legend:

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

    r19855 r19883  
    166166FIND_PACKAGE(Nova     REQUIRED)
    167167
     168FIND_PACKAGE(Highlight)
     169IF (HIGHLIGHT_FOUND)
     170   ADD_DEFINITIONS(-DHAVE_HIGHLIGHT)
     171ENDIF()
     172
     173
    168174#INCLUDE_DIRECTORIES("/usr/include/mysql")
    169175# dbus-1 dbus-glib-1
     
    306312   SET(ROOTVER ${ROOT_VERSION} CACHE INTERNAL "Internal variable to check for consistency of root version")
    307313
     314   ADD_DEFINITIONS(-DHAVE_ROOT)
     315
    308316ENDIF(NOT NO_ROOT AND NOT VIEWER_ONLY)
    309317
     
    361369        "${CMAKE_CXX_FLAGS} \
    362370         -D_REENTRANT -D__LINUX__ \
    363          -DHAVE_ZLIB -DHAVE_ROOT -DHAVE_V8 -DHAVE_SQL -DHAVE_NOVA -DHAVE_FITS -DPRESET_OBSERVATORY=k${OBSERVATORY} \
     371         -DHAVE_ZLIB -DHAVE_V8 -DHAVE_SQL -DHAVE_NOVA -DHAVE_FITS -DPRESET_OBSERVATORY=k${OBSERVATORY} \
    364372         -DMARSVER=\\\"${VERSION}\\\" \
    365373         -DPACKAGE_VERSION=\\\"${VERSION}\\\" \
     
    559567
    560568MACRO(MANPAGE program description)
    561 # https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
    562 IF (HELP2MAN_EXECUTABLE AND ROFF2HTML_EXECUTABLE AND ROFF2PDF_EXECUTABLE AND GROFF_EXECUTABLE)
     569   # https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
     570   IF (HELP2MAN_EXECUTABLE AND ROFF2HTML_EXECUTABLE AND ROFF2PDF_EXECUTABLE AND GROFF_EXECUTABLE)
    563571        ADD_CUSTOM_COMMAND(
    564572                OUTPUT
     
    587595
    588596        INSTALL(FILES ${PROJECT_BINARY_DIR}/man1/${program}.1 DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
    589 ENDIF()
     597   ENDIF()
    590598ENDMACRO()
    591599
     600
     601# ********************************************************
     602# ********************* Resources ************************
     603# ********************************************************
     604
     605FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/res)
     606
     607FUNCTION(ADD_RESOURCES)
     608    FOREACH(resource ${ARGV})
     609        STRING(MAKE_C_IDENTIFIER ${resource} identifier)
     610        ADD_CUSTOM_COMMAND(
     611            OUTPUT  "${PROJECT_BINARY_DIR}/res/${identifier}.o"
     612            COMMAND ${CMAKE_LINKER} --relocatable --format binary --output "${PROJECT_BINARY_DIR}/res/${identifier}.o" ${resource}
     613            DEPENDS ${resource}
     614            WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
     615        )
     616    ENDFOREACH()
     617ENDFUNCTION()
    592618
    593619
     
    663689   MANPAGE(calcsourcemc "")
    664690ENDIF()
     691
     692ADD_EXECUTABLE(spectrum src/spectrum.cc src/WindowLog.cc res/spectrum_data_sql.o res/spectrum_simulation_sql.o res/spectrum_analysis_sql.o)
     693TARGET_LINK_LIBRARIES(spectrum Threads::Threads ${CURSES_LIBRARIES} ${HIGHLIGHT_LIBRARY} ${HELP++LIBS} ${ROOT_LIBRARIES})
     694ADD_RESOURCES(spectrum/analysis.sql spectrum/data.sql spectrum/simulation.sql)
     695MANPAGE(spectrum "")
    665696
    666697ADD_EXECUTABLE(getevent src/getevent.cc)
Note: See TracChangeset for help on using the changeset viewer.