[cmake-developers] the future of FIND_PACKAGE()

Alexander Neundorf neundorf at kde.org
Wed Jul 12 17:05:00 EDT 2006


Hi Brad,

On Friday 30 June 2006 17:23, you wrote:
...
> lib/cmake/Foo*
>
> and then try to pull a number out of the * part, so that directories
> like Foo-1.2 and Foo1.2 can both work.
>
> We should probably also support a NAMES option on FIND_PACKAGE for this
> mode (but not when looking for FindFoo.camke scripts), just like the
> other FIND_* commands.  I wonder if the NAMES should be used only for
> directories or also for the FooConfig.cmake files (now
> <name>Config.cmake files).  My vote would be to use them only for
> directories to avoid confusion in exactly what file is being found.  In
> this case KDE4Config.cmake should be called KDEConfig.cmake, but it
> could be installed in lib/cmake/kde4 or something like that.

I discussed this topic in Trysil with David Faure.
His first reaction: "oh, so they bascially try to reinvent pkgconfig ?"
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.

So for us (KDE) it's currently not very urgent anymore, especially since the 
Qt DBUS bindings now have moved to Qt itself, which makes things easier for 
us. We just have to find Qt using FindQt4.cmake and provide required DBUS 
macros in FindQt4.cmake.

Bye
Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net



More information about the cmake-developers mailing list