diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-09-20 12:41:35 +0200 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2021-09-20 17:54:12 +0200 |
commit | 2483931e25b6040e14af99bb56c505e9c082e758 (patch) | |
tree | 0b627a634cac5c1708887074ade3a58db7d3b7ae /cmake | |
parent | 766904bf5b776a6437ca974efbeb9e99ef13e084 (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.
Pick-to: 6.2
Fixes: QTBUG-96511
Change-Id: I664381df4859a2e85c399cd94dc2f3996e452c03
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtHeadersClean.cmake | 15 |
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}) |