summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-09-20 12:41:35 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-20 15:54:22 +0000
commit1cca5d88e7a97ff269158424617971a71718de39 (patch)
tree39d0cac4e840a0cbe5ee327657e160703c5bacb6 /cmake
parent45f596c302d3d6c2268643dc50bb51a62963b24b (diff)
Add missing framework paths to header check targets
CMake doesn't add framework include paths for the includes if add_custom_command is used. When all Qt modules are installed to a single directory, frameworks could be found under QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX, but for Conan builds each module is installed to the separate directory. These directories need to be listed in the QT_ADDITIONAL_PACKAGES_PREFIX_PATH variables family. This takes into account directories that are listed in the QT_ADDITIONAL_PACKAGES_PREFIX_PATH variables and considers they can contain frameworks. Fixes: QTBUG-96511 Change-Id: I664381df4859a2e85c399cd94dc2f3996e452c03 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 2483931e25b6040e14af99bb56c505e9c082e758) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtHeadersClean.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/cmake/QtHeadersClean.cmake b/cmake/QtHeadersClean.cmake
index d5d3f439ed..7f54926f1a 100644
--- a/cmake/QtHeadersClean.cmake
+++ b/cmake/QtHeadersClean.cmake
@@ -158,6 +158,21 @@ function(qt_internal_add_headers_clean_target
# generator expression we provide, so pass it explicitly and hope for the best.
list(APPEND framework_includes
"-iframework" "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_LIBDIR}")
+
+ # If additional package prefixes are provided, we consider they can contain frameworks
+ # as well.
+ foreach(prefix IN LISTS _qt_additional_packages_prefix_paths)
+ if(prefix MATCHES "/lib/cmake$") # Cut CMake files path
+ string(APPEND prefix "/../..")
+ endif()
+ get_filename_component(prefix "${prefix}" ABSOLUTE)
+
+ set(libdir "${prefix}/${INSTALL_LIBDIR}")
+ if(EXISTS "${libdir}")
+ list(APPEND framework_includes
+ "-iframework" "${libdir}")
+ endif()
+ endforeach()
endif()
foreach(header ${hclean_headers})