[cmake-developers] How to handle package Config.cmake files with dependencies ?

Brad King brad.king at kitware.com
Tue Mar 13 10:55:43 EDT 2012


On Sat, Mar 10, 2012 at 7:35 AM, Alexander Neundorf <neundorf at kde.org> wrote:
> There is now a branch find_package_set_FOUND_VariableInConfigFile on stage.
>
> It behaves almost as you suggested: the _FOUND variable is only removed before
> the Config file is loaded, if the variable exists and is false.
>
> So if some Config file would test for the previous value of _FOUND, it will
> still get the same result.

I don't remember anything in the previous discussion that motivated this.
Why not unset it unconditionally?  The package config file should not
need to care or adjust its behavior based on whether a stray _FOUND was
set.  If it wants to communicate between multiple loads during the same
CMake run then it can store information in other variables that are not
set by find_package.

Is this just for compatibility?  Are we aware of any real uses of this?

-Brad



More information about the cmake-developers mailing list