Automatic recording of required packages...

David Faure faure at
Tue Nov 2 13:07:25 CET 2010

On Monday 01 November 2010, Alexander Neundorf wrote:
> Here cmake reports an error in target_link_libraries():
> -- Could NOT find Foo  (missing:  FOO_LIBRARY)
> CMake Error: The following variables are used in this project, but they
> are  set to NOTFOUND.
> Please set them or make sure they are set and tested correctly in the
> CMake  files:
>     linked by target "hello" in directory /home/alex/src/tests/foo
> -- Configuring incomplete, errors occurred!

Would there be a way to make cmake hide such errors, if it already saw a
failing find_package(Foo REQUIRED)?

I.e. upon a failure to find a required package
1) enter "degraded" mode:
2) keep going, to possibly look for more packages
3) skip any errors about variables containing NOTFOUND like the above
4) call feature_summary() to show all missing packages
(ideally this would even be automated, so that this mechanism does not break
when someone forgets to call feature_summary())

This is a bit like C++ compilers attempt to recover from errors in order to 
show more than one error :-)

On the other hand, I have seen cmake errors where the error would just be a 
line in the output, but without stopping there nor listing a missing 
dependency at the end, making it really hard to find the error. So if the above 
(my ideal solution) is not possible, then I'd rather have cmake abort on 
errors rather than it drowning the error in a large number of unrelated 

David Faure, faure at,
Sponsored by Nokia to work on KDE, incl. Konqueror (

More information about the Kde-buildsystem mailing list