Fix rpaths during o3de sdk install on Linux (#3370)

* Fix rpaths during o3de sdk install on Linux

Adds install code that modifies ly_copy commands to fix rpaths for things like qt plugins.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Add newline at end of file

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Update to use bracket argument

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Minor edit

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>

* Move the string configure call to inside override

Per feedback.

Signed-off-by: amzn-phist <52085794+amzn-phist@users.noreply.github.com>
monroegm-disable-blank-issue-2
amzn-phist 4 years ago committed by GitHub
parent b23a70ff42
commit c66dcc7413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,4 +6,20 @@
#
#
include(cmake/Platform/Common/Install_common.cmake)
#! ly_install_code_function_override: Linux-specific copy function to handle RPATH fixes
set(ly_copy_template [[
function(ly_copy source_file target_directory)
file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN)
get_filename_component(target_filename_ext "${source_file}" LAST_EXT)
if("${source_file}" MATCHES "qt/plugins" AND "${target_filename_ext}" STREQUAL ".so")
get_filename_component(target_filename "${source_file}" NAME)
file(RPATH_CHANGE FILE "${target_directory}/${target_filename}" OLD_RPATH "\$ORIGIN/../../lib" NEW_RPATH "\$ORIGIN/..")
endif()
endfunction()]])
function(ly_install_code_function_override)
string(CONFIGURE "${ly_copy_template}" ly_copy_function_linux @ONLY)
install(CODE "${ly_copy_function_linux}")
endfunction()
include(cmake/Platform/Common/Install_common.cmake)

Loading…
Cancel
Save