[cmake-developers] Patch: Don't emit warning when config file not found

Christoph Grüninger foss at grueninger.de
Sun Oct 9 15:24:05 EDT 2016


Hi Brad,
thanks again for your answer, but the core of the problem persists.

>> 1. When I use "find_package(Vc)", many users get warnings that neither
>> FindVc.cmake nor VcConfig.cmake is found.
> 
> You can use
>     find_package(Vc CONFIG)
> to drop the FindVc part of the message.

Sure, that helps a bit. Still we get a warning with the stack trace,
just for a missing optional dependency.

>> 2. When I use "find_package(Vc QUIET)", Vc does not show up in the
>> feature summary.
> 
> Try:
>     find_package(Vc CONFIG QUIET)
> Then use the `INCLUDE_QUIET_PACKAGES` option to feature_summary():

And all quiet packages will show up, including a dozen of internal
packages. Using quiet has another disadvantage: If the package is found
but does not work (wrong version, lib found but not the includes), the
user has no way investigating that.

More and more packages provide config files. We are left with
* either having a warning for every missing dependency
* or loosing the output of tests and feature summary, as both tests are
QUIET.

I'd prefer to write the error message to the CMakeError.log and reduce
the output to one line. I think, the current behavior must be considered
a bug.

Best,
Christoph


More information about the cmake-developers mailing list