From b07d2f0c1d8dd032145161d84b9aa3ec99103238 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 22 Apr 2024 17:59:59 +0200 Subject: [PATCH] Include Qt and GoogleTest as system include That is silencing warnings in Qt and GoogleTest headers . Change-Id: Ia6fda019c271788fbb341a8de0cf6d7b757f38bf Reviewed-by: Cristian Adam Reviewed-by: Qt CI Patch Build Bot --- cmake/QtCreatorAPIInternal.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index 08167535e32..0cd3602d543 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -338,12 +338,18 @@ function(add_qtc_depends target_name) foreach(obj_lib IN LISTS object_lib_depends) target_compile_options(${target_name} PRIVATE $) target_compile_definitions(${target_name} PRIVATE $) - target_include_directories(${target_name} PRIVATE $) + if (obj_lib MATCHES "Qt::.*|GoogleTest") + set(system_include "SYSTEM") + endif() + target_include_directories(${target_name} ${system_include} PRIVATE $) endforeach() foreach(obj_lib IN LISTS object_public_depends) target_compile_options(${target_name} PUBLIC $) target_compile_definitions(${target_name} PUBLIC $) - target_include_directories(${target_name} PUBLIC $) + if (obj_lib MATCHES "Qt::.*|GoogleTest") + set(system_include "SYSTEM") + endif() + target_include_directories(${target_name} ${system_include} PUBLIC $) endforeach() endfunction()