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