Files
o3de/cmake/Platform/Common/runtime_dependencies_common.cmake.in
T
2021-06-23 10:55:22 -07:00

25 lines
942 B
CMake

#
# Copyright (c) Contributors to the Open 3D Engine Project
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
cmake_policy(SET CMP0012 NEW) # new policy for the if that evaluates a boolean out of "if(NOT ${same_location})"
function(ly_copy source_file target_directory)
get_filename_component(target_filename "${source_file}" NAME)
cmake_path(COMPARE "${source_file}" EQUAL "${target_directory}/${target_filename}" same_location)
if(NOT ${same_location})
if(NOT EXISTS "${target_directory}")
file(MAKE_DIRECTORY "${target_directory}")
endif()
if("${source_file}" IS_NEWER_THAN "${target_directory}/${target_filename}")
file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN)
endif()
endif()
endfunction()
file(LOCK "${CMAKE_BINARY_DIR}/runtimedependencies.lock" TIMEOUT 300)
@LY_COPY_COMMANDS@