[CMake] Issues using CPack for making a debian package

Wagner, David david.wagner at intel.com
Wed Mar 23 08:43:31 EDT 2016


	Hi,

(I'm using CMake 3.2)

I have a project which is using CMake and CPack to create a debian package. It 
currently seems to be working fine but when I set CPACK_DEBIAN_PACKAGE_DEBUG to 
ON and dig in the logs, I see this:

> dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory
> dpkg-shlibdeps: warning: couldn't find library libparameter.so needed by ./usr/bin/domainGeneratorConnector (ELF format: 'elf64-x86-64'; RPATH: '')
> dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory
> dpkg-shlibdeps: warning: couldn't find library libparameter.so needed by ./usr/lib/libcparameter.so (ELF format: 'elf64-x86-64'; RPATH: '')
> [...]

Despite these warnings, the "Depends:" field is correctly filled.

Now, I would like to add version information to my shared libraries like so:

> set_target_properties(parameter PROPERTIES VERSION 3.2.4)

After that, when I run cpack again, I get this:

> dpkg-shlibdeps: error: couldn't find library libparameter.so.3.2.4 needed by ./usr/bin/test-platform (ELF format: 'elf64-x86-64'; RPATH: '')
> dpkg-shlibdeps: warning: couldn't find library libremote-processor.so needed by ./usr/bin/test-platform (ELF format: 'elf64-x86-64'; RPATH: '')
> dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory
> dpkg-shlibdeps: error: couldn't find library libparameter.so.3.2.4 needed by ./usr/lib/python2.7/dist-packages/_PyPfw.so (ELF format: 'elf64-x86-64'; RPATH: '')
> dpkg-shlibdeps: warning: binaries to analyze should already be installed in their package's directory
> [...]

I don't know why but dpkg-shlibeps has a special treatment for libraries that 
have a version number in their name, turning warnings into errors.

So, I've done some research and I found two things:
  - There's a closed bug entry and a very recent patch 
(https://cmake.org/Bug/view.php?id=12431; 
https://cmake.org/gitweb?p=cmake.git;a=log) that will help fixing this;
  - The documentation advises setting the CMAKE_INSTALL_RPATH variable (but 
doesn't give any clue as to what value it should be set to).

However, I don't want to do that because:
  a) it impacts the other use-cases;
  b) the rpath will stay in the binaries delivered through the debian package.

I'd like to point out that dpkg-shlibdeps has a `-l` option that looks to me 
like the best tool for the job (compared to the rpath solution); this option is 
used in actual debian packages.

> -ldirectory
>        Add directory to the list of directories to search for private shared libraries (since dpkg 1.17.0). This option can be used multiple times.

I'm considering working my problem around by shipping a patched copy of 
CPackDeb.cmake, using this `-l` option. Has anyone another solution?

Thanks
David

-- 
David Wagner

complex != complicated
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


More information about the CMake mailing list