From 5247acc07e7375a6bf5dea26e384f0de29b7e497 Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Sat, 20 Jun 2026 16:13:24 +0200 Subject: [PATCH] CMake: package the viewer component in JFJOCH_VIEWER_ONLY builds A viewer-only build builds jfjoch_viewer but the CPack block hard-coded CPACK_COMPONENTS_ALL to "jfjoch writer" and only appended "viewer" when JFJOCH_VIEWER_BUILD was set -- which a pure viewer-only build does not set. cpack then tried to package the empty jfjoch/writer components and failed, requiring a manual -D CPACK_COMPONENTS_ALL=viewer. Branch the component list on build mode: viewer-only packages just "viewer"; other modes keep "jfjoch writer" plus driver-dkms/viewer when their flags are set. Also drops the redundant re-set of the default list. Co-Authored-By: Claude Opus 4.8 --- CMakeLists.txt | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5626d04..34dbf94d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,20 +319,19 @@ IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) # Set Package Name -# Initialize CPACK_COMPONENTS_ALL with common components -set(CPACK_COMPONENTS_ALL jfjoch writer) - SET(CPACK_PACKAGE_NAME "jfjoch") -# Add optional components -if (JFJOCH_INSTALL_DRIVER_SOURCE) - list(APPEND CPACK_COMPONENTS_ALL driver-dkms) +# Select the components to package based on build mode +if (JFJOCH_VIEWER_ONLY) + set(CPACK_COMPONENTS_ALL viewer) else() set(CPACK_COMPONENTS_ALL jfjoch writer) -endif() - -if (JFJOCH_VIEWER_BUILD) - list(APPEND CPACK_COMPONENTS_ALL viewer) + if (JFJOCH_INSTALL_DRIVER_SOURCE) + list(APPEND CPACK_COMPONENTS_ALL driver-dkms) + endif() + if (JFJOCH_VIEWER_BUILD) + list(APPEND CPACK_COMPONENTS_ALL viewer) + endif() endif() # Common metadata