[CMake] Better handling of library dependencies for CPack

Eric Noulard eric.noulard at gmail.com
Fri Apr 22 11:11:14 EDT 2011


2011/4/22 Rosen Diankov <rosen.diankov at gmail.com>:
> Hi Guys,
>
> You are right about shlibdeps, but this is not the whole story.
>
> Debian source packages required "build dependencies" to be
> preinstalled before cmake even runs. This tells each distribution what
> it needs so that cmake can find it with find_package.

Yes off course build dependencies may be distribution specific and
may not be found with executable/lib dep.

> Afterwards, it isn't necessary to specify all the dependencies since
> they can be extracted from the symbols of the shared objects
> (dpkg-shlibdeps). However, there are cases where the symbols are not
> used, but it is still required.
>
> For example, I have a program that generates c++ files once it is
> called. This program requires g++ to be present, or otherwise it will
> not work. Therefore g++ is a runtime dependency, but there are no g++
> symbols in the program.

yes ok too.
For this the better we can do is to offer the user with a way to
manually specify thoses dependencies for each distribution he wants
to support.

> About Eric's suggestion with "Generator"  specific dependencies, this
> is not necessary for our application at the moment. What we want is
> for a specific generator, to have "distribution" specific
> dependencies.

Yes I understood that but in the CPackConfig file you may setup distro
specific deps from within generator specific case.

save the attached CPackConfig.cmake file in your project directory
then add
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/CPackConfig.cmake)
in your main CMakeLists.txt then

rerun CMake
run CPack and see what happen.

I think that you'll see that it should suits your needs
since you may already customize the dependencies
in a distribution specific way for any CPack generator.
May seems weird but it should work.

This scheme supposes you are not "cross-packaging" like packaging
a Fedora RPM on a debian host.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CPackConfig.cmake
Type: application/octet-stream
Size: 1626 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110422/b2a98e52/attachment.obj>


More information about the CMake mailing list