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}")