Skip to content

Invalid cpack configuration inside CMakeLists.txt #520

Description

@Lawyar

Describe the bug
Debian packages are empty after building and executing cpack -G DEB.

Solution: replace string set(CPACK_COMPONENTS_ALL runtime dev doc) to set(CPACK_COMPONENTS_ALL sdbus-c++-runtime sdbus-c++-dev sdbus-c++-doc) in the root CMakeLists.txt. CPACK_COMPONENTS must match to components names passed into install function.

To Reproduce

git clone https://github.com/Kistler-Group/sdbus-cpp.git
git checkout v2.2.0
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DSDBUSCPP_INSTALL=ON -DSDBUSCPP_BUILD_TESTS=OFF  -DSDBUSCPP_BUILD_CODEGEN=ON -DSDBUSCPP_BUILD_LIBSYSTEMD=OFF ..
cmake --build . -j12
cpack -G DEB

Expected behavior
After applying the solution, the packages contain expected files. Example output for sdbus-c++-sdbus-c++-runtime_2.2.0_arm64.deb package. Another packages are valid too.

dpkg -c sdbus-c++-sdbus-c++-runtime_2.2.0_arm64.deb 
#drwxrwxr-x root/root         0 2025-11-20 16:18 ./usr/
#drwxrwxr-x root/root         0 2025-11-20 16:18 ./usr/lib/
#drwxrwxr-x root/root         0 2025-11-20 16:18 ./usr/lib/aarch64-linux-gnu/
#lrwxrwxrwx root/root         0 2025-11-20 16:18 ./usr/lib/aarch64-linux-gnu/libsdbus-c++.so.2 -> libsdbus-c++.so.2.2.0
#-rw-r--r-- root/root    417200 2025-11-20 16:18 ./usr/lib/aarch64-linux-gnu/libsdbus-c++.so.2.2.0

Real (buggy) behavior
I've downloaded one of pipeline artifacts to show you behavior. As you can see, all packages contain empty directory /usr.

dpkg -c sdbus-c++-dev_2.1.0_amd64.deb
#drwxr-xr-x root/root         0 2025-10-23 22:10 ./usr/
dpkg -c sdbus-c++-doc_2.1.0_amd64.deb 
#drwxr-xr-x root/root         0 2025-10-23 22:10 ./usr/
dpkg -c sdbus-c++_2.1.0_amd64.deb 
#drwxr-xr-x root/root         0 2025-10-23 22:10 ./usr/

Additional context
OS: Ubuntu 20.04
CMake: 3.16.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions