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()