From 411bbc8e2fd1f35b074efae51e68abb06875c4c6 Mon Sep 17 00:00:00 2001 From: Esteban Papp Date: Mon, 14 Jun 2021 17:03:09 -0700 Subject: [PATCH] removed the copy of bundles since fixup_bundle does a better job --- .../Mac/runtime_dependencies_mac.cmake.in | 62 +++++++++---------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in index a0b418daff..a51260fd3f 100644 --- a/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in +++ b/cmake/Platform/Mac/runtime_dependencies_mac.cmake.in @@ -11,8 +11,6 @@ include(BundleUtilities) -#set(BU_COPY_FULL_FRAMEWORK_CONTENTS ON) - set(anything_new FALSE) set(plugin_libs) set(plugin_dirs) @@ -30,10 +28,10 @@ function(ly_copy source_file target_directory) # fixup origin to copy the whole Framework folder and change destination to Contents/Frameworks string(REGEX REPLACE "(.*\\.[Ff]ramework).*" "\\1" source_file "${source_file}") - string(REGEX REPLACE "(.*\\.app/Contents)/MacOS" "\\1/Frameworks" target_directory "${target_directory}") - + get_filename_component(source_file_folder "${source_file}" DIRECTORY) + set(local_plugin_dirs ${plugin_dirs}) - list(APPEND local_plugin_dirs "${target_directory}") + list(APPEND local_plugin_dirs "${source_file_folder}") set(plugin_dirs ${local_plugin_dirs} PARENT_SCOPE) return() @@ -69,10 +67,7 @@ function(ly_copy source_file target_directory) if(NOT EXISTS "${target_directory}") file(MAKE_DIRECTORY "${target_directory}") endif() - if(IS_DIRECTORY ${source_file}) - message(STATUS "Copying \"${source_file}\" to \"${target_directory}\"...") - file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN) - elseif(NOT EXISTS "${target_directory}/${target_filename}" OR "${source_file}" IS_NEWER_THAN "${target_directory}/${target_filename}") + if(NOT EXISTS "${target_directory}/${target_filename}" OR "${source_file}" IS_NEWER_THAN "${target_directory}/${target_filename}") message(STATUS "Copying \"${source_file}\" to \"${target_directory}\"...") file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN) file(TOUCH ${target_directory}/${target_filename}) @@ -103,30 +98,31 @@ if(@target_file_dir@ MATCHES ".app/Contents/MacOS") DESTINATION ${bundle_path}/Contents/MacOS/Builders/DirectXShaderCompiler/bin ) endif() - if(EXISTS ${bundle_path}/Contents/Frameworks/Python.framework) - # LYN-4502: Patch python bundle, it contains some windows executables, some files that fixup_bundle doesnt like and has - # duplicated binaries between Versions/3.7 and Versions/Current. - file(GLOB exe_files - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/*.exe - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/*.exe - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/*.exe - ) - foreach(exe_file ${exe_files}) - file(REMOVE ${exe_file}) - endforeach() - file(REMOVE_RECURSE - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/test - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scipy/io/tests - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/Resources - ${bundle_path}/Contents/Frameworks/Python.framework/Python - ${bundle_path}/Contents/Frameworks/Python.framework/Resources/Python.app - ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/Python - ) - file(REMOVE_RECURSE ${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current) - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink 3.7 Current - WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework/Versions/ - ) - endif() + # Python.framework being copied by fixup_bundle + #if(EXISTS ${bundle_path}/Contents/Frameworks/Python.framework) + # # LYN-4502: Patch python bundle, it contains some windows executables, some files that fixup_bundle doesnt like and has + # # duplicated binaries between Versions/3.7 and Versions/Current. + # file(GLOB exe_files + # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/*.exe + # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/distlib/*.exe + # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/*.exe + # ) + # foreach(exe_file ${exe_files}) + # file(REMOVE ${exe_file}) + # endforeach() + # file(REMOVE_RECURSE + # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/test + # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/scipy/io/tests + # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/Resources + # ${bundle_path}/Contents/Frameworks/Python.framework/Python + # ${bundle_path}/Contents/Frameworks/Python.framework/Resources/Python.app + # ${bundle_path}/Contents/Frameworks/Python.framework/Versions/3.7/Python + # ) + # file(REMOVE_RECURSE ${bundle_path}/Contents/Frameworks/Python.framework/Versions/Current) + # execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink 3.7 Current + # WORKING_DIRECTORY ${bundle_path}/Contents/Frameworks/Python.framework/Versions/ + # ) + #endif() list(REMOVE_DUPLICATES plugin_libs) list(REMOVE_DUPLICATES plugin_dirs) fixup_bundle("${bundle_path}" "${plugin_libs}" "${plugin_dirs}")