[Development] CMake integration and system headers

Stephen Kelly stephen.kelly at kdab.com
Wed May 7 13:16:20 CEST 2014


On Tuesday, May 06, 2014 11:40:34 Mikołaj Siedlarek wrote:
> 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.

CMake 3.0 treats the INTERFACE_INCLUDE_DIRECTORIES on IMPORTED targets as 
system headers by default:

 http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html#include-directories-and-usage-requirements

 http://www.cmake.org/cmake/help/v3.0/prop_tgt/NO_SYSTEM_FROM_IMPORTED.html#prop_tgt:NO_SYSTEM_FROM_IMPORTED

 cmake_minimum_required(VERSION 3.0.0)

 project(MyTest)

 find_package(Qt5Core REQUIRED)

 add_executable(foo main.cpp)
 target_link_libraries(foo Qt5::Core)
 # set_property(TARGET foo PROPERTY NO_SYSTEM_FROM_IMPORTED ON)

If that's not the case on APPLE, then that's a bug in CMake.

> Please direct me to someone I can discuss this with

That's me.

Thanks,

-- 
Join us at Qt Developer Days 2014 in Berlin! - https://devdays.kdab.com

Stephen Kelly <stephen.kelly at kdab.com> | Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140507/20c1e989/attachment.sig>


More information about the Development mailing list