[cmake-developers] the future of FIND_PACKAGE()

Brad King brad.king at kitware.com
Fri Jun 30 11:23:08 EDT 2006


Alexander Neundorf wrote:
> On Friday 30 June 2006 16:09, you wrote:
> 
>>Good idea.  If a version number is given we could use it to try to
>>narrow the search.  We could look in lib/cmake/Foo-1.2 if no version is
>>given or if the version is 1.2.  If the given version is 1.2 then we
>>would not look in lib/cmake/Foo-3.4 for example.
> 
> 
> How about looking in all lib/cmake/Foo*/ except Foo-x.y/ with x.y being less 
> than the required version number ?
> Would mean "at least" version x.y is required, not "exactly" version x.y is 
> required.

I think both should be supported with some kind of option to explicitly 
enable exact matches.  The pattern should probably be

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.

-Brad



More information about the cmake-developers mailing list