[Development] CMake integration and system headers

Mikołaj Siedlarek msiedlarek at nctz.net
Tue May 6 11:40:34 CEST 2014


Hi,

I’m on a quest to enable hack-free all-warnings-enabled building of my project using, among others,
Qt and CMake. This requires that compiler treat Qt headers included in my code as “system headers”
and not warn me about constructs used in them.

I already contributed -iframework (Apple frameworks counterpart to -isystem) flag support to CMake
(https://github.com/Kitware/CMake/pull/100), so with 3.0 version it should correctly handle properly
marked include directories on all systems.

The only problem is current CMake integration in Qt uses INTERFACE_INCLUDE_DIRECTORIES
target property, when to be provide a system include directory it should use
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES. On compilers that do not support -isystem flag
CMake falls back to -I, so compatibility would not be a problem.

The problem is current CMake integration in Qt requires version 2.8.3, but
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES is only available since 2.8.12. Before I propose
a patch I’d like to consult a maintainer of this system, or at least someone more familiar with
Qt release process, whether it’s best to add some CMake version checks or version requirement
can be bumped with next release.

Please direct me to someone I can discuss this with, or tell me directly that my idea is bad.

Thanks,
Mikołaj Siedlarek


More information about the Development mailing list