From bf6c5f2c8a155ee8a262e4ea437f85f799ffcd73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=B6jdh?= Date: Tue, 6 Oct 2026 20:09:56 +0200 Subject: [PATCH] port of RPM building and gitea workflows (#1601) --- .gitea/workflows/docker-rh8-build-rpm.yml | 97 +++++++++++++++++++ .gitea/workflows/docker-rh9-build-rpm.yml | 93 ++++++++++++++++++ CMakeLists.txt | 19 +++- cmake/SlsInstallExecutable.cmake | 30 ++++++ docs/src/installation.rst | 46 +++++++++ .../jungfrauExecutables/CMakeLists.txt | 4 +- .../moenchExecutables/CMakeLists.txt | 15 +-- slsDetectorGui/CMakeLists.txt | 6 +- .../ctbDetectorServer/CMakeLists.txt | 4 +- .../eigerDetectorServer/CMakeLists.txt | 4 +- .../gotthard2DetectorServer/CMakeLists.txt | 4 +- .../jungfrauDetectorServer/CMakeLists.txt | 3 +- .../matterhornServer/CMakeLists.txt | 8 +- .../moenchDetectorServer/CMakeLists.txt | 3 +- .../mythen3DetectorServer/CMakeLists.txt | 4 +- .../xilinx_ctbDetectorServer/CMakeLists.txt | 4 +- slsDetectorSoftware/CMakeLists.txt | 16 +-- slsReceiverSoftware/CMakeLists.txt | 16 +-- 18 files changed, 298 insertions(+), 78 deletions(-) create mode 100644 .gitea/workflows/docker-rh8-build-rpm.yml create mode 100644 .gitea/workflows/docker-rh9-build-rpm.yml create mode 100644 cmake/SlsInstallExecutable.cmake diff --git a/.gitea/workflows/docker-rh8-build-rpm.yml b/.gitea/workflows/docker-rh8-build-rpm.yml new file mode 100644 index 000000000..8ac0aa501 --- /dev/null +++ b/.gitea/workflows/docker-rh8-build-rpm.yml @@ -0,0 +1,97 @@ +name: Build RPMs on RHEL8 docker image + +on: + workflow_dispatch: + inputs: + deploy: + description: "Upload the RPMs to the Gitea package registry" + type: boolean + default: false + +permissions: + contents: read + +jobs: + build: + runs-on: "ubuntu-latest" + container: + image: gitea.psi.ch/detectors/rhel8-detectors-dev + steps: + - name: Clone repository + run: | + git lfs install --skip-smudge + echo Cloning ${{ github.ref_name }} + git clone https://${{secrets.GITHUB_TOKEN}}@gitea.psi.ch/${{ github.repository }}.git --branch=${{ github.ref_name }} . + + - name: Install build dependencies + run: | + dnf -y install rpm-build qt5-qtbase-devel qt5-qtsvg-devel \ + libpng-devel zlib-devel expat-devel libtiff-devel + + - name: Build with versioned binaries + run: | + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DSLS_USE_GUI=ON \ + -DSLS_USE_MOENCH=ON \ + -DSLS_INSTALL_VERSIONED_BINARIES=ON + cmake --build build -j 2 + + - name: Build RPMs + run: | + cpack --config build/CPackConfig.cmake -G RPM \ + -D 'CPACK_COMPONENTS_ALL=cli;receiver;zmq;gui' -B build/rpms + + - name: Inspect RPMs + run: | + for rpm in build/rpms/*.rpm; do + echo "::group::$rpm" + rpm -qpi "$rpm" + rpm -qpl "$rpm" + rpm -qpR "$rpm" + echo "::endgroup::" + done + + - name: Install RPMs and check versioned binaries + run: | + VERSION=$(cat VERSION) + dnf -y install build/rpms/*.rpm + for component in cli receiver zmq gui; do + rpm -q slsdetectorpackage-${VERSION}-${component} + done + for exe in sls_detector_get sls_detector_put slsReceiver \ + slsMultiReceiver slsFrameSynchronizer moench03ZmqProcess slsDetectorGui; do + test -x /usr/bin/${exe}-${VERSION} + test ! -e /usr/bin/${exe} + done + sls_detector_get-${VERSION} --version + slsReceiver-${VERSION} --version + + - name: Upload RPMs to Gitea + if: ${{ inputs.deploy }} + env: + SERVICE: ${{ secrets.SERVICE }} + run: | + url=https://gitea.psi.ch/api/packages/${{ github.repository_owner }}/rpm/el8 + upload() { + curl --silent --show-error --output /tmp/upload-response \ + --write-out "%{http_code}" \ + --user "detectors-gitea:${SERVICE}" \ + --upload-file "$1" "$url/upload" + } + for rpm in build/rpms/*.rpm; do + echo "Uploading $rpm" + code=$(upload "$rpm") + if [ "$code" = 409 ]; then + echo "Already in the registry, replacing" + curl --silent --show-error --fail -X DELETE \ + --user "detectors-gitea:${SERVICE}" \ + "$url/package/$(rpm -qp --queryformat '%{NAME}/%{VERSION}-%{RELEASE}/%{ARCH}' "$rpm")" + code=$(upload "$rpm") + fi + if [ "$code" != 201 ]; then + echo "Upload failed with HTTP $code" + cat /tmp/upload-response + exit 1 + fi + done diff --git a/.gitea/workflows/docker-rh9-build-rpm.yml b/.gitea/workflows/docker-rh9-build-rpm.yml new file mode 100644 index 000000000..09778b0f0 --- /dev/null +++ b/.gitea/workflows/docker-rh9-build-rpm.yml @@ -0,0 +1,93 @@ +name: Build RPMs on RHEL9 docker image + +on: + workflow_dispatch: + inputs: + deploy: + description: "Upload the RPMs to the Gitea package registry" + type: boolean + default: false + +permissions: + contents: read + +jobs: + build: + runs-on: "ubuntu-latest" + container: + image: gitea.psi.ch/detectors/rhel9-detectors-dev + steps: + - uses: actions/checkout@v4 + + - name: Install build dependencies + run: | + dnf -y install rpm-build qt5-qtbase-devel qt5-qtsvg-devel \ + libpng-devel zlib-devel expat-devel libtiff-devel + + - name: Build with versioned binaries + run: | + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DSLS_USE_GUI=ON \ + -DSLS_USE_MOENCH=ON \ + -DSLS_INSTALL_VERSIONED_BINARIES=ON + cmake --build build -j 2 + + - name: Build RPMs + run: | + cpack --config build/CPackConfig.cmake -G RPM \ + -D 'CPACK_COMPONENTS_ALL=cli;receiver;zmq;gui' -B build/rpms + + - name: Inspect RPMs + run: | + for rpm in build/rpms/*.rpm; do + echo "::group::$rpm" + rpm -qpi "$rpm" + rpm -qpl "$rpm" + rpm -qpR "$rpm" + echo "::endgroup::" + done + + - name: Install RPMs and check versioned binaries + run: | + VERSION=$(cat VERSION) + dnf -y install build/rpms/*.rpm + for component in cli receiver zmq gui; do + rpm -q slsdetectorpackage-${VERSION}-${component} + done + for exe in sls_detector_get sls_detector_put slsReceiver \ + slsMultiReceiver slsFrameSynchronizer moench03ZmqProcess slsDetectorGui; do + test -x /usr/bin/${exe}-${VERSION} + test ! -e /usr/bin/${exe} + done + sls_detector_get-${VERSION} --version + slsReceiver-${VERSION} --version + + - name: Upload RPMs to Gitea + if: ${{ inputs.deploy }} + env: + SERVICE: ${{ secrets.SERVICE }} + run: | + url=https://gitea.psi.ch/api/packages/${{ github.repository_owner }}/rpm/el9 + upload() { + curl --silent --show-error --output /tmp/upload-response \ + --write-out "%{http_code}" \ + --user "detectors-gitea:${SERVICE}" \ + --upload-file "$1" "$url/upload" + } + for rpm in build/rpms/*.rpm; do + echo "Uploading $rpm" + code=$(upload "$rpm") + if [ "$code" = 409 ]; then + echo "Already in the registry, replacing" + curl --silent --show-error --fail -X DELETE \ + --user "detectors-gitea:${SERVICE}" \ + "$url/package/$(rpm -qp --queryformat '%{NAME}/%{VERSION}-%{RELEASE}/%{ARCH}' "$rpm")" + code=$(upload "$rpm") + fi + if [ "$code" != 201 ]; then + echo "Upload failed with HTTP $code" + cat /tmp/upload-response + exit 1 + fi + done diff --git a/CMakeLists.txt b/CMakeLists.txt index 8657e2a68..c5a9cd54c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ endif() include(cmake/project_version.cmake) include(cmake/SlsAddFlag.cmake) include(cmake/helpers.cmake) +include(cmake/SlsInstallExecutable.cmake) find_package(Threads REQUIRED) @@ -234,7 +235,7 @@ option(SLS_DEVEL_HEADERS "install headers for devel" OFF) option(SLS_USE_MOENCH "compile zmq and post processing for Moench" OFF) option(SLS_USE_JUNGFRAU "compile post processing for Jungfrau" OFF) option(SLS_USE_MATTERHORN "compile matterhorn server" OFF) -option(SLS_INSTALL_VERSIONED_BINARIES "Add version number to binaries on install" OFF) #Needed for multi version RPM +option(SLS_INSTALL_VERSIONED_BINARIES "Add version number to installed executables and RPM package names" OFF) option(SLS_TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF) #Convenience option to switch off defaults when building Moench binaries only @@ -520,14 +521,18 @@ set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "DAQ software for PSI developed detectors") # RPM-specific settings +string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME) +if(SLS_INSTALL_VERSIONED_BINARIES) + string(APPEND CPACK_RPM_PACKAGE_NAME "-${PROJECT_VERSION}") +endif() set(CPACK_GENERATOR "RPM") -set(CPACK_RPM_FILE_NAME "RPM-DEFAULT") +set(CPACK_RPM_FILE_NAME + "${PROJECT_NAME_LOWER}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm") set(CPACK_RPM_PACKAGE_LICENSE "LGPL-3.0") set(CPACK_RPM_PACKAGE_GROUP "Applications/System") set(CPACK_RPM_PACKAGE_RELEASE 1) # Adds %{?dist} to the RPM Release field set(CPACK_RPM_PACKAGE_RELEASE_DIST ON) -set(CPACK_RPM_PACKAGE_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}") set(CPACK_RPM_COMPONENT_INSTALL ON) @@ -537,4 +542,10 @@ set(CPACK_RPM_GUI_PACKAGE_REQUIRES #control which RPMs are generated set(CPACK_COMPONENTS_ALL cli receiver zmq gui) -include(CPack) \ No newline at end of file +# Keep the project version only once in filenames; RPM expands its metadata. +foreach(component IN LISTS CPACK_COMPONENTS_ALL) + string(TOUPPER "${component}" component_upper) + set(CPACK_RPM_${component_upper}_FILE_NAME + "${PROJECT_NAME_LOWER}-${component}-%{VERSION}-%{RELEASE}.%{ARCH}.rpm") +endforeach() +include(CPack) diff --git a/cmake/SlsInstallExecutable.cmake b/cmake/SlsInstallExecutable.cmake new file mode 100644 index 000000000..e8704d1ea --- /dev/null +++ b/cmake/SlsInstallExecutable.cmake @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: LGPL-3.0-or-other +# Copyright (C) 2026 Contributors to the SLS Detector Package + +function(sls_install_executable target) + cmake_parse_arguments(ARG "" "DESTINATION;COMPONENT;EXPORT" "" ${ARGN}) + if(NOT ARG_DESTINATION) + set(ARG_DESTINATION "${CMAKE_INSTALL_BINDIR}") + endif() + + set(install_args DESTINATION "${ARG_DESTINATION}") + if(ARG_COMPONENT) + list(APPEND install_args COMPONENT "${ARG_COMPONENT}") + endif() + + if(SLS_INSTALL_VERSIONED_BINARIES) + install(PROGRAMS "$" + ${install_args} + RENAME "$-${PROJECT_VERSION}${CMAKE_EXECUTABLE_SUFFIX}" + ) + else() + set(export_args) + if(ARG_EXPORT) + list(APPEND export_args EXPORT "${ARG_EXPORT}") + endif() + install(TARGETS ${target} + ${export_args} + RUNTIME ${install_args} + ) + endif() +endfunction() diff --git a/docs/src/installation.rst b/docs/src/installation.rst index 926248843..43506b25d 100644 --- a/docs/src/installation.rst +++ b/docs/src/installation.rst @@ -240,6 +240,52 @@ Example cmake options Comment For v7.x.x of slsDetectorPackage and older, refer :ref:`zeromq notes for cmk script option to hint library location. ` +3.2.3. Build RPM packages +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +CPack builds separate RPMs for the command line tools (``cli``), receiver +executables (``receiver``), Moench processing tools (``zmq``), and GUI (``gui``). +Install ``rpm-build`` and the dependencies for the selected features, and build +on the target distribution or a matching container. + +For example, to package the command line tools, receiver and GUI: + +.. code-block:: bash + + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr -DSLS_USE_GUI=ON \ + -DSLS_INSTALL_VERSIONED_BINARIES=ON + cmake --build build -j4 + cpack --config build/CPackConfig.cmake -G RPM \ + -D 'CPACK_COMPONENTS_ALL=cli;receiver;gui' -B build + +Select only components enabled in the build. Add ``-DSLS_USE_MOENCH=ON`` and +the ``zmq`` component to package the Moench tools. + +``SLS_INSTALL_VERSIONED_BINARIES=ON`` includes the project version in the RPM +package names, for example ``slsdetectorpackage-10.1.0-cli`` and +``slsdetectorpackage-10.1.0-gui``. Installed executables also receive a version +suffix, such as ``sls_detector_get-10.1.0`` and ``slsDetectorGui-10.1.0``. This +allows RPMs for different project versions to be installed side by side. +RPM revisions of the same project version retain the same package names and +can be upgraded normally. + +RPM filenames include the version once, for example +``slsdetectorpackage-cli-10.1.0-1.fc44.x86_64.rpm``. The package's internal name +remains ``slsdetectorpackage-10.1.0-cli`` and its RPM version remains ``10.1.0``. + +The option also applies to Jungfrau processing tools and virtual detector +servers installed with ``cmake --install``. These are outside the current RPM +component selection. Executables in the build directory keep their original +names. With the option set to ``OFF`` (the default), installed executables and +RPM package names omit the project version. + +The RPM components contain executables; Python bindings, libraries and headers +are not included. A full ``cmake --install`` still installs libraries and +headers at their usual paths, so use separate prefixes for full installations +of different versions. + + 3.3. Build on old distributions using conda ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/slsDetectorCalibration/jungfrauExecutables/CMakeLists.txt b/slsDetectorCalibration/jungfrauExecutables/CMakeLists.txt index dc0f0690f..6f1fa6fd1 100644 --- a/slsDetectorCalibration/jungfrauExecutables/CMakeLists.txt +++ b/slsDetectorCalibration/jungfrauExecutables/CMakeLists.txt @@ -92,7 +92,5 @@ foreach(exe ${JUNGFRAU_EXECUTABLES}) set_property(TARGET ${exe} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) endif() - + sls_install_executable(${exe} DESTINATION bin) endforeach(exe ${JUNGFRAU_EXECUTABLES}) - -install(TARGETS ${JUNGFRAU_EXECUTABLES} DESTINATION bin) \ No newline at end of file diff --git a/slsDetectorCalibration/moenchExecutables/CMakeLists.txt b/slsDetectorCalibration/moenchExecutables/CMakeLists.txt index 55faa558d..8379f5eb9 100644 --- a/slsDetectorCalibration/moenchExecutables/CMakeLists.txt +++ b/slsDetectorCalibration/moenchExecutables/CMakeLists.txt @@ -92,19 +92,6 @@ foreach(exe ${MOENCH_EXECUTABLES}) set_property(TARGET ${exe} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) endif() - # Mainly for RPMs to enable side by side installations of different versions - if(SLS_INSTALL_VERSIONED_BINARIES) - install(PROGRAMS "$" - DESTINATION bin - RENAME "$-${PROJECT_VERSION}" - COMPONENT zmq - ) - else() - install(TARGETS ${exe} - DESTINATION bin - COMPONENT zmq - ) - endif() + sls_install_executable(${exe} DESTINATION bin COMPONENT zmq) endforeach(exe ${MOENCH_EXECUTABLES}) - diff --git a/slsDetectorGui/CMakeLists.txt b/slsDetectorGui/CMakeLists.txt index 992bfe3ef..b78ccdd95 100755 --- a/slsDetectorGui/CMakeLists.txt +++ b/slsDetectorGui/CMakeLists.txt @@ -119,8 +119,4 @@ if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE) set_property(TARGET slsDetectorGui PROPERTY INTERPROCEDURAL_OPTIMIZATION True) endif() -install(TARGETS slsDetectorGui - # EXPORT "${TARGETS_EXPORT_NAME}" #do not export gui - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT gui -) - +sls_install_executable(slsDetectorGui COMPONENT gui) diff --git a/slsDetectorServers/ctbDetectorServer/CMakeLists.txt b/slsDetectorServers/ctbDetectorServer/CMakeLists.txt index 1a9c4b5af..438930ffa 100644 --- a/slsDetectorServers/ctbDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/ctbDetectorServer/CMakeLists.txt @@ -44,6 +44,4 @@ set_target_properties(ctbDetectorServer_virtual PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -install(TARGETS ctbDetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +sls_install_executable(ctbDetectorServer_virtual) diff --git a/slsDetectorServers/eigerDetectorServer/CMakeLists.txt b/slsDetectorServers/eigerDetectorServer/CMakeLists.txt index dd0404aac..5abe8bdf8 100644 --- a/slsDetectorServers/eigerDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/eigerDetectorServer/CMakeLists.txt @@ -38,9 +38,7 @@ set_target_properties(eigerDetectorServer_virtual PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -install(TARGETS eigerDetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +sls_install_executable(eigerDetectorServer_virtual) configure_file(config_eiger.txt ${CMAKE_BINARY_DIR}/bin/config_eiger.txt COPYONLY) diff --git a/slsDetectorServers/gotthard2DetectorServer/CMakeLists.txt b/slsDetectorServers/gotthard2DetectorServer/CMakeLists.txt index 7a5201c0e..be01f273f 100644 --- a/slsDetectorServers/gotthard2DetectorServer/CMakeLists.txt +++ b/slsDetectorServers/gotthard2DetectorServer/CMakeLists.txt @@ -39,9 +39,7 @@ set_target_properties(gotthard2DetectorServer_virtual PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -install(TARGETS gotthard2DetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +sls_install_executable(gotthard2DetectorServer_virtual) configure_file(config_gotthard2.txt ${CMAKE_BINARY_DIR}/bin/config_gotthard2.txt COPYONLY) configure_file(detid_gotthard2.txt ${CMAKE_BINARY_DIR}/bin/detid_gotthard2.txt COPYONLY) diff --git a/slsDetectorServers/jungfrauDetectorServer/CMakeLists.txt b/slsDetectorServers/jungfrauDetectorServer/CMakeLists.txt index 678cea963..55ff80edc 100644 --- a/slsDetectorServers/jungfrauDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/jungfrauDetectorServer/CMakeLists.txt @@ -41,9 +41,8 @@ set_target_properties(jungfrauDetectorServer_virtual PROPERTIES #target_compile_options(jungfrauDetectorServer_virtual PRIVATE -m32) #target_link_options(jungfrauDetectorServer_virtual PRIVATE -m32) -install(TARGETS jungfrauDetectorServer_virtual +sls_install_executable(jungfrauDetectorServer_virtual EXPORT "${TARGETS_EXPORT_NAME}" - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) configure_file(config_jungfrau.txt ${CMAKE_BINARY_DIR}/bin/config_jungfrau.txt COPYONLY) diff --git a/slsDetectorServers/matterhornServer/CMakeLists.txt b/slsDetectorServers/matterhornServer/CMakeLists.txt index 34d539b08..e0a55f5e6 100644 --- a/slsDetectorServers/matterhornServer/CMakeLists.txt +++ b/slsDetectorServers/matterhornServer/CMakeLists.txt @@ -41,9 +41,7 @@ if(SLS_USE_SIMULATOR) RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) - install(TARGETS matterhornDetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ) + sls_install_executable(matterhornDetectorServer_virtual) endif() # maybe better to have a else if build with simulators on one always uses the virtual server in MatterhornApp if(SLS_USE_MATTERHORN) @@ -91,9 +89,7 @@ if(SLS_USE_MATTERHORN) RUNTIME_OUTPUT_DIRECTORY ${RUNTIME_OUTPUT_DIRECTORY} ) - install(TARGETS matterhornDetectorServer - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ) + sls_install_executable(matterhornDetectorServer) endif() if(SLS_USE_TESTS) diff --git a/slsDetectorServers/moenchDetectorServer/CMakeLists.txt b/slsDetectorServers/moenchDetectorServer/CMakeLists.txt index dc664d7e4..2ee45681b 100644 --- a/slsDetectorServers/moenchDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/moenchDetectorServer/CMakeLists.txt @@ -37,9 +37,8 @@ set_target_properties(moenchDetectorServer_virtual PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -install(TARGETS moenchDetectorServer_virtual +sls_install_executable(moenchDetectorServer_virtual EXPORT "${TARGETS_EXPORT_NAME}" - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) configure_file(detid_moench.txt ${CMAKE_BINARY_DIR}/bin/detid_moench.txt COPYONLY) diff --git a/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt b/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt index 10cffa217..6a942ddb4 100644 --- a/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt +++ b/slsDetectorServers/mythen3DetectorServer/CMakeLists.txt @@ -41,9 +41,7 @@ set_target_properties(mythen3DetectorServer_virtual PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -install(TARGETS mythen3DetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +sls_install_executable(mythen3DetectorServer_virtual) configure_file(DefaultPattern_mythen3.txt ${CMAKE_BINARY_DIR}/bin/DefaultPattern_mythen3.txt COPYONLY) configure_file(detid_mythen3.txt ${CMAKE_BINARY_DIR}/bin/detid_mythen3.txt COPYONLY) diff --git a/slsDetectorServers/xilinx_ctbDetectorServer/CMakeLists.txt b/slsDetectorServers/xilinx_ctbDetectorServer/CMakeLists.txt index 284c9b6fc..2fee93ca8 100644 --- a/slsDetectorServers/xilinx_ctbDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/xilinx_ctbDetectorServer/CMakeLists.txt @@ -41,9 +41,7 @@ set_target_properties(xilinx_ctbDetectorServer_virtual PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) -install(TARGETS xilinx_ctbDetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) +sls_install_executable(xilinx_ctbDetectorServer_virtual) configure_file(chip_config_xilinx.txt ${CMAKE_BINARY_DIR}/bin/chip_config_xilinx.txt COPYONLY) configure_file(reset_chip_xilinx.txt ${CMAKE_BINARY_DIR}/bin/reset_chip_xilinx.txt COPYONLY) diff --git a/slsDetectorSoftware/CMakeLists.txt b/slsDetectorSoftware/CMakeLists.txt index 472205230..bccb64498 100755 --- a/slsDetectorSoftware/CMakeLists.txt +++ b/slsDetectorSoftware/CMakeLists.txt @@ -109,21 +109,9 @@ if(SLS_USE_TEXTCLIENT) set_property(TARGET ${val1} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) endif() - # Mainly for RPMs to enable side by side installations of different versions - if(SLS_INSTALL_VERSIONED_BINARIES) - install(PROGRAMS "$" - DESTINATION bin - RENAME "$-${PROJECT_VERSION}" - COMPONENT cli - ) - else() - install(TARGETS ${val1} - DESTINATION bin - COMPONENT cli - ) - endif() + sls_install_executable(${val1} DESTINATION bin COMPONENT cli) endforeach() - + endif(SLS_USE_TEXTCLIENT) diff --git a/slsReceiverSoftware/CMakeLists.txt b/slsReceiverSoftware/CMakeLists.txt index be56105b5..8c00cd8eb 100755 --- a/slsReceiverSoftware/CMakeLists.txt +++ b/slsReceiverSoftware/CMakeLists.txt @@ -173,22 +173,12 @@ if (SLS_USE_RECEIVER_BINARIES) slsMultiReceiver slsFrameSynchronizer ) - if(SLS_INSTALL_VERSIONED_BINARIES) - message(STATUS "Versioned binaries will be installed") - foreach(target IN LISTS SLS_RECEIVER_BINARIES) - install(PROGRAMS "$" - DESTINATION ${CMAKE_INSTALL_BINDIR} - RENAME "$-${PROJECT_VERSION}" - COMPONENT receiver - ) - endforeach() - else() - install(TARGETS ${SLS_RECEIVER_BINARIES} + foreach(target IN LISTS SLS_RECEIVER_BINARIES) + sls_install_executable(${target} EXPORT "${TARGETS_EXPORT_NAME}" - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT receiver ) - endif() + endforeach()