Fix framework path for developer documentation build on macOS

At some point the LOCATION target property of Qt::Core must have changed
from
    <fw_path>/QtCore.framework/QtCore
to
    <fw_path>/QtCore.framework/Versions/A/QtCore
which broke the code that tried to infer the `fw_path` from it.
Instead of constructing a relative path from the LOCATION, just
cut off the `/QtCore.framework/` and anything after it.

Change-Id: Ieed8ade6318c602d9cb4ff9685a084e4f8194086
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Eike Ziller
2024-07-04 11:45:28 +02:00
parent 14ef6da101
commit eaa40953af

View File

@@ -32,9 +32,12 @@ function(_find_all_includes _ret_includes _ret_framework_paths)
else()
set(_qt_core "Qt::Core")
endif()
get_target_property(_qt_target ${_qt_core} LOCATION) # <fw_path>/QtCore.framework/QtCore
get_filename_component(_qt_loc "${_qt_target}" DIRECTORY)
set("${_ret_framework_paths}" "${_qt_loc}/.." PARENT_SCOPE)
get_target_property(_qt_target ${_qt_core} LOCATION)
# eg <fw_path>/QtCore.framework/QtCore
# or <fw_path>/QtCore.framework/Versions/A/QtCore
# cut off /QtCore.framework/*
string(REGEX REPLACE "/QtCore.framework/.*" "" _qt_loc "${_qt_target}")
set("${_ret_framework_paths}" "${_qt_loc}" PARENT_SCOPE)
endif()
endfunction()