diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-09-02 11:26:12 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-09-02 12:32:01 +0000 |
commit | f9842ae7d481cf5df08a000c4af7822d1bee0dd7 (patch) | |
tree | 1794a7307d86f9cc8ee369f5bb36c7212f70c2d0 /cmake | |
parent | a5cdca8033b53620867a104462c565cf9a18da2a (diff) |
Don't include module syncqt header locations if syncqt was not run
When building QtQmlDevTools we don't generate syncqt headers, but the
non-existent include paths were still added, which means that anything
that used QtQmlDevTools would fail to configure (the standalone tests).
Make sure to only add the include paths if syncqt was executed.
Change-Id: I6d79ecf53e9a5d396e8df801584ce2c9f119f9be
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 6699e9844c..3a1a6ebaec 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1295,16 +1295,23 @@ function(add_qt_module target) set(private_includes "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" - "${module_include_dir}/${PROJECT_VERSION}" - "${module_include_dir}/${PROJECT_VERSION}/${module}" ${arg_INCLUDE_DIRECTORIES} ) - set(public_includes - # For the syncqt headers - "$<BUILD_INTERFACE:${module_repo_include_dir}>" - "$<BUILD_INTERFACE:${module_include_dir}>" - ) + set(public_includes "") + + # Handle cases like QmlDevTools which do not have their own headers, but rather borrow them + # from another module. + if(NOT arg_NO_SYNC_QT) + list(APPEND private_includes + "${module_include_dir}/${PROJECT_VERSION}" + "${module_include_dir}/${PROJECT_VERSION}/${module}") + + list(APPEND public_includes + # For the syncqt headers + "$<BUILD_INTERFACE:${module_repo_include_dir}>" + "$<BUILD_INTERFACE:${module_include_dir}>") + endif() if(NOT arg_NO_MODULE_HEADERS) # For the syncqt headers @@ -1501,20 +1508,23 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") qt_internal_add_link_flags_no_undefined("${target}") endif() - set(interface_includes - "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>" - "$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}>" - "$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}/${module}>" - ) + set(interface_includes "") - if(NOT arg_NO_MODULE_HEADERS) + # Handle cases like QmlDevTools which do not have their own headers, but rather borrow them + # from another module. + if(NOT arg_NO_SYNC_QT) list(APPEND interface_includes - "$<INSTALL_INTERFACE:include/${module}/${PROJECT_VERSION}>" - "$<INSTALL_INTERFACE:include/${module}/${PROJECT_VERSION}/${module}>" - ) + "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>" + "$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}>" + "$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}/${module}>") + + if(NOT arg_NO_MODULE_HEADERS) + list(APPEND interface_includes + "$<INSTALL_INTERFACE:include/${module}/${PROJECT_VERSION}>" + "$<INSTALL_INTERFACE:include/${module}/${PROJECT_VERSION}/${module}>") + endif() endif() - if(NOT ${arg_NO_PRIVATE_MODULE}) target_include_directories("${target_private}" INTERFACE ${interface_includes}) endif() |