[cmake-developers] the future of FIND_PACKAGE()

Brad King brad.king at kitware.com
Wed Jul 12 17:14:55 EDT 2006


Alexander Neundorf wrote:
> I discussed this topic in Trysil with David Faure.
> His first reaction: "oh, so they bascially try to reinvent pkgconfig ?"

Yes, that is correct, but it will work on Windows too and not require a 
3rd-party tool.

> He suggested basically not to find cmake files automatically, but do it more 
> or less as we do it for KDE:
> the package comes with a cmake file which contains e.g. macros and the paths 
> to libraries etc. (FooConfig.cmake).
> But in order to find it, cmake or the developer needs to have a FindFoo.cmake 
> file, which will be quite similar to the FindKDE4.cmake, i.e. only detect the 
> location of the package-provided FooConfig.cmake file and then hand the rest 
> over to this file.
> If no FindFoo.cmake file comes with cmake, the developer either has to write 
> its own, or copy it from another project.
> 
> This approach also avoids the need for automatic finding of FooConfig.cmake 
> files, which I also consider problematic.

You mean like this:

   http://www.cmake.org/pipermail/cmake/2006-June/009510.html

?

The two approaches are compatible.  Once Foo installs FooConfig.cmake, 
the user project can look for it either using its own FindFoo.cmake 
script or letting a future FIND_PACKAGE locate it.

-Brad



More information about the cmake-developers mailing list