Files
o3de/cmake/Platform/Linux/Install_linux.cmake
T
Esteban Papp dbc5d7a8bc Cherry-pick of Linux deb package to stabilization (#5778)
* Cherry-pick 49e8f35858

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Merging differences from development of other changes that need to be there for deb packaging

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Picks a needed change for the installer

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Fixes warning in mac

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Takes version from environment if defined

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Do not pick up version if it is empty string since that will also break version comparison

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* creating temp directories if they dont exist

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* removing a dependency to itself (Multiplayer.Builders is an alias of Multiplayer.Editor)

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Filters which runtime dependencies are passed from private build dependencies to only those that are actual targets.
This avoids something like a "d3d12" private build dependency from being passed to the runtime dependencies

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
2021-11-19 14:07:25 -08:00

47 lines
2.1 KiB
CMake

#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
#! ly_setup_runtime_dependencies_copy_function_override: Linux-specific copy function to handle RPATH fixes
set(ly_copy_template [[
function(ly_copy source_file target_directory)
cmake_path(GET source_file FILENAME target_filename)
cmake_path(APPEND full_target_directory "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}" "${target_directory}")
cmake_path(APPEND target_file "${full_target_directory}" "${target_filename}")
if("${source_file}" IS_NEWER_THAN "${target_file}")
message(STATUS "Copying ${source_file} to ${full_target_directory}...")
file(MAKE_DIRECTORY "${full_target_directory}")
file(COPY "${source_file}" DESTINATION "${full_target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN)
file(TOUCH_NOCREATE "${target_file}")
# Special case for install
cmake_PATH(GET source_file EXTENSION target_filename_ext)
if("${target_filename_ext}" STREQUAL ".so")
if("${source_file}" MATCHES "qt/plugins")
file(RPATH_CHANGE FILE "${target_file}" OLD_RPATH "\$ORIGIN/../../lib" NEW_RPATH "\$ORIGIN/..")
endif()
if(CMAKE_INSTALL_DO_STRIP)
execute_process(COMMAND @CMAKE_STRIP@ "${target_file}")
endif()
elseif("${source_file}" MATCHES "lrelease")
file(RPATH_CHANGE FILE "${target_file}" OLD_RPATH "\$ORIGIN/../lib" NEW_RPATH "\$ORIGIN")
endif()
endif()
endfunction()]])
function(ly_setup_runtime_dependencies_copy_function_override)
string(CONFIGURE "${ly_copy_template}" ly_copy_function_linux @ONLY)
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
string(TOUPPER ${conf} UCONF)
ly_install(CODE "${ly_copy_function_linux}"
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
)
endforeach()
endfunction()
include(cmake/Platform/Common/Install_common.cmake)