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

Brad King brad.king at kitware.com
Tue Feb 28 13:59:21 EST 2012


On 2/28/2012 1:48 PM, Alexander Neundorf wrote:
> Do you think that needs a policy ?

I'm not sure.  It's pretty obscure.

> The code currently does:
>
>    // Set a variable marking whether the package was found.
>    std::string foundVar = this->Name;
>    foundVar += "_FOUND";
>    this->Makefile->AddDefinition(foundVar.c_str(), found? "1":"0");
>
> (I forgot the last line in my initial mail).
> So the variable is set afterwards unconditionally.
> The only condition where it would make a difference is if inside a
> FooConfig.cmake file there would be a check whether Foo_FOUND is already TRUE.
>
> I can do that.

Don't forget to unset the variable before loading the module so
we know whether the module defined it.

Thanks,
-Brad



More information about the cmake-developers mailing list