From 2483931e25b6040e14af99bb56c505e9c082e758 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 20 Sep 2021 12:41:35 +0200 Subject: [PATCH] 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. Pick-to: 6.2 Fixes: QTBUG-96511 Change-Id: I664381df4859a2e85c399cd94dc2f3996e452c03 Reviewed-by: Alexandru Croitor --- cmake/QtHeadersClean.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmake/QtHeadersClean.cmake b/cmake/QtHeadersClean.cmake index d5d3f439edb..7f54926f1a6 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})