[CMake] CPack, Debian packages and libraries

Eric Noulard eric.noulard at gmail.com
Wed Oct 17 09:46:20 EDT 2012


2012/10/17 Benjamin Kloster <benjamin.kloster at videlco.eu>:
> Hi everyone,
> I'm trying to configure CPack for packaging an executable and some shared
> libraries the application depends on. Both application and libraries are
> built by CMake. For NSIS, this works just fine, the installer includes all
> necessary files. However, the CPack Debian generator seems to only include
> the executable in the package, but not the shared libraries. Unfortunately,
> static linking is not an option due to licensing issues.
>
> I've put some excerpts of the CMakeLists.txt files and CPack configuration
> below.
>
> Some observations:
> - Adding another executable target to the package works fine, only library
> targets are affected
> - Miscellaneous files installed with INSTALL(FILES ...) are properly
> included in the debian package

To which component do they belong to?

> - "make install" installs the shared libraries, as it should
> - As mentioned above, (almost) the same configuration works fine for the
> CPack NSIS generator
> - playing around with the DESTINATION arguments of the libraries' install
> commands didn't help
>
> Am I missing something obvious? Doesn't the CPack .deb generator support
> packaging of pre-compiled libraries?

Nothing obvious beside the fact that CPack DEB generator does not handle
COMPONENT by default...
Could you try (in the DEB case) to:

set(CPACK_DEB_COMPONENT_INSTALL 1)
set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)

You usage should definitely work without that but I guess
there is a neat interaction between CPACK_INSTALL_CMAKE_PROJECTS
features and COMPONENT handling.

By the way do you set a value for CPACK_COMPONENTS_ALL
or do you leave it unset?

-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list