installing and finding cmake-built projects
Alexander Neundorf
neundorf at kde.org
Sun Nov 16 20:21:15 CET 2008
Hi,
we have a bunch of cmake-built projects in kdesupport/. We have FindFoo.cmake
modules for them in kdelibs/.
These FindFoo.cmake modules don't take advantage of the fact that these
packages have also been built with cmake, they just search for them as for
any other package.
I changed this now for Strigi (and Automoc already did it already). So how are
Strigi and Automoc found now ?
Inside FindStrigi.cmake there is now a call
find_package(Strigi NO_MODULE)
This tells cmake to search for a file named StrigiConfig.cmake in a bunch of
default locations, e.g. CMAKE_INSTALL_PREFIX/lib/Strigi/.
If it find StrigiConfig.cmake there, it loads and executes this file. This way
it is possible to get basically any information from a cmake-built project
into a cmake-using project.
StrigiConfig.cmake (generated using configure_file() from
StrigiConfig.cmake.in to set the version number variables correctly) contains
the version number information, the include directory, the library directory
and search calls for the libraries and also the API type (strigi specific).
In case the file is not found it still falls back to the old search logic.
I think we should do it this way for all projects in kdesupport/.
Comments ?
Alex
More information about the Kde-buildsystem
mailing list