diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-09-10 17:45:45 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-09-11 19:49:50 +0200 |
commit | 9a2ee310596d229e334b40c4cc37a253009cabf3 (patch) | |
tree | bdd9db4f3e95b35981d0dd965b849471171062e9 /cmake/QtAppHelpers.cmake | |
parent | 9346760f5a173bd3b697b8f800b3c992db1019bd (diff) | |
download | qtbase-9a2ee310596d229e334b40c4cc37a253009cabf3.tar.gz |
CMake: Fix rpaths set for Qt internal apps like Designer
qt_apply_rpaths takes into account properties like MACOSX_BUNDLE. This
property might not yet be set when qt_internal_add_app is called, but
later.
To handle that, move the call of qt_apply_rpaths to
qt_internal_finalize_app.
As a result, the installed apps will have 2 rpaths, the $ORIGIN style
relocatable one, and an absolute path one pointing to the Qt
prefix/lib. The last one might be unnecessary.
Fixes: QTBUG-86514
Change-Id: I25e0d695c78c8b5703e94c99cc2457f772721456
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtAppHelpers.cmake')
-rw-r--r-- | cmake/QtAppHelpers.cmake | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmake/QtAppHelpers.cmake b/cmake/QtAppHelpers.cmake index 845645a75e..20edc41b0a 100644 --- a/cmake/QtAppHelpers.cmake +++ b/cmake/QtAppHelpers.cmake @@ -40,10 +40,6 @@ function(qt_internal_add_app target) qt_internal_add_target_aliases("${target}") _qt_internal_apply_strict_cpp("${target}") - if(NOT arg_NO_INSTALL) - qt_apply_rpaths(TARGET "${target}" INSTALL_PATH "${INSTALL_BINDIR}" RELATIVE_RPATH) - endif() - # To mimic the default behaviors of qt_app.prf, we by default enable GUI Windows applications, # but don't enable macOS bundles. # Bundles are enabled in a separate set_target_properties call if an Info.plist file @@ -99,4 +95,8 @@ function(qt_internal_finalize_app target) if(WIN32) qt6_generate_win32_rc_file("${target}") endif() + + # Rpaths need to be applied in the finalizer, because the MACOSX_BUNDLE property might be + # set after a qt_internal_add_app call. + qt_apply_rpaths(TARGET "${target}" INSTALL_PATH "${INSTALL_BINDIR}" RELATIVE_RPATH) endfunction() |