[cmake-developers] Issuing errors for faulty INTERFACE_INCLUDE_DIRECTORIES (Was: CMake usage requirements in KDE Frameworks)
Stephen Kelly
steveire at gmail.com
Fri Mar 22 07:14:31 EDT 2013
Alexander Neundorf wrote:
> With PUBLIC, PRIVATE and INTERFACE,
> directories can be added to the wrong one (i.e. PUBLIC instead PRIVATE or
> INTERFACE) and it will still build, but the interface will be bigger than
> necessary.
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?
That way, something like this would be an error at install-export-time:
target_include_directories(foo
# Forgot to wrap in BUILD_INTERFACE:
INTERFACE "${CMAKE_CURRENT_BINARY_DIR}")
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).
Thanks,
Steve.
More information about the cmake-developers
mailing list