summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Michaël Celerier <jeanmichael.celerier@gmail.com>2019-06-05 10:51:45 +0200
committerJean-Michaël Celerier <jean-michael.celerier@kdab.com>2019-06-05 09:21:22 +0000
commit2eeba9f55f11a3389dd29196fc3c52e317d8967c (patch)
treefdde9a15ffb78029439354370fc60e053745dd10
parent2401435d89c62be48ee7cf798aa3f47fb3faf670 (diff)
cmake: don't add install-time include directories when there are none
Change-Id: I380218191139fe514ddac598992b1ba27ac33a41 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--cmake/QtBuild.cmake23
1 files changed, 17 insertions, 6 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 6fabf8098a..e08f2a182c 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -1083,13 +1083,19 @@ function(add_qt_module target)
qt_autogen_tools_initial_setup(${target})
+ set(_public_includes
+ $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
+ $<BUILD_INTERFACE:${module_include_dir}>
+ )
+ if(NOT arg_NO_MODULE_HEADERS)
+ list(APPEND _public_includes $<INSTALL_INTERFACE:include/${module}>)
+ endif()
+ list(APPEND _public_includes ${arg_PUBLIC_INCLUDE_DIRECTORIES})
+
extend_target("${target}"
SOURCES ${arg_SOURCES}
PUBLIC_INCLUDE_DIRECTORIES
- $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
- $<BUILD_INTERFACE:${module_include_dir}>
- $<INSTALL_INTERFACE:include/${module}>
- ${arg_PUBLIC_INCLUDE_DIRECTORIES}
+ ${_public_includes}
INCLUDE_DIRECTORIES
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}"
@@ -1259,10 +1265,15 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}>
$<BUILD_INTERFACE:${module_include_dir}/${PROJECT_VERSION}/${module}>
- $<INSTALL_INTERFACE:include/${module}/${PROJECT_VERSION}>
- $<INSTALL_INTERFACE:include/${module}/${PROJECT_VERSION}/${module}>
)
+ if(NOT arg_NO_MODULE_HEADERS)
+ target_include_directories("${target_private}" INTERFACE
+ $<INSTALL_INTERFACE:include/${module}/${PROJECT_VERSION}>
+ $<INSTALL_INTERFACE:include/${module}/${PROJECT_VERSION}/${module}>
+ )
+ endif()
+
if(NOT ${arg_DISABLE_TOOLS_EXPORT})
qt_export_tools(${target})
endif()