[cmake-developers] Issuing errors for faulty INTERFACE_INCLUDE_DIRECTORIES (Was: CMake usage requirements in KDE Frameworks)

Brad King brad.king at kitware.com
Fri Mar 22 08:01:43 EDT 2013


On 03/22/2013 07:14 AM, Stephen Kelly wrote:
> Would it be reasonable to issue an error at install(EXPORT)-time if the 
> INTERFACE_INCLUDE_DIRECTORIES of a target contains paths in the source dir 
> or binary dir, if the install prefix is not inside one of those itself?

Yes, though it won't be able to work for all cases because some paths
may have generator expressions which won't be evaluated until the
consumer loads them.

> Also, in cmTarget::GetIncludeDirectories, if a path in a 
> INTERFACE_INCLUDE_DIRECTORIES entry of an IMPORTED dependent does not exist, 
> that could be made an error too. This would sort of be showing the error in 
> the wrong place though (to the person using the package, rather than the one 
> creating it).

We already have similar errors in the exported "targets" files for
things like missing library files.  The wording says something about
possible missing or broken packages.

-Brad



More information about the cmake-developers mailing list