[cmake-developers] find_package module-only policy (was: find_package error wording)

Brad King brad.king at kitware.com
Sun Feb 19 10:25:47 EST 2012


On 2/18/2012 10:43 AM, Alexander Neundorf wrote:
> This is now in the branch FindPackage_MODULE_MODE_Policy on stage.
> I still have to add tests.

Thanks for the prototype.  I'm not promising acceptance yet
but it is a good reference for discussion.  I'm going to
continue the discussion over on Stephen's response in this
thread.

> I think with this new policy MODULE_MODE should not be considered the "simple
> signature" and NO_MODULE the "full signature" anymore, but both with equal
> rights.

It used to be one signature but IIRC you asked me to break out the
reduced signature since that is all people need most of the time.

After thinking about the new _MODE options more I think calling
them just "MODULE" and "CONFIG" is better.  The former is very
clearly the opposite of NO_MODULE, and the latter reads well:

 find_package(Foo CONFIG) # find Foo's package "config" file

I do not think the similarity of "CONFIG" to the existing "CONFIGS"
is a problem because the latter implies the former anyway so they
never need to be used at the same time.  The latter reads well too:

 find_package(Foo CONFIGS FooConfig.cmake)
 # (Finds "FooConfig.cmake" from package Foo)
 # ("CONFIGS" is similar to "NAMES" in find_library)

-Brad



More information about the cmake-developers mailing list