[cmake-developers] Issuing errors for faulty INTERFACE_INCLUDE_DIRECTORIES

Brad King brad.king at kitware.com
Thu Mar 28 08:29:25 EDT 2013


On 03/27/2013 05:21 PM, Alexander Neundorf wrote:
> Maybe instead of generating code which immediately results in failure at the 
> find_package() step, how about generating code which contains a list of 
> imported targets with missing dependencies/files/directories ?

This is blowing the proposed feature way out of scope.  Currently there
will be no error until build time.  With the proposed feature the error
will be at CMake time when there could have been one at build time, but
not extra errors at CMake time that would not have occurred at build
time.

>    if(Xxx_IMPORTED_TARGETS_WITH_MISSING_STUFF)
>       set(Xxx_${comp}_FOUND FALSE)
>    endif()

A package config file and consuming projects should not be expected to
adapt to broken installations of packages to use the "non-broken" parts.
If an include dir is missing who knows what else is wrong.

This feature should be about making things simpler by erroring out early
when we know the build is likely to break because something is missing.
Your proposal will make it more complicated by trying to adapt to the
breakage.

BTW, take a look at this problem:

 http://www.cmake.org/Bug/view.php?id=14041

triggered by some of the existing checks for missing files.

-Brad



More information about the cmake-developers mailing list