[CMake] Better handling of library dependencies for CPack

Rolf Eike Beer eike at sf-mail.de
Fri Apr 22 04:51:34 EDT 2011


> We've recently started generating (debian) packages with CPack and
> discovered that handling library dependencies for particular
> distributions was not as smooth as it can be. The *_DEPENDS string
> just gets copied over to the final package so it puts all the burden
> on the user side to manage what distribution's dependencies get
> enabled.
> 
> Instead, can we have something similar to how build-type-dependent
> libraries work out? For example, a library string can be set according
> to:
> 
> set(LIBRARY debug mylibraryd optimized mylibrary)
> 
> And joining multiple library strings will take care of organizing the
> dependencies. In the same way, it would be cool if we can specify
> distribution dependencies that way:
> 
> set(*DEPENDS ubuntu mylib3-dev debian mylib-devel)
> 
> Then depending on the distribution type the user sets, the correct
> dependencies can be selected.

There are not that many binary package formats out there. Since we already know the absolute path of the libraries we depend on (since the find_package() things found them) we could feed them through "rpm -qf" or whatever meets that on Debian based systems. Then you automatically have the correct package names no matter how the distros decide to call them.

Eike


More information about the CMake mailing list