cmake_minimum_required(VERSION 3.13.4) # -------------------------------------------------------------------------- # Package and CMake setup # set the project name project(trdce) # use additional local modules, using contributions from # - https://github.com/rpavlik/cmake-modules list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") # include(GetGitRevisionDescription) # find required packages find_package(LibTRD) # DIM does not support CMake packages (yet), so let's hardcode it # find_package(DIM) include_directories(/usr/local/arm/rootfs/usr/include/dim) link_libraries(/usr/local/arm/rootfs/usr/lib/libdim.so) # get version number from git tags, ignoring the initial v # git_describe_working_tree(GITDESC --tags --match "v[0-9]*") # string(SUBSTRING ${GITDESC} 1 -1 VERSION) # if the version is not found (e.g. in a tarball), get if from the directory # if(VERSION STREQUAL "128-NOTFOUND") # string(REGEX REPLACE ".*/trapcc-v([0-9\.]+)" "\\1" VERSION ${CMAKE_SOURCE_DIR}) # endif() set(VERSION 1.2.4) # message("Version ${VERSION}") # -------------------------------------------------------------------------- # Packaging set(CPACK_PACKAGE_VERSION ${VERSION}) # set(CPACK_GENERATOR "RPM") set(CPACK_GENERATOR "DEB") set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME}) set(CPACK_PACKAGE_RELEASE 1) set(CPACK_PACKAGE_CONTACT "Tom Dietel") set(CPACK_PACKAGE_VENDOR "ALICE TRD") set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") # set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) # set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}.ipkg") set(CPACK_DEBIAN_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.ipk") # # # set(CPACK_SOURCE_IGNORE_FILES # # \\.git/ # # build/ # # debian/ # # ".*~$" # # ) include(CPack) # -------------------------------------------------------------------------- # Build instructions # include file with the version number # configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in config.h) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/feeserver) include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(/usr/local/arm/rootfs/usr/include) add_library(libtrdce SHARED cestatemachine.cc readout_flags.cc roc_control.cc roc_executor.cc gaintables.cc odimlogbuffer.cc hardware_base.cc extendedscsncommandstack.cc trdce_factory.cc ce_interface.cc fpga_control.cc tempcontrol/tempcontrol.cc tempcontrol/mcmchip.cc feeserver/dim_services.cc tests/testfactory.cc tests/testclass.cc tests/testori.cc tests/testlaserid.cc tests/testmem.cc tests/testreset.cc tests/testshutdown.cc tests/testbridge.cc tests/testni.cc ) add_executable(trdfs feeserver/trdfs.cc) target_link_libraries(trdfs libTRD::TRD libtrdce pthread) # install the executable # install(TARGETS trapcc DESTINATION bin) install(TARGETS libtrdce DESTINATION lib) # Also install the include files. These should also be built... # install( # FILES contrib/config.inc contrib/conf_va.inc # DESTINATION "share/trap" # ) # -------------------------------------------------------------------------- # enable_testing() # # add_test(NAME Errors COMMAND trapcc tests/error.tcs) # set_tests_properties(Errors PROPERTIES # PASS_REGULAR_EXPRESSION "WARNING: this is a warning" # ) # set_tests_properties(Errors PROPERTIES # FAIL_REGULAR_EXPRESSION "this text should not be printed" # )