diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-12-03 16:07:44 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-12-03 17:14:14 +0000 |
commit | 9eea24ed601d0aa243269fac64c9a65c3750d1b0 (patch) | |
tree | 89605a457e245235fdb4e3fec29f0f499fee5800 /cmake | |
parent | 715465a93b1d1ec1f290821db88adeb705cf57f8 (diff) |
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 <leander.beernaert@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a1b044b97d..6f325adfb4 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 - "$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}>" - "$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}/${module}>") + # Don't include private headers unless they exist, aka syncqt created them. + if(module_headers_private) + list(APPEND private_includes + "$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}>" + "$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}/${module}>") + endif() list(APPEND public_includes # For the syncqt headers |