From 2422a90f1e27e74f9915a1d543689aa64b74ccdb Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 18 Nov 2020 10:55:21 +0100 Subject: [PATCH] cmake build/macOS: Fix installing when built with Qt6 In a framework the actual library can be accessed via two different paths: - Foo.framework/Foo - Foo.framework/Versions/A/Foo It happens that Qt5 exports the first variant for the framework LOCATION and Qt6 exports the second variant. We want to cut the whole "Foo.framework" part for the framework's location, so actually do that. Amends 98db9774f2363314f51b1732646396112418320e Change-Id: Idad12e92f2bfbdc480256a832320c4dec76a0e5f Reviewed-by: Cristian Adam --- cmake/QtCreatorAPI.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index d1f492b6c5f..3b02eeda2db 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -687,7 +687,8 @@ function(add_qtc_executable name) get_target_property(_location ${_lib} LOCATION) get_target_property(_is_framework ${_lib} FRAMEWORK) if (_is_framework) - set(_location ${_location}/../..) + # get rid of the whole Foo.framework/* part whereever it is + string(REGEX REPLACE "/[^/]*[.]framework/.*" "" _location ${_location}) endif() get_filename_component(_abs_location ${_location} ABSOLUTE) list(APPEND _rpaths_to_remove "${_abs_location}")