[CMake] CPack multiple packages

Domen Vrankar domen.vrankar at gmail.com
Thu Jul 19 18:40:11 EDT 2018


2018-07-19 18:00 GMT+02:00 dbegun via CMake <cmake at cmake.org>:

> 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.
> <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?
>

Have you tried placing the include(CPack) at the bottom of the top level
CMakeLists.txt after the rest of the CMakeLists.txt files have been
included?

Regards,
Domen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180720/1b2bbb02/attachment.html>


More information about the CMake mailing list