copy commands need to be per permutation/per configuraiton (#5183)

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-11-01 15:18:30 -07:00
committed by GitHub
parent 96159c1e3a
commit bf0a309a3c
3 changed files with 22 additions and 12 deletions
+10 -8
View File
@@ -525,15 +525,20 @@ function(ly_setup_runtime_dependencies)
if(COMMAND ly_setup_runtime_dependencies_copy_function_override)
ly_setup_runtime_dependencies_copy_function_override()
else()
ly_install(CODE
# despite this copy function being the same, we need to install it per component that uses it
# (which is per-configuration per-permutation component)
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
string(TOUPPER ${conf} UCONF)
ly_install(CODE
"function(ly_copy source_file target_directory)
cmake_path(GET source_file FILENAME file_name)
if(NOT EXISTS \${target_directory}/\${file_name})
file(COPY \"\${source_file}\" DESTINATION \"\${target_directory}\" FILE_PERMISSIONS ${LY_COPY_PERMISSIONS})
endif()
endfunction()"
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
)
endforeach()
endif()
unset(runtime_commands)
@@ -574,11 +579,8 @@ endfunction()"
list(JOIN runtime_commands " " runtime_commands_str) # the spaces are just to see the right identation in the cmake_install.cmake file
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
string(TOUPPER ${conf} UCONF)
ly_install(CODE
"if(\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^(${conf})\$\")
${runtime_commands_str}
endif()"
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}_${UCONF}
ly_install(CODE "${runtime_commands_str}"
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
)
endforeach()
+6 -3
View File
@@ -22,9 +22,12 @@ endfunction()]])
function(ly_setup_runtime_dependencies_copy_function_override)
string(CONFIGURE "${ly_copy_template}" ly_copy_function_linux @ONLY)
ly_install(CODE "${ly_copy_function_linux}"
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
)
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)
+6 -1
View File
@@ -113,7 +113,12 @@ endfunction()
function(ly_setup_runtime_dependencies_copy_function_override)
configure_file(${LY_ROOT_FOLDER}/cmake/Platform/Mac/InstallUtils_mac.cmake.in ${CMAKE_BINARY_DIR}/runtime_install/InstallUtils_mac.cmake @ONLY)
ly_install_run_script(${CMAKE_BINARY_DIR}/runtime_install/InstallUtils_mac.cmake)
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
string(TOUPPER ${conf} UCONF)
ly_install(SCRIPT "${CMAKE_BINARY_DIR}/runtime_install/InstallUtils_mac.cmake"
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
)
endforeach()
endfunction()