[CMake] CPack multiple packages

dbegun dbegun at protonmail.com
Thu Jul 19 12:00:13 EDT 2018


I have a project where a lib and a binary requiring the lib are built in separate subdirs of the project root. Each dir contains its own CMakeLists.txt with build/install targets, and there is also a top level one, which mainly just adds subdirectories etc.
I want to add .deb package generation with cpack. When I place the following in either of the inner CMakeLists, a package containing the binary is built.

set(CPACK_BINARY_DEB "ON")
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
set(CPACK_PACKAGE_VERSION ${PROJ_VERSION})
set(CPACK_PACKAGE_CONTACT "Denis Begun [dbegun at protonmail.](mailto:dbegun at allmonitoring.ru)com")
set(CPACK_PACKAGE_DESCRIPTION "proj")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
include(CPack)

If I place it in both inner lists, nothing changes. If I place it in the top level CMakeList.txt, nothing is generated. The problem is that the package doesn't contain the library, so the binary can't run after installation.

What's the right direction to look in?

Sent with [ProtonMail](https://protonmail.com) Secure Email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180719/b4f6095f/attachment.html>


More information about the CMake mailing list