From 9eea24ed601d0aa243269fac64c9a65c3750d1b0 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 3 Dec 2019 16:07:44 +0100 Subject: [PATCH] Don't export private include paths if there are no private includes Needed when building Qt Creator with CMake + Qt6 non-prefix build. Specifically qttools's QtUiPlugin does not have any private headers, but the non-existing include path was exported, which caused an error when configuring Qt Creator. Change-Id: I662bc502fe3134fba083bde273b7f63fe1470277 Reviewed-by: Leander Beernaert Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a1b044b97d4..6f325adfb48 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1462,9 +1462,12 @@ function(qt_add_module target) # Handle cases like QmlDevTools which do not have their own headers, but rather borrow them # from another module. if(NOT arg_NO_SYNC_QT AND NOT arg_NO_MODULE_HEADERS) - list(APPEND private_includes - "$" - "$") + # Don't include private headers unless they exist, aka syncqt created them. + if(module_headers_private) + list(APPEND private_includes + "$" + "$") + endif() list(APPEND public_includes # For the syncqt headers