From 0585fab9bfad4f8146a916431968d4ab3216c1d4 Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Fri, 19 Jun 2026 20:17:31 +0200 Subject: [PATCH] cmake: don't fetch sls/catch2 in a viewer-only build Under JFJOCH_VIEWER_ONLY, only the viewer's transitive deps are built, so sls_detector_package (detector_control/receiver) and catch2 (tests) are never used -- and sls does not configure under MSVC, which is the whole point of the viewer-only mode. Skip fetching just those two; zstd, hdf5, spdlog, libzmq and httplib are still required (JFJochReader links httplib). Verified: cmake -DJFJOCH_VIEWER_ONLY=ON configures with sls/catch2 absent and `make jfjoch_viewer` still links. Co-Authored-By: Claude Opus 4.8 --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d90e1341..c8828ad7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,7 +164,14 @@ SET(CMAKE_POLICY_VERSION_MINIMUM 3.5) # libzmq must be made available BEFORE sls_detector_package for the override above to take effect. FetchContent_MakeAvailable(libzmq) -FetchContent_MakeAvailable(zstd sls_detector_package catch2 hdf5 spdlog httplib) +IF (JFJOCH_VIEWER_ONLY) + # A viewer-only build still needs zstd/hdf5/spdlog/httplib (JFJochReader uses httplib). + # Only sls_detector_package (detector) and catch2 (tests) are not built here -- and sls + # in particular does not configure under MSVC -- so skip just those two. + FetchContent_MakeAvailable(zstd hdf5 spdlog httplib) +ELSE() + FetchContent_MakeAvailable(zstd sls_detector_package catch2 hdf5 spdlog httplib) +ENDIF() IF (JFJOCH_VIEWER_ONLY) # Minimal subtree: jfjoch_viewer and only the libraries it transitively links.