[cmake-developers] Bad error message when a package could not be found - make find_package() not search config files by default

Alexander Neundorf neundorf at kde.org
Fri Feb 17 05:07:11 EST 2012


On Friday 17 February 2012, Rolf Eike Beer wrote:
> > On Thursday 16 February 2012, Alexander Neundorf wrote:
...
> > What should be improved:
> > 1.), 2.), 4.)  processing should stop if REQUIRED was used
> 
> I disagree. Say I want to build $random package. Throw the source
> somewhere, run cmake. Now I see the errors and install the packages that
> are missing. If processing immediately stops on an unmet dependency I
> would have to repeat that as long as there are unmet dependencies. If
> processing continues but gives and error I can install all things at once.

Well, at least it is inconsistent with the behaviour of all Find-modules.
They all stop with FATAL_ERROR if a REQUIRED package was not found.

The documentation page says: "The REQUIRED option stops processing with an 
error message if the package cannot be found."

I interpret this as "stops processing immediately".
This is what find_package_handle_standard_args() does.

If this is not the intended meaning, then all the Find-modules (mostly 
FindPackageHandleStandardArgs) should be changed to use SEND_ERROR instead of 
FATAL_ERROR.

Alex



More information about the cmake-developers mailing list