diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-09-09 17:59:06 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-09-10 17:29:11 +0200 |
commit | abf72395411b135054b5820f64f93dfbcda430b8 (patch) | |
tree | 85aee4dbb3def6137d19f83ef9284954a5019db0 | |
parent | ff1a44be33f4bc05d502a2ca49171e0408992f61 (diff) |
CMake: Apply $ORIGIN style rpaths for non-prefix builds as well
This works around linking issues when doing yocto non-prefix Qt
builds, because CMake does not add -rpath-link flags even though it
probably should.
Task-number: QTBUG-86533
Change-Id: Iaaf246ac71ca05d9369ceb6eb9c4a1e206c42839
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | cmake/QtRpathHelpers.cmake | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cmake/QtRpathHelpers.cmake b/cmake/QtRpathHelpers.cmake index 6273de3eb6..126ed2c50f 100644 --- a/cmake/QtRpathHelpers.cmake +++ b/cmake/QtRpathHelpers.cmake @@ -49,7 +49,7 @@ endfunction() function(qt_apply_rpaths) # No rpath support for win32 and android. Also no need to apply rpaths when doing a non-prefix # build. - if(NOT QT_WILL_INSTALL OR WIN32 OR ANDROID) + if(WIN32 OR ANDROID) return() endif() @@ -128,6 +128,11 @@ function(qt_apply_rpaths) if(rpaths) list(REMOVE_DUPLICATES rpaths) - set_property(TARGET "${target}" APPEND PROPERTY INSTALL_RPATH ${rpaths}) + if(QT_WILL_INSTALL) + set(prop_name "INSTALL_RPATH") + else() + set(prop_name "BUILD_RPATH") + endif() + set_property(TARGET "${target}" APPEND PROPERTY "${prop_name}" ${rpaths}) endif() endfunction() |