[cmake-developers] find_package module-only policy

Alexander Neundorf neundorf at kde.org
Wed Feb 22 12:47:57 EST 2012


On Wednesday 22 February 2012, Brad King wrote:
> On 2/21/2012 5:09 PM, Alexander Neundorf wrote:
> > This is now in the FindPackage_CONFIG_MODULEKeywordsFirst branch on
> > stage,
> 
> [snip]
> 
> > There is the potential issue with "CONFIG" and "MODULE" being in use as
> > module names already somewhere.
> 
> Yes.  I hadn't actually intended for you to go straight to
> implementation with that idea.  I only intended it as a
> possibility for discussion.  

From my side I had no need to discuss, I really like this idea.

I mean, I really like this suggestion.
Only problem is the FindCONFIG.cmake and FindMODULE.cmake case...

If we can find a way how to avoid this problem I'd be all for this solution.
Enabling the keywords MODULE and CONFIG only via a policy ?
It could warn if the name of the package is one of the known keywords or looks 
like a version number.
Not that nice, but maybe acceptable for those uncommon package names ?

Or make the keyword more unique, i.e. longer ?
find_package(CONFIG_MODE|MODULE_MODE Foo)

Doesn't look that nice, but should be safe enough.

Other ideas ?

Alex




More information about the cmake-developers mailing list