Merge branch 'ly-as-sdk/LYN-2948' of https://github.com/aws-lumberyard-dev/o3de into ly-as-sdk/LYN-2948

# Conflicts:
#	cmake/Platform/Common/Install_common.cmake
This commit is contained in:
pappeste
2021-05-10 12:01:49 -07:00
11 changed files with 67 additions and 40 deletions
@@ -1215,7 +1215,7 @@ namespace AZ
// So auto load is turned off if option "AutoLoad" key is bool that is false
if (valueName == "AutoLoad" && !value)
{
// Strip off the AutoLoead entry from the path
// Strip off the AutoLoad entry from the path
auto autoLoadKey = AZ::StringFunc::TokenizeLast(path, "/");
if (!autoLoadKey)
{
@@ -512,7 +512,7 @@ namespace AZ
// Load DLLs specified in the application descriptor
for (const auto& moduleDescriptor : modules)
{
// For each module that is loaded, attempt to set the module's folder as a path for dependent module resolution
// For each module that is loaded, attempt to set the module's folder as a path for dependent module resolution
moduleSearchPathHelper.SetModuleSearchPath(moduleDescriptor);
LoadModuleOutcome result = LoadDynamicModule(moduleDescriptor.m_dynamicLibraryPath.c_str(), lastStepToPerform, maintainReferences);
+2 -2
View File
@@ -488,8 +488,8 @@ namespace O3DELauncher
const AZStd::string_view buildTargetName = GetBuildTargetName();
AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddBuildSystemTargetSpecialization(*settingsRegistry, buildTargetName);
AZ_TracePrintf("Launcher", R"(Running project "%.*s.)" "\n"
R"(The project name value has been successfully set in the Settings Registry at key "%s/project_name)"
AZ_TracePrintf("Launcher", R"(Running project "%.*s")" "\n"
R"(The project name has been successfully set in the Settings Registry at key "%s/project_name")"
R"( for Launcher target "%.*s")" "\n",
aznumeric_cast<int>(launcherProjectName.size()), launcherProjectName.data(),
AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey,
@@ -10,6 +10,11 @@
#
set(ICON_FILE ${project_real_path}/Gem/Resources/GameSDK.ico)
if(NOT EXISTS ${ICON_FILE})
# Try another project-relative path
set(ICON_FILE ${project_real_path}/Resources/GameSDK.ico)
endif()
if(NOT EXISTS ${ICON_FILE})
# Try the common LauncherUnified icon instead
set(ICON_FILE Resources/GameSDK.ico)
+1 -1
View File
@@ -85,7 +85,7 @@ function(ly_add_target)
if(NOT ly_add_target_NAME)
message(FATAL_ERROR "You must provide a name for the target")
endif()
if(NOT ly_add_target_IMPORTED)
if(NOT ly_add_target_IMPORTED AND NOT ly_add_target_HEADERONLY)
if(NOT ly_add_target_FILES_CMAKE)
message(FATAL_ERROR "You must provide a list of _files.cmake files for the target")
endif()
+38 -29
View File
@@ -32,7 +32,7 @@ function(ly_setup_target ALIAS_TARGET_NAME)
ly_de_alias_target(${ALIAS_TARGET_NAME} TARGET_NAME)
get_target_property(absolute_target_source_dir ${TARGET_NAME} SOURCE_DIR)
file(RELATIVE_PATH target_source_dir ${CMAKE_SOURCE_DIR} ${absolute_target_source_dir})
file(RELATIVE_PATH target_source_dir ${LY_ROOT_FOLDER} ${absolute_target_source_dir})
# All include directories marked PUBLIC or INTERFACE will be installed
set(include_location "include")
@@ -98,6 +98,12 @@ function(ly_setup_target ALIAS_TARGET_NAME)
set(NAME_PLACEHOLDER ${TARGET_NAME})
endif()
set(TARGET_TYPE_PLACEHOLDER "IMPORTED")
get_target_property(target_type ${NAME_PLACEHOLDER} TYPE)
if(target_type STREQUAL INTERFACE_LIBRARY)
set(TARGET_TYPE_PLACEHOLDER "HEADERONLY")
endif()
get_target_property(COMPILE_DEFINITIONS_PLACEHOLDER ${TARGET_NAME} INTERFACE_COMPILE_DEFINITIONS)
if(COMPILE_DEFINITIONS_PLACEHOLDER)
string(REPLACE ";" "\n" COMPILE_DEFINITIONS_PLACEHOLDER "${COMPILE_DEFINITIONS_PLACEHOLDER}")
@@ -153,8 +159,6 @@ function(ly_setup_target ALIAS_TARGET_NAME)
)
# Config file
get_target_property(target_type ${TARGET_NAME} TYPE)
set(target_file_contents "# Generated by O3DE install\n\n")
if(NOT target_type STREQUAL INTERFACE_LIBRARY)
@@ -208,16 +212,20 @@ endfunction()
#! ly_setup_cmake_install: install the "cmake" folder
function(ly_setup_cmake_install)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/cmake"
install(DIRECTORY "${LY_ROOT_FOLDER}/cmake"
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
PATTERN "__pycache__" EXCLUDE
REGEX "Findo3de.cmake" EXCLUDE
REGEX "Platform\/.*\/BuiltInPackages_.*\.cmake" EXCLUDE
)
configure_file(${LY_ROOT_FOLDER}/cmake/install/engine.json.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/engine.json @ONLY)
install(
FILES
"${CMAKE_SOURCE_DIR}/CMakeLists.txt"
"${CMAKE_SOURCE_DIR}/engine.json"
"${LY_ROOT_FOLDER}/CMakeLists.txt"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/engine.json"
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
@@ -241,7 +249,7 @@ function(ly_setup_cmake_install)
unset(FIND_PACKAGES_PLACEHOLDER)
foreach(target IN LISTS all_targets)
get_target_property(target_source_dir ${target} SOURCE_DIR)
file(RELATIVE_PATH target_source_dir_relative ${CMAKE_SOURCE_DIR} ${target_source_dir})
file(RELATIVE_PATH target_source_dir_relative ${LY_ROOT_FOLDER} ${target_source_dir})
string(APPEND FIND_PACKAGES_PLACEHOLDER " add_subdirectory(${target_source_dir_relative}/${target})\n")
endforeach()
@@ -352,15 +360,16 @@ function(ly_setup_others)
set(install_path .)
endif()
install(DIRECTORY "${CMAKE_SOURCE_DIR}/${dir}"
install(DIRECTORY "${LY_ROOT_FOLDER}/${dir}"
DESTINATION ${install_path}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
PATTERN "__pycache__" EXCLUDE
)
endforeach()
# Scripts
file(GLOB o3de_scripts "${CMAKE_SOURCE_DIR}/scripts/o3de.*")
file(GLOB o3de_scripts "${LY_ROOT_FOLDER}/scripts/o3de.*")
install(FILES
${o3de_scripts}
DESTINATION ./scripts
@@ -368,8 +377,8 @@ function(ly_setup_others)
)
install(DIRECTORY
${CMAKE_SOURCE_DIR}/scripts/bundler
${CMAKE_SOURCE_DIR}/scripts/project_manager
${LY_ROOT_FOLDER}/scripts/bundler
${LY_ROOT_FOLDER}/scripts/project_manager
DESTINATION ./scripts
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
PATTERN "__pycache__" EXCLUDE
@@ -377,7 +386,7 @@ function(ly_setup_others)
PATTERN "tests" EXCLUDE
)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/python"
install(DIRECTORY "${LY_ROOT_FOLDER}/python"
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
REGEX "downloaded_packages" EXCLUDE
@@ -391,14 +400,14 @@ function(ly_setup_others)
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
install(DIRECTORY
${CMAKE_SOURCE_DIR}/Registry
${LY_ROOT_FOLDER}/Registry
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# Engine Source Assets
install(DIRECTORY
${CMAKE_SOURCE_DIR}/Assets
${LY_ROOT_FOLDER}/Assets
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
@@ -408,13 +417,13 @@ function(ly_setup_others)
file(GLOB_RECURSE
gems_assets_path
LIST_DIRECTORIES TRUE
RELATIVE "${CMAKE_SOURCE_DIR}/"
RELATIVE "${LY_ROOT_FOLDER}/"
"Gems/*"
)
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}/)
set(gem_abs_assets_path ${LY_ROOT_FOLDER}/${gem_assets_path}/)
if (EXISTS ${gem_abs_assets_path})
# The trailing slash is IMPORTANT here as that is needed to prevent
# the "Assets" folder from being copied underneath the <gem-root>/Assets folder
@@ -429,36 +438,36 @@ function(ly_setup_others)
file(GLOB_RECURSE
gems_json_path
LIST_DIRECTORIES FALSE
RELATIVE "${CMAKE_SOURCE_DIR}"
RELATIVE "${LY_ROOT_FOLDER}"
"Gems/*/gem.json"
)
foreach(gem_json_path ${gems_json_path})
get_filename_component(gem_relative_path ${gem_json_path} DIRECTORY)
install(FILES ${gem_json_path}
DESTINATION ${gem_relative_path}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
endforeach()
# Additional files needed by gems
install(DIRECTORY
${CMAKE_SOURCE_DIR}/Gems/Atom/Asset/ImageProcessingAtom/Config
${LY_ROOT_FOLDER}/Gems/Atom/Asset/ImageProcessingAtom/Config
DESTINATION Gems/Atom/Asset/ImageProcessingAtom
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# Templates
install(DIRECTORY
${CMAKE_SOURCE_DIR}/Templates
${LY_ROOT_FOLDER}/Templates
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
# Misc
install(FILES
${CMAKE_SOURCE_DIR}/ctest_pytest.ini
${CMAKE_SOURCE_DIR}/LICENSE.txt
${CMAKE_SOURCE_DIR}/README.md
${LY_ROOT_FOLDER}/ctest_pytest.ini
${LY_ROOT_FOLDER}/LICENSE.txt
${LY_ROOT_FOLDER}/README.md
DESTINATION .
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
@@ -469,18 +478,18 @@ endfunction()
function(ly_setup_target_generator)
install(FILES
${CMAKE_SOURCE_DIR}/Code/LauncherUnified/launcher_generator.cmake
${CMAKE_SOURCE_DIR}/Code/LauncherUnified/launcher_project_files.cmake
${CMAKE_SOURCE_DIR}/Code/LauncherUnified/LauncherProject.cpp
${CMAKE_SOURCE_DIR}/Code/LauncherUnified/StaticModules.in
${LY_ROOT_FOLDER}/Code/LauncherUnified/launcher_generator.cmake
${LY_ROOT_FOLDER}/Code/LauncherUnified/launcher_project_files.cmake
${LY_ROOT_FOLDER}/Code/LauncherUnified/LauncherProject.cpp
${LY_ROOT_FOLDER}/Code/LauncherUnified/StaticModules.in
DESTINATION LauncherGenerator
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/Platform
install(DIRECTORY ${LY_ROOT_FOLDER}/Code/LauncherUnified/Platform
DESTINATION LauncherGenerator
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
install(FILES ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/FindLauncherGenerator.cmake
install(FILES ${LY_ROOT_FOLDER}/Code/LauncherUnified/FindLauncherGenerator.cmake
DESTINATION cmake
COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}
)
+7 -3
View File
@@ -125,9 +125,13 @@ function(ly_delayed_generate_settings_registry)
endif()
get_property(gem_relative_source_dir TARGET ${gem_target} PROPERTY SOURCE_DIR)
if(gem_relative_source_dir)
# Most gems SOURCE dir is nested in the path, we need to find the path to the gem.json file
while(NOT EXISTS ${gem_relative_source_dir}/gem.json)
get_filename_component(gem_relative_source_dir ${gem_relative_source_dir} DIRECTORY)
# Most gems SOURCE dir is nested in the path, we need to find the path to the gem.json or project.json file
while(NOT EXISTS ${gem_relative_source_dir}/gem.json AND NOT EXISTS ${gem_relative_source_dir}/project.json)
get_filename_component(parent_dir ${gem_relative_source_dir} DIRECTORY)
if (${parent_dir} STREQUAL ${gem_relative_source_dir})
message(FATAL_ERROR "Did not find gem.json or project.json while processing target ${gem_target}!")
endif()
set(gem_relative_source_dir ${parent_dir})
endwhile()
file(TO_CMAKE_PATH ${LY_ROOT_FOLDER} ly_root_folder_cmake)
file(RELATIVE_PATH gem_relative_source_dir ${ly_root_folder_cmake} ${gem_relative_source_dir})
+2 -1
View File
@@ -12,4 +12,5 @@
string(TIMESTAMP current_year "%Y")
set(LY_VERSION_COPYRIGHT_YEAR ${current_year} CACHE STRING "Open 3D Engine's copyright year")
set(LY_VERSION_STRING "0.0.0.0" CACHE STRING "Open 3D Engine's version")
set(LY_VERSION_BUILD_NUMBER 0 CACHE STRING "Open 3D Engine's build number")
set(LY_VERSION_BUILD_NUMBER 0 CACHE STRING "Open 3D Engine's build number")
set(LY_VERSION_ENGINE_NAME "o3de" CACHE STRING "Open 3D Engine's engine name")
+1 -1
View File
@@ -12,7 +12,7 @@
# Generated by O3DE
ly_add_target(
NAME @NAME_PLACEHOLDER@ IMPORTED
NAME @NAME_PLACEHOLDER@ @TARGET_TYPE_PLACEHOLDER@
@NAMESPACE_PLACEHOLDER@
COMPILE_DEFINITIONS
INTERFACE
+7
View File
@@ -0,0 +1,7 @@
{
"engine_name": "@LY_VERSION_ENGINE_NAME@",
"FileVersion": 1,
"O3DEVersion": "@LY_VERSION_STRING@",
"O3DECopyrightYear": @LY_VERSION_COPYRIGHT_YEAR@,
"O3DEBuildNumber": @LY_VERSION_BUILD_NUMBER@
}
+2 -1
View File
@@ -2,5 +2,6 @@
"engine_name": "o3de",
"FileVersion": 1,
"O3DEVersion": "0.0.0.0",
"O3DECopyrightYear": 2021
"O3DECopyrightYear": 2021,
"O3DEBuildNumber": 0
}