Files
Jungfraujoch/viewer/CMakeLists.txt
T
leonarski_f 84228bf8be
Build Packages / Create release (push) Successful in 24s
Build Packages / build:viewer:macos-arm64:nocuda (push) Successful in 3m29s
Build Packages / build:rugnux:macos-arm64:nocuda (push) Successful in 2m43s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 8m27s
Build Packages / build:rugnux:linux-x86_64:cuda (push) Successful in 9m53s
Build Packages / build:viewer:linux-x86_64:nocuda (push) Successful in 9m58s
Build Packages / build:viewer:linux-x86_64:cuda (push) Successful in 11m22s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 13m39s
Build Packages / build:viewer:windows-x86_64:nocuda (push) Successful in 18m37s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 16m32s
Build Packages / build:viewer:windows-x86_64:cuda (push) Successful in 24m11s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 25m30s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 19m3s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 20m23s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 19m41s
Build Packages / Generate python client (push) Successful in 50s
Build Packages / Build documentation (push) Successful in 1m16s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 21m0s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 18m38s
Build Packages / build:rugnux:windows-x86_64:cuda (push) Successful in 14m33s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 17m55s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 20m50s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 18m38s
Build Packages / Unit tests (push) Successful in 1h46m14s
v1.0.0-rc.173 (#83)
* jfjoch_broker: Optional per-dataset authentication - statistics, images and plots can require a bearer token, which jfjoch_viewer supports.
* jfjoch_viewer: Dark mode and a theme-matched colour scheme, a magnifier panel, and simpler contrast and background controls.
* Rugnux: Multiple performance improvements on GPU and CPU (CPU-only processing up to 40% faster, faster image decoding on ARM), with unchanged results.
* Rugnux: `--model` rigid-body refinement runs on the GPU, and the model-validation check is faster and more reliable.
* Rugnux: Improved scaling and merging - error model, outlier rejection, absorption correction and French-Wilson amplitudes now agree more closely with XDS and ctruncate.
* Rugnux: Improved integration - radial background on powder and ice rings, crowded rotation data keep their reflections, and CPU-only builds integrate large unit cells as GPU builds do.
* Rugnux: More robust detector geometry - measured beam centre, X-ray bandwidth and goniometer rate, and geometry refinement accepted only on significant evidence.
* Rugnux: Merged files are written in the standard setting, or in the setting of a reference MTZ, structure-factor mmCIF or model, with its free-R flags.
* Rugnux: Richer report - ice and powder rings, further lattices, superstructure candidates and mosaicity, with warnings worded as prompts to check.
* Rugnux: Clear error messages when a data set needs more GPU or host memory than is available.

Reviewed-on: #83
Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
2026-09-29 15:57:32 +02:00

238 lines
11 KiB
CMake

# SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
# SPDX-License-Identifier: GPL-3.0-only
SET(CMAKE_AUTOMOC ON)
SET(CMAKE_AUTOUIC ON)
# D-Bus (single-instance / remote control) is Linux-only: Qt6::DBus does not
# exist on Windows or macOS. Default ON on Linux, OFF elsewhere.
IF(UNIX AND NOT APPLE)
OPTION(JFJOCH_VIEWER_DBUS "Build viewer with D-Bus support (Linux only)" ON)
ELSE()
OPTION(JFJOCH_VIEWER_DBUS "Build viewer with D-Bus support (Linux only)" OFF)
ENDIF()
SET(JFJOCH_VIEWER_QT_COMPONENTS Core Gui Widgets Charts Concurrent)
IF(JFJOCH_VIEWER_DBUS)
LIST(APPEND JFJOCH_VIEWER_QT_COMPONENTS DBus)
ENDIF()
FIND_PACKAGE(Qt6 COMPONENTS ${JFJOCH_VIEWER_QT_COMPONENTS} REQUIRED)
QT_ADD_RESOURCES(APP_RESOURCES resources/resources.qrc)
ADD_EXECUTABLE(jfjoch_viewer jfjoch_viewer.cpp JFJochViewerWindow.cpp JFJochViewerWindow.h
JFJochViewerMenu.cpp
JFJochViewerMenu.h
RemoteDisplayMode.cpp
RemoteDisplayMode.h
ViewerTheme.cpp
ViewerTheme.h
image_viewer/JFJochDiffractionImage.cpp
image_viewer/JFJochDiffractionImage.h
image_viewer/JFJochSimpleImage.cpp
image_viewer/JFJochSimpleImage.h
JFJochImageReadingWorker.cpp
JFJochImageReadingWorker.h
JFJochHttpReader.cpp
JFJochHttpReader.h
RunData.h
JFJochProcessController.cpp
JFJochProcessController.h
JFJochViewerDatasetInfo.cpp
JFJochViewerDatasetInfo.h
JFJochViewerSidePanel.cpp
JFJochViewerSidePanel.h
widgets/TitleLabel.cpp
widgets/TitleLabel.h
charts/JFJochDatasetInfoChartView.cpp
charts/JFJochDatasetInfoChartView.h
widgets/JFJochViewerImageStatistics.cpp
widgets/JFJochViewerImageStatistics.h
charts/JFJochSimpleChartView.cpp
charts/JFJochSimpleChartView.h
JFJochViewerStatusBar.cpp
JFJochViewerStatusBar.h
windows/JFJochViewerImageListWindow.cpp
windows/JFJochViewerImageListWindow.h
widgets/NumericComboBox.cpp
widgets/NumericComboBox.h
windows/JFJochViewerMetadataWindow.cpp
windows/JFJochViewerMetadataWindow.h
windows/JFJochMergeStatsWindow.cpp
windows/JFJochMergeStatsWindow.h
windows/JFJochCalibrationResultWindow.cpp
windows/JFJochCalibrationResultWindow.h
widgets/JFJochViewerMagnifier.cpp
widgets/JFJochViewerMagnifier.h
widgets/NumberLineEdit.cpp
widgets/NumberLineEdit.h
widgets/SliderPlusBox.cpp
widgets/SliderPlusBox.h
widgets/JFJochViewerSidePanelChart.cpp
widgets/JFJochViewerSidePanelChart.h
widgets/JFJochViewerSettingsDock.cpp
widgets/JFJochViewerSettingsDock.h
widgets/CollapsibleSection.cpp
widgets/CollapsibleSection.h
widgets/ToolbarIcons.cpp
widgets/ToolbarIcons.h
widgets/JFJochViewerFileBrowser.cpp
widgets/JFJochViewerFileBrowser.h
windows/JFJochViewerSpotListWindow.cpp
windows/JFJochViewerSpotListWindow.h
image_viewer/JFJochAzIntImage.cpp
image_viewer/JFJochAzIntImage.h
windows/JFJochViewerReflectionListWindow.cpp
windows/JFJochViewerReflectionListWindow.h
toolbar/JFJochViewerToolbarImage.cpp
toolbar/JFJochViewerToolbarImage.h
toolbar/JFJochViewerToolbarDisplay.cpp
toolbar/JFJochViewerToolbarDisplay.h
SimpleImage.h
windows/JFJochCalibrationWindow.cpp
windows/JFJochCalibrationWindow.h
windows/JFJochHelperWindow.cpp
windows/JFJochHelperWindow.h
windows/JFJochLicenseWindow.cpp
windows/JFJochLicenseWindow.h
windows/JFJochMouseShortcutsWindow.cpp
windows/JFJochMouseShortcutsWindow.h
windows/JFJochAcknowledgementWindow.cpp
windows/JFJochAcknowledgementWindow.h
image_viewer/JFJochImage.cpp
image_viewer/JFJochImage.h
image_viewer/JFJochFollowerImage.cpp
image_viewer/JFJochFollowerImage.h
windows/JFJoch2DAzintImageWindow.cpp
windows/JFJoch2DAzintImageWindow.h
widgets/JFJochViewerROIResult.cpp
widgets/JFJochViewerROIResult.h
widgets/JFJochViewerROIList.cpp
widgets/JFJochViewerROIList.h
widgets/ResolutionRingWidget.cpp
widgets/ResolutionRingWidget.h
image_viewer/JFJochGridScanImage.cpp
image_viewer/JFJochGridScanImage.h
widgets/PowderCalibrationWidget.cpp
widgets/PowderCalibrationWidget.h
${APP_RESOURCES}
windows/JFJochProcessingJobsWindow.cpp
windows/JFJochProcessingJobsWindow.h
)
TARGET_LINK_LIBRARIES(jfjoch_viewer Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Charts Qt6::Concurrent
JFJochReader JFJochLogger JFJochCommon JFJochWriter JFJochImageAnalysis JFJochRugnux
fftw3f libcurl_static) # vendored static libcurl by concrete name, not the CURL::libcurl
# alias, which a system libcurl can shadow (see top-level CMakeLists)
# Native GUI app per platform: a .app bundle on macOS, GUI subsystem (no console window) on
# Windows. Each property is ignored on the platforms it does not apply to, so set both always.
SET_TARGET_PROPERTIES(jfjoch_viewer PROPERTIES
MACOSX_BUNDLE ON
WIN32_EXECUTABLE ON)
# Application icon: embedded into the .exe via a Windows resource script, and copied into
# the macOS .app bundle (referenced from Info.plist through MACOSX_BUNDLE_ICON_FILE).
IF(WIN32)
TARGET_SOURCES(jfjoch_viewer PRIVATE resources/jfjoch.rc)
ELSEIF(APPLE)
SET(_viewer_icns ${CMAKE_CURRENT_SOURCE_DIR}/resources/jfjoch.icns)
TARGET_SOURCES(jfjoch_viewer PRIVATE ${_viewer_icns})
SET_SOURCE_FILES_PROPERTIES(${_viewer_icns} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
SET_TARGET_PROPERTIES(jfjoch_viewer PROPERTIES MACOSX_BUNDLE_ICON_FILE jfjoch.icns)
# Info.plist identity. Notarization needs the identifier; the short version must be numeric, so
# the release-candidate suffix goes into the long version string (Finder's Get Info). The bundle
# name is what the macOS menu bar shows, and matches the Qt application name.
SET_TARGET_PROPERTIES(jfjoch_viewer PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER ch.psi.jfjoch.viewer
MACOSX_BUNDLE_BUNDLE_NAME "JFJoch Viewer"
MACOSX_BUNDLE_SHORT_VERSION_STRING ${JFJOCH_VERSION_NUMERIC}
MACOSX_BUNDLE_BUNDLE_VERSION ${JFJOCH_VERSION_NUMERIC}
MACOSX_BUNDLE_LONG_VERSION_STRING ${JFJOCH_VERSION}
MACOSX_BUNDLE_COPYRIGHT "Copyright (C) 2019-2026 Paul Scherrer Institute")
# Qt links as @rpath/Qt*.framework and the deploy step below copies the frameworks into the
# bundle's Frameworks folder; without this rpath the installed app (and the .dmg) cannot find
# them - install strips the build tree's rpath and leaves the executable with none.
SET_TARGET_PROPERTIES(jfjoch_viewer PROPERTIES INSTALL_RPATH "@executable_path/../Frameworks")
ENDIF()
INSTALL(TARGETS jfjoch_viewer
BUNDLE DESTINATION . COMPONENT viewer # macOS .app bundle
RUNTIME DESTINATION bin COMPONENT viewer) # Windows .exe / Linux binary
# On macOS the notices go inside the bundle: a user drags only the .app out of the .dmg, so anything
# beside it is left behind. They must be installed before the Qt deploy script below, which signs
# the bundle - a file added after the signature invalidates it. (Other platforms install them into
# share/doc/jfjoch_viewer at the end of the top-level CMakeLists.txt.)
IF(APPLE)
INSTALL(FILES ${JFJOCH_NOTICE_FILES}
DESTINATION jfjoch_viewer.app/Contents/Resources COMPONENT viewer)
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses/
DESTINATION jfjoch_viewer.app/Contents/Resources/licenses COMPONENT viewer
PATTERN "COLLECT.sh" EXCLUDE)
ENDIF()
# libcufft_static.a carries a relocatable-device-code object (separate_callback.o), so an executable
# linking it needs a CUDA device-link step -- without it the host link fails on an undefined
# __cudaRegisterLinkedBinary_* symbol. CUDA 13 no longer ships libcufft_static_nocallback.a, which
# used to be the way around it. CUDA_RESOLVE_DEVICE_SYMBOLS makes CMake emit that step while leaving
# the host link driver alone, so the -march/-flto flags CI passes still apply.
IF (JFJOCH_PORTABLE_ONLY AND JFJOCH_CUDA_AVAILABLE AND TARGET CUDA::cufft_static)
SET_TARGET_PROPERTIES(jfjoch_viewer PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON)
ENDIF()
IF(JFJOCH_VIEWER_DBUS)
TARGET_SOURCES(jfjoch_viewer PRIVATE dbus/JFJochViewerAdaptor.cpp dbus/JFJochViewerAdaptor.h)
TARGET_LINK_LIBRARIES(jfjoch_viewer Qt6::DBus)
TARGET_COMPILE_DEFINITIONS(jfjoch_viewer PRIVATE JFJOCH_VIEWER_DBUS)
INSTALL(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/dbus/ch.psi.jfjoch_viewer.service
DESTINATION share/dbus-1/services
COMPONENT viewer
)
ENDIF()
# Freedesktop menu entry and its icon: Linux only. On Windows the Start Menu shortcut comes from
# CPACK_PACKAGE_EXECUTABLES and on macOS from the .app bundle, so shipping these there would only
# put two dead files into the installer.
IF(UNIX AND NOT APPLE)
INSTALL(
FILES resources/jfjoch.png
DESTINATION share/pixmaps
COMPONENT viewer
)
INSTALL(
FILES jfjoch_viewer.desktop
DESTINATION share/applications
COMPONENT viewer
)
ENDIF()
# Platform integration plugin: XCB on Linux, native plugin on Windows/macOS.
IF(WIN32)
qt_import_plugins(jfjoch_viewer INCLUDE Qt::QWindowsIntegrationPlugin)
ELSEIF(APPLE)
qt_import_plugins(jfjoch_viewer INCLUDE Qt::QCocoaIntegrationPlugin)
ELSE()
qt_import_plugins(jfjoch_viewer INCLUDE Qt::QXcbIntegrationPlugin)
ENDIF()
# Bundle the Qt runtime into the install tree at install time: this drives windeployqt on Windows
# and macdeployqt on macOS, copying the Qt shared libraries + plugins next to the app. With a
# static Qt (e.g. our Linux build) there is nothing to copy, so it is a no-op. Requires Qt >= 6.5,
# which is when the OUTPUT_SCRIPT signature and the Linux deploy path landed (6.3/6.4 used the older
# FILENAME_VARIABLE and had no Linux support); skipped on older Qt. NO_UNSUPPORTED_PLATFORM_ERROR
# keeps it from hard-failing on configurations it does not handle.
IF(Qt6_VERSION VERSION_GREATER_EQUAL "6.5")
qt_generate_deploy_app_script(
TARGET jfjoch_viewer
OUTPUT_SCRIPT jfjoch_viewer_deploy_script
NO_UNSUPPORTED_PLATFORM_ERROR)
INSTALL(SCRIPT ${jfjoch_viewer_deploy_script} COMPONENT viewer)
ENDIF()
# cuFFT is linked statically (see image_analysis/indexing/CMakeLists.txt), so there is no CUDA
# runtime library to ship beside jfjoch_viewer on any platform.