From 9df8ac76d4898aac5b4d6078c1034b93c907718d Mon Sep 17 00:00:00 2001 From: scottr Date: Thu, 29 Apr 2021 12:57:11 -0700 Subject: [PATCH 1/3] [install_gem_assets_fix] fixed glob/filter logic for finding gem asset directories to install --- cmake/Platform/Common/Install_common.cmake | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cmake/Platform/Common/Install_common.cmake b/cmake/Platform/Common/Install_common.cmake index b5dc7a30ef..0356a0dcf4 100644 --- a/cmake/Platform/Common/Install_common.cmake +++ b/cmake/Platform/Common/Install_common.cmake @@ -159,15 +159,15 @@ function(ly_generate_target_config_file NAME) elseif(target_type STREQUAL MODULE_LIBRARY) string(APPEND target_location "\"\${LY_ROOT_FOLDER}/${library_output_directory}/${PAL_PLATFORM_NAME}/$/${target_library_output_subdirectory}/$\"") elseif(target_type STREQUAL SHARED_LIBRARY) - string(APPEND target_location "\"\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$/$\"") + string(APPEND target_location "\"\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$/$\"") string(APPEND target_file_contents "ly_add_dependencies(${NAME} \"\${LY_ROOT_FOLDER}/${library_output_directory}/${PAL_PLATFORM_NAME}/$/${target_library_output_subdirectory}/$\")\n") else() # STATIC_LIBRARY, OBJECT_LIBRARY, INTERFACE_LIBRARY string(APPEND target_location "\"\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$/$\"") endif() - string(APPEND target_file_contents + string(APPEND target_file_contents "set(target_location ${target_location}) -set_target_properties(${NAME} +set_target_properties(${NAME} PROPERTIES $<$:IMPORTED_LOCATION \"\${target_location}\"> IMPORTED_LOCATION_$> \"\${target_location}\" @@ -329,9 +329,16 @@ function(ly_setup_others) # Gem Source Assets # Find all gem directories relative to the CMake Source Dir - file(GLOB_RECURSE gems_assets_path RELATIVE ${CMAKE_SOURCE_DIR} "Gems/*/Assets") - foreach (gem_assets_path ${gems_assets_path}) + file( + GLOB_RECURSE + gems_assets_path + LIST_DIRECTORIES TRUE + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" + "Gems/*" + ) + list(FILTER gems_assets_path INCLUDE REGEX "/Assets$") + foreach (gem_assets_path ${gems_assets_path}) set(gem_abs_assets_path ${CMAKE_SOURCE_DIR}/${gem_assets_path}/) if (EXISTS ${gem_abs_assets_path}) # The trailing slash is IMPORTANT here as that is needed to prevent From ce17170bae028b9b36182ab376bdb9a689962c12 Mon Sep 17 00:00:00 2001 From: scottr Date: Thu, 29 Apr 2021 14:40:49 -0700 Subject: [PATCH 2/3] [install_gem_assets_fix] revert gem asset folder glob to use CMAKE_SOURCE_DIR instead of CMAKE_CURRENT_SOURCE_DIR --- cmake/Platform/Common/Install_common.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Platform/Common/Install_common.cmake b/cmake/Platform/Common/Install_common.cmake index 0356a0dcf4..82238170f7 100644 --- a/cmake/Platform/Common/Install_common.cmake +++ b/cmake/Platform/Common/Install_common.cmake @@ -333,7 +333,7 @@ function(ly_setup_others) GLOB_RECURSE gems_assets_path LIST_DIRECTORIES TRUE - RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" + RELATIVE "${CMAKE_SOURCE_DIR}/" "Gems/*" ) list(FILTER gems_assets_path INCLUDE REGEX "/Assets$") From 37f0b44de47c90c29df8eceb8f901fcab8245db8 Mon Sep 17 00:00:00 2001 From: scottr Date: Thu, 29 Apr 2021 16:01:15 -0700 Subject: [PATCH 3/3] [install_gem_assets_fix] include the Registry folder in the gem install filtering --- cmake/Platform/Common/Install_common.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Platform/Common/Install_common.cmake b/cmake/Platform/Common/Install_common.cmake index 82238170f7..fb3a7b1b09 100644 --- a/cmake/Platform/Common/Install_common.cmake +++ b/cmake/Platform/Common/Install_common.cmake @@ -327,7 +327,7 @@ function(ly_setup_others) COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} ) - # Gem Source Assets + # Gem Source Assets and Registry # Find all gem directories relative to the CMake Source Dir file( GLOB_RECURSE @@ -336,7 +336,7 @@ function(ly_setup_others) RELATIVE "${CMAKE_SOURCE_DIR}/" "Gems/*" ) - list(FILTER gems_assets_path INCLUDE REGEX "/Assets$") + list(FILTER gems_assets_path INCLUDE REGEX "/(Assets|Registry)$") foreach (gem_assets_path ${gems_assets_path}) set(gem_abs_assets_path ${CMAKE_SOURCE_DIR}/${gem_assets_path}/)