[cmake-developers] target_link_libraries, IMPORTED targets and SYSTEM includes

Brad King brad.king at kitware.com
Thu Jul 25 13:18:25 EDT 2013


On 07/25/2013 12:22 PM, Stephen Kelly wrote:
> library A should have a unit test which attempts to compile all 
> of its headers with all warnings enabled. In Qt every module has a 
> 'headersclean' unit test which does exactly that.

While this is a good idea we're not going to assume every project has
such discipline.  Also some consumers may include headers with a
different preprocessing context that exposes the warning.

> The purpose in the bug report is not to include Qt as non-SYSTEM, but the 
> opposite. I don't see any reason for downstreams to include Qt headers as 
> non-SYSTEM headers.

Then why not make INTERFACE_SYSTEM_INCLUDE_DIRECTORIES the default in
the Qt imported targets and have a switch to turn them off?  The code

 set(QT_INCLUDE_DIRS_NO_SYSTEM 1)
 find_package(Qt5Core)

is not so bad in the edge case that needs it.

Either way, the tll() SYSTEM option could still be useful.

-Brad



More information about the cmake-developers mailing list