Create Deploy Script that can copy a Project Game Release Layout to a standalone location
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ AssetProcessorTemp/**
|
||||
[Oo]ut/**
|
||||
CMakeUserPresets.json
|
||||
[Cc]ache/
|
||||
/install/
|
||||
/[Ii]nstall/
|
||||
Editor/EditorEventLog.xml
|
||||
Editor/EditorLayout.xml
|
||||
**/*egg-info/**
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
e_StatoscopeScreenshotCapturePeriod = 1
|
||||
|
||||
e_StatoscopeDataGroups = Oulm
|
||||
sys_pakLogInvalidFileAccess = 1
|
||||
e_StatoscopeWriteTimeout = 10
|
||||
e_StatoscopeConnectTimeout = 10
|
||||
+1
-1
@@ -132,7 +132,7 @@ ly_delayed_generate_runtime_dependencies()
|
||||
ly_test_impact_post_step()
|
||||
|
||||
# 7. Generate the O3DE find file and setup install locations for scripts, tools, assets etc., required by the engine
|
||||
if(NOT INSTALLED_ENGINE)
|
||||
if(LY_INSTALL_ENABLED)
|
||||
# 8. Generate the O3DE find file and setup install locations for scripts, tools, assets etc., required by the engine
|
||||
ly_setup_o3de_install()
|
||||
# 9. CPack information (to be included after install)
|
||||
|
||||
@@ -278,7 +278,7 @@ namespace AZ
|
||||
|
||||
#define AZ_Printf(window, ...) AZ::Debug::Trace::Instance().Printf(window, __VA_ARGS__);
|
||||
|
||||
#if !defined(RELEASE) || defined(PERFORMANCE_BUILD)
|
||||
#if !defined(RELEASE)
|
||||
// Unconditional critical error log, enabled up to Performance config
|
||||
#define AZ_Fatal(window, format, ...) AZ::Debug::Trace::Instance().Printf(window, "[FATAL] " format "\n", ##__VA_ARGS__);
|
||||
#define AZ_Crash() AZ::Debug::Trace::Instance().Crash();
|
||||
|
||||
@@ -1290,13 +1290,13 @@ namespace AZ
|
||||
|
||||
const EventArray& GetEvents() const;
|
||||
|
||||
#if defined(PERFORMANCE_BUILD) || !defined(_RELEASE) // m_scriptPath is only available in non-Release mode
|
||||
#if !defined(_RELEASE) // m_scriptPath is only available in non-Release mode
|
||||
AZStd::string m_scriptPath;
|
||||
#endif
|
||||
|
||||
AZStd::string GetScriptPath() const
|
||||
{
|
||||
#if defined(PERFORMANCE_BUILD) || !defined(_RELEASE) // m_scriptPath is only available in non-Release mode
|
||||
#if !defined(_RELEASE) // m_scriptPath is only available in non-Release mode
|
||||
return m_scriptPath;
|
||||
#else
|
||||
return{};
|
||||
@@ -1305,7 +1305,7 @@ namespace AZ
|
||||
|
||||
void SetScriptPath(const char* scriptPath)
|
||||
{
|
||||
#if defined(PERFORMANCE_BUILD) || !defined(_RELEASE) // m_scriptPath is only available in non-Release mode
|
||||
#if !defined(_RELEASE) // m_scriptPath is only available in non-Release mode
|
||||
m_scriptPath = scriptPath;
|
||||
#else
|
||||
AZ_UNUSED(scriptPath);
|
||||
|
||||
@@ -3727,7 +3727,7 @@ LUA_API const Node* lua_getDummyNode()
|
||||
|
||||
if (m_handler)
|
||||
{
|
||||
#if defined(PERFORMANCE_BUILD) || !defined(_RELEASE)
|
||||
#if !defined(_RELEASE)
|
||||
const AZStd::string_view luaString("Lua");
|
||||
lua_Debug info;
|
||||
for (int level = 0; lua_getstack(m_lua, level, &info); ++level)
|
||||
@@ -3739,7 +3739,7 @@ LUA_API const Node* lua_getDummyNode()
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif//defined(PERFORMANCE_BUILD) || !defined(_RELEASE)
|
||||
#endif
|
||||
|
||||
BindEvents(scriptTable);
|
||||
|
||||
|
||||
@@ -987,7 +987,7 @@ namespace AzFramework
|
||||
void AssetCatalog::AddCatalogEntry(AZStd::shared_ptr<AzFramework::AssetRegistry> deltaCatalog)
|
||||
{
|
||||
AZStd::lock_guard<AZStd::recursive_mutex> lock(m_deltaCatalogMutex);
|
||||
#if defined(PERFORMANCE_BUILD) || !defined(_RELEASE)
|
||||
#if !defined(_RELEASE)
|
||||
for (const auto& thisElement : m_deltaCatalogList)
|
||||
{
|
||||
if (thisElement == deltaCatalog)
|
||||
@@ -1010,7 +1010,7 @@ namespace AzFramework
|
||||
AZ_Warning("AssetCatalog", false, "Catalog name %p can't be inserted at slot %u", deltaCatalog.get(), catalogIndex);
|
||||
return;
|
||||
}
|
||||
#if defined(PERFORMANCE_BUILD) || !defined(_RELEASE)
|
||||
#if !defined(_RELEASE)
|
||||
for (const auto& thisElement : m_deltaCatalogList)
|
||||
{
|
||||
if (thisElement == deltaCatalog)
|
||||
|
||||
@@ -111,6 +111,7 @@ ly_install_directory(
|
||||
Platform/${PAL_PLATFORM_NAME}
|
||||
Platform/Common
|
||||
DESTINATION LauncherGenerator/Platform
|
||||
VERBATIM
|
||||
)
|
||||
ly_install_files(
|
||||
FILES FindLauncherGenerator.cmake
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#define AZ_RESTRICTED_SECTION PROJECTDEFINES_H_SECTION_STATS_AGENT
|
||||
#include AZ_RESTRICTED_FILE(ProjectDefines_h)
|
||||
#elif defined(WIN32) || defined(WIN64)
|
||||
#if !defined(_RELEASE) || defined(PERFORMANCE_BUILD)
|
||||
#if !defined(_RELEASE)
|
||||
#define ENABLE_STATS_AGENT
|
||||
#endif
|
||||
#endif
|
||||
@@ -71,7 +71,7 @@
|
||||
#define REMOTE_ASSET_PROCESSOR
|
||||
#endif
|
||||
|
||||
#if (!defined(_RELEASE) || defined(PERFORMANCE_BUILD))
|
||||
#if !defined(_RELEASE)
|
||||
#define USE_HTTP_WEBSOCKETS 0
|
||||
#endif
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (!defined(_RELEASE) || defined(PERFORMANCE_BUILD))
|
||||
#if !defined(_RELEASE)
|
||||
#ifndef ENABLE_PROFILING_CODE
|
||||
#define ENABLE_PROFILING_CODE
|
||||
#endif
|
||||
|
||||
@@ -1433,10 +1433,6 @@ AZ_POP_DISABLE_WARNING
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(PERFORMANCE_BUILD)
|
||||
LoadConfiguration("performance.cfg");
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
if (g_cvars.sys_asserts == 0)
|
||||
{
|
||||
|
||||
@@ -297,7 +297,7 @@ void CXConsole::Init(ISystem* pSystem)
|
||||
AzFramework::InputChannelEventListener::Connect();
|
||||
AzFramework::InputTextEventListener::Connect();
|
||||
|
||||
#if defined(_RELEASE) && !defined(PERFORMANCE_BUILD)
|
||||
#if defined(_RELEASE)
|
||||
static const int kDeactivateConsoleDefault = 1;
|
||||
#else
|
||||
static const int kDeactivateConsoleDefault = 0;
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
#
|
||||
#
|
||||
|
||||
if(LY_MONOLITHIC_GAME)
|
||||
return()
|
||||
endif()
|
||||
|
||||
ly_add_target(
|
||||
NAME TestImpact.Frontend.Console.Static STATIC
|
||||
NAMESPACE AZ
|
||||
|
||||
@@ -39,7 +39,7 @@ ly_add_target(
|
||||
Gem::Atom_Utils.Static
|
||||
Gem::Atom_Feature_Common.Public
|
||||
Gem::ImGui.imguilib
|
||||
3rdParty::lux_core
|
||||
#3rdParty::lux_core # AZ_TRAIT_LUXCORE_SUPPORTED is disabled in every platform, Issue #3915 will remove
|
||||
)
|
||||
|
||||
ly_add_target(
|
||||
@@ -87,7 +87,7 @@ ly_add_target(
|
||||
AZ::AzFramework
|
||||
Gem::Atom_Feature_Common.Static
|
||||
Gem::Atom_Feature_Common.Public
|
||||
3rdParty::lux_core
|
||||
#3rdParty::lux_core # AZ_TRAIT_LUXCORE_SUPPORTED is disabled in every platform, Issue #3915 will remove
|
||||
)
|
||||
|
||||
if(PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
#
|
||||
#
|
||||
|
||||
if(LY_MONOLITHIC_GAME) # Do not use OpenImageIO in monolithic game
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(LY_BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
3rdParty::OpenImageIO
|
||||
|
||||
@@ -37,6 +37,7 @@ if(NOT PAL_TRAIT_ATOM_RHI_VULKAN_SUPPORTED)
|
||||
NAMESPACE Gem
|
||||
FILES_CMAKE
|
||||
${pal_source_dir}/platform_builders_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
${pal_include_dir}/platform_builders_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
atom_rhi_vulkan_reflect_common_files.cmake
|
||||
atom_rhi_vulkan_glad_files.cmake
|
||||
atom_rhi_vulkan_builders_common_files.cmake
|
||||
@@ -90,6 +91,7 @@ ly_add_target(
|
||||
FILES_CMAKE
|
||||
atom_rhi_vulkan_private_common_files.cmake
|
||||
${pal_source_dir}/platform_private_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
${pal_include_dir}/platform_private_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
PLATFORM_INCLUDE_FILES
|
||||
${pal_source_dir}/platform_private_static_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <RHI/Conversion.h>
|
||||
#include <RHI/Instance.h>
|
||||
#include <RHI/WSISurface.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
|
||||
@@ -35,17 +35,20 @@ ly_add_target(
|
||||
ly_create_alias(NAME CrashReporting.Clients NAMESPACE Gem TARGETS Gem::CrashReporting)
|
||||
ly_create_alias(NAME CrashReporting.Servers NAMESPACE Gem TARGETS Gem::CrashReporting)
|
||||
|
||||
if(NOT LY_MONOLITHIC_GAME)
|
||||
|
||||
ly_add_target(
|
||||
NAME CrashReporting.Uploader APPLICATION
|
||||
NAMESPACE AZ
|
||||
FILES_CMAKE
|
||||
game_crash_uploader_files.cmake
|
||||
Platform/${PAL_PLATFORM_NAME}/game_crash_uploader_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PRIVATE
|
||||
Include
|
||||
BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
AZ::CrashUploaderSupport
|
||||
)
|
||||
ly_add_target(
|
||||
NAME CrashReporting.Uploader APPLICATION
|
||||
NAMESPACE AZ
|
||||
FILES_CMAKE
|
||||
game_crash_uploader_files.cmake
|
||||
Platform/${PAL_PLATFORM_NAME}/game_crash_uploader_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake
|
||||
INCLUDE_DIRECTORIES
|
||||
PRIVATE
|
||||
Include
|
||||
BUILD_DEPENDENCIES
|
||||
PRIVATE
|
||||
AZ::CrashUploaderSupport
|
||||
)
|
||||
|
||||
endif()
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <ScriptCanvas/Core/Core.h>
|
||||
|
||||
#if defined(PERFORMANCE_BUILD) || !defined(_RELEASE)
|
||||
#if !defined(_RELEASE)
|
||||
// the markers are defined in test, but the system that listens for calls won't always be enabled
|
||||
#define SCRIPT_CANVAS_PERFORMANCE_TRACKING_ENABLED
|
||||
#endif
|
||||
|
||||
+2
-7
@@ -465,12 +465,7 @@ namespace ScriptCanvas
|
||||
lua_register(lua, k_UnpackDependencyConstructionArgsFunctionName, &UnpackDependencyConstructionArgs);
|
||||
lua_register(lua, k_UnpackDependencyConstructionArgsLeafFunctionName, &UnpackDependencyConstructionArgsLeaf);
|
||||
|
||||
#if defined(PERFORMANCE_BUILD)
|
||||
lua_pushboolean(lua, true);
|
||||
lua_setglobal(lua, k_InterpretedConfigurationPerformance);
|
||||
lua_pushboolean(lua, false);
|
||||
lua_setglobal(lua, k_InterpretedConfigurationRelease);
|
||||
#elif defined(_RELEASE)
|
||||
#if defined(_RELEASE)
|
||||
lua_pushboolean(lua, false);
|
||||
lua_setglobal(lua, k_InterpretedConfigurationPerformance);
|
||||
lua_pushboolean(lua, true);
|
||||
@@ -481,7 +476,7 @@ namespace ScriptCanvas
|
||||
lua_setglobal(lua, k_InterpretedConfigurationPerformance);
|
||||
lua_pushboolean(lua, false);
|
||||
lua_setglobal(lua, k_InterpretedConfigurationRelease);
|
||||
#endif//defined(PERFORMANCE_BUILD)
|
||||
#endif
|
||||
|
||||
lua_register(lua, k_GetRandomSwitchControlNumberName, &GetRandomSwitchControlNumber);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <ScriptCanvas/Execution/ExecutionContext.h>
|
||||
#include <ScriptCanvas/Execution/ExecutionState.h>
|
||||
|
||||
#if !defined(_RELEASE) && !defined(PERFORMANCE_BUILD)
|
||||
#if !defined(_RELEASE)
|
||||
#define SCRIPT_CANVAS_RUNTIME_ASSET_CHECK
|
||||
#endif
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
namespace ScriptCanvasSystemComponentCpp
|
||||
{
|
||||
#if !defined(_RELEASE) && !defined(PERFORMANCE_BUILD)
|
||||
#if !defined(_RELEASE)
|
||||
const int k_infiniteLoopDetectionMaxIterations = 1000000;
|
||||
const int k_maxHandlerStackDepth = 25;
|
||||
#else
|
||||
|
||||
@@ -172,6 +172,9 @@
|
||||
"Exclude Build": {
|
||||
"pattern": ".*/[Bb]uild/.*"
|
||||
},
|
||||
"Exclude Install": {
|
||||
"pattern": ".*/[Ii]nstall/.*"
|
||||
},
|
||||
"Exclude UserSettings": {
|
||||
"pattern": ".*/UserSettings.xml"
|
||||
},
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
#
|
||||
#
|
||||
|
||||
if(LY_MONOLITHIC_GAME)
|
||||
return()
|
||||
endif()
|
||||
|
||||
ly_install_directory(DIRECTORIES .)
|
||||
|
||||
cmake_path(RELATIVE_PATH CMAKE_RUNTIME_OUTPUT_DIRECTORY BASE_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE runtime_output_directory)
|
||||
|
||||
@@ -21,6 +21,21 @@ if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'engine' from 'project.json', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_MODULE_PATH)
|
||||
foreach(module_path ${CMAKE_MODULE_PATH})
|
||||
if(EXISTS ${module_path}/Findo3de.cmake)
|
||||
file(READ ${module_path}/../engine.json engine_json)
|
||||
string(JSON engine_name ERROR_VARIABLE json_error GET ${engine_json} engine_name)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'engine_name' from 'engine.json', error: ${json_error}")
|
||||
endif()
|
||||
if(LY_ENGINE_NAME_TO_USE STREQUAL engine_name)
|
||||
return() # Engine being forced through CMAKE_MODULE_PATH
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{USERPROFILE} AND EXISTS $ENV{USERPROFILE})
|
||||
set(manifest_path $ENV{USERPROFILE}/.o3de/o3de_manifest.json) # Windows
|
||||
else()
|
||||
|
||||
@@ -21,6 +21,21 @@ if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'engine' from 'project.json', error: ${json_error}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_MODULE_PATH)
|
||||
foreach(module_path ${CMAKE_MODULE_PATH})
|
||||
if(EXISTS ${module_path}/Findo3de.cmake)
|
||||
file(READ ${module_path}/../engine.json engine_json)
|
||||
string(JSON engine_name ERROR_VARIABLE json_error GET ${engine_json} engine_name)
|
||||
if(json_error)
|
||||
message(FATAL_ERROR "Unable to read key 'engine_name' from 'engine.json', error: ${json_error}")
|
||||
endif()
|
||||
if(LY_ENGINE_NAME_TO_USE STREQUAL engine_name)
|
||||
return() # Engine being forced through CMAKE_MODULE_PATH
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{USERPROFILE} AND EXISTS $ENV{USERPROFILE})
|
||||
set(manifest_path $ENV{USERPROFILE}/.o3de/o3de_manifest.json) # Windows
|
||||
else()
|
||||
|
||||
+4
-14
@@ -305,21 +305,11 @@ endfunction()
|
||||
# \arg:3RDPARTY_ROOT_DIRECTORY custom 3rd party directory which needs to be installed
|
||||
function(ly_install_external_target 3RDPARTY_ROOT_DIRECTORY)
|
||||
|
||||
# Install the Find file to our <install_location>/cmake directory
|
||||
install(FILES ${CMAKE_CURRENT_LIST_FILE}
|
||||
DESTINATION cmake
|
||||
# Install the Find file to our <install_location>/cmake/3rdParty directory
|
||||
ly_install_files(FILES ${CMAKE_CURRENT_LIST_FILE}
|
||||
DESTINATION cmake/3rdParty
|
||||
)
|
||||
|
||||
# We only want to install external targets that are part of our source tree
|
||||
# Checking for relative path beginning with "../" also works when the path
|
||||
# given is on another drive letter on windows(i.e., RELATIVE_PATH returns an absolute path)
|
||||
file(RELATIVE_PATH rel_path ${CMAKE_SOURCE_DIR} ${3RDPARTY_ROOT_DIRECTORY})
|
||||
if (NOT ${rel_path} MATCHES "^../")
|
||||
get_filename_component(rel_path ${rel_path} DIRECTORY)
|
||||
install(DIRECTORY ${3RDPARTY_ROOT_DIRECTORY}
|
||||
DESTINATION ${rel_path}
|
||||
)
|
||||
endif()
|
||||
ly_install_directory(DIRECTORIES ${3RDPARTY_ROOT_DIRECTORY})
|
||||
|
||||
endfunction()
|
||||
|
||||
|
||||
+32
-2
@@ -6,7 +6,12 @@
|
||||
#
|
||||
#
|
||||
|
||||
if(NOT INSTALLED_ENGINE)
|
||||
ly_set(LY_INSTALL_ENABLED TRUE)
|
||||
if(INSTALLED_ENGINE)
|
||||
ly_set(LY_INSTALL_ENABLED FALSE)
|
||||
endif()
|
||||
|
||||
if(LY_INSTALL_ENABLED)
|
||||
ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME})
|
||||
include(${pal_dir}/Install_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
|
||||
endif()
|
||||
@@ -27,6 +32,10 @@ endif()
|
||||
#
|
||||
function(ly_install_directory)
|
||||
|
||||
if(NOT LY_INSTALL_ENABLED)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(options VERBATIM)
|
||||
set(oneValueArgs DESTINATION)
|
||||
set(multiValueArgs DIRECTORIES EXCLUDE_PATTERNS)
|
||||
@@ -91,6 +100,10 @@ endfunction()
|
||||
#
|
||||
function(ly_install_files)
|
||||
|
||||
if(NOT LY_INSTALL_ENABLED)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(options PROGRAMS)
|
||||
set(oneValueArgs DESTINATION)
|
||||
set(multiValueArgs FILES)
|
||||
@@ -121,4 +134,21 @@ function(ly_install_files)
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} # use the default for the time being
|
||||
)
|
||||
|
||||
endfunction()
|
||||
endfunction()
|
||||
|
||||
#! ly_install_run_code: specifies code to be added to the install process (will run at install time)
|
||||
#
|
||||
# \notes:
|
||||
# - refer to cmake's install(CODE documentation for more information
|
||||
#
|
||||
function(ly_install_run_code CODE)
|
||||
|
||||
if(NOT LY_INSTALL_ENABLED)
|
||||
return()
|
||||
endif()
|
||||
|
||||
install(CODE ${CODE}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} # use the default for the time being
|
||||
)
|
||||
|
||||
endfunction()
|
||||
|
||||
@@ -13,5 +13,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE PATH "Build dir
|
||||
|
||||
# We install outside of the binary dir because our install support muliple platforms to
|
||||
# be installed together. We also have an exclusion rule in the AP that filters out the
|
||||
# "build" folder which is a common binary dir
|
||||
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install CACHE PATH "Installation prefix")
|
||||
# "install" folder to avoid the AP picking it up
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install CACHE PATH "Install directory" FORCE)
|
||||
endif()
|
||||
|
||||
@@ -38,9 +38,6 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
|
||||
# Get the target source directory relative to the LY root folder
|
||||
ly_get_engine_relative_source_dir(${absolute_target_source_dir} relative_target_source_dir)
|
||||
|
||||
# get the component ID. if the property isn't set for the target, it will auto fallback to use CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
|
||||
get_property(install_component TARGET ${TARGET_NAME} PROPERTY INSTALL_COMPONENT)
|
||||
|
||||
# All include directories marked PUBLIC or INTERFACE will be installed. We dont use PUBLIC_HEADER because in order to do that
|
||||
# we need to set the PUBLIC_HEADER property of the target for all the headers we are exporting. After doing that, installing the
|
||||
# headers end up in one folder instead of duplicating the folder structure of the public/interface include directory.
|
||||
@@ -69,7 +66,7 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
|
||||
|
||||
install(DIRECTORY ${include_directory}
|
||||
DESTINATION ${destination_dir}
|
||||
COMPONENT ${install_component}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
FILES_MATCHING
|
||||
PATTERN *.h
|
||||
PATTERN *.hpp
|
||||
@@ -108,13 +105,13 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
|
||||
TARGETS ${TARGET_NAME}
|
||||
ARCHIVE
|
||||
DESTINATION ${archive_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>
|
||||
COMPONENT ${install_component}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
LIBRARY
|
||||
DESTINATION ${library_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_library_output_subdirectory}
|
||||
COMPONENT ${install_component}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
RUNTIME
|
||||
DESTINATION ${runtime_output_directory}/${PAL_PLATFORM_NAME}/$<CONFIG>/${target_runtime_output_subdirectory}
|
||||
COMPONENT ${install_component}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -271,7 +268,7 @@ set_property(TARGET ${NAME_PLACEHOLDER}
|
||||
file(GENERATE OUTPUT "${target_install_source_dir}/${NAME_PLACEHOLDER}_$<CONFIG>.cmake" CONTENT "${target_file_contents}")
|
||||
install(FILES "${target_install_source_dir}/${NAME_PLACEHOLDER}_$<CONFIG>.cmake"
|
||||
DESTINATION ${relative_target_source_dir}
|
||||
COMPONENT ${install_component}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
|
||||
# Since a CMakeLists.txt could contain multiple targets, we generate it in a folder per target
|
||||
@@ -320,12 +317,9 @@ function(ly_setup_subdirectory absolute_target_source_dir)
|
||||
"${ENABLE_GEMS_PLACEHOLDER}"
|
||||
)
|
||||
|
||||
# get the component ID. if the property isn't set for the directory, it will auto fallback to use CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
|
||||
get_property(install_component DIRECTORY ${absolute_target_source_dir} PROPERTY INSTALL_COMPONENT)
|
||||
|
||||
install(FILES "${target_install_source_dir}/CMakeLists.txt"
|
||||
DESTINATION ${relative_target_source_dir}
|
||||
COMPONENT ${install_component}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
|
||||
endfunction()
|
||||
@@ -344,6 +338,7 @@ function(ly_setup_o3de_install)
|
||||
${LY_ROOT_FOLDER}/LICENSE.txt
|
||||
${LY_ROOT_FOLDER}/README.md
|
||||
DESTINATION .
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
|
||||
endfunction()
|
||||
@@ -353,6 +348,7 @@ function(ly_setup_cmake_install)
|
||||
|
||||
install(DIRECTORY "${LY_ROOT_FOLDER}/cmake"
|
||||
DESTINATION .
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
PATTERN "__pycache__" EXCLUDE
|
||||
REGEX "Findo3de.cmake" EXCLUDE
|
||||
REGEX "Platform\/.*\/BuiltInPackages_.*\.cmake" EXCLUDE
|
||||
@@ -380,18 +376,32 @@ function(ly_setup_cmake_install)
|
||||
"${LY_ROOT_FOLDER}/CMakeLists.txt"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake/engine.json"
|
||||
DESTINATION .
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
|
||||
# Collect all Find files that were added with ly_add_external_target_path
|
||||
unset(additional_find_files)
|
||||
unset(additional_platform_files)
|
||||
get_property(additional_module_paths GLOBAL PROPERTY LY_ADDITIONAL_MODULE_PATH)
|
||||
foreach(additional_module_path ${additional_module_paths})
|
||||
unset(find_files)
|
||||
file(GLOB find_files "${additional_module_path}/Find*.cmake")
|
||||
list(APPEND additional_find_files "${find_files}")
|
||||
foreach(find_file ${find_files})
|
||||
# also copy the Platform/<current_platform> to the destination
|
||||
cmake_path(GET find_file PARENT_PATH find_file_parent)
|
||||
unset(plat_files)
|
||||
file(GLOB plat_files "${find_file_parent}/Platform/${PAL_PLATFORM_NAME}/*.cmake")
|
||||
list(APPEND additional_platform_files "${plat_files}")
|
||||
endforeach()
|
||||
endforeach()
|
||||
install(FILES ${additional_find_files}
|
||||
DESTINATION cmake/3rdParty
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
install(FILES ${additional_platform_files}
|
||||
DESTINATION cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
|
||||
# Findo3de.cmake file: we generate a different Findo3de.camke file than the one we have in cmake. This one is going to expose all
|
||||
@@ -408,6 +418,7 @@ function(ly_setup_cmake_install)
|
||||
configure_file(${LY_ROOT_FOLDER}/cmake/install/Findo3de.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake @ONLY)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake"
|
||||
DESTINATION cmake
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
|
||||
# BuiltInPackage_<platform>.cmake: since associations could happen in any cmake file across the engine. We collect
|
||||
@@ -427,6 +438,7 @@ function(ly_setup_cmake_install)
|
||||
)
|
||||
install(FILES "${pal_builtin_file}"
|
||||
DESTINATION cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
|
||||
endfunction()
|
||||
@@ -442,6 +454,7 @@ function(ly_setup_runtime_dependencies)
|
||||
"function(ly_copy source_file target_directory)
|
||||
file(COPY \"\${source_file}\" DESTINATION \"\${target_directory}\" FILE_PERMISSIONS ${LY_COPY_PERMISSIONS})
|
||||
endfunction()"
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -476,7 +489,9 @@ endfunction()"
|
||||
|
||||
list(REMOVE_DUPLICATES runtime_commands)
|
||||
list(JOIN runtime_commands " " runtime_commands_str) # the spaces are just to see the right identation in the cmake_install.cmake file
|
||||
install(CODE "${runtime_commands_str}")
|
||||
install(CODE "${runtime_commands_str}"
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
|
||||
endfunction()
|
||||
|
||||
@@ -562,9 +577,15 @@ function(ly_setup_assets)
|
||||
cmake_path(SET gem_install_dest_dir .)
|
||||
endif()
|
||||
if(IS_DIRECTORY ${gem_absolute_path})
|
||||
install(DIRECTORY "${gem_absolute_path}" DESTINATION ${gem_install_dest_dir})
|
||||
install(DIRECTORY "${gem_absolute_path}"
|
||||
DESTINATION ${gem_install_dest_dir}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
elseif (EXISTS ${gem_absolute_path})
|
||||
install(FILES ${gem_absolute_path} DESTINATION ${gem_install_dest_dir})
|
||||
install(FILES ${gem_absolute_path}
|
||||
DESTINATION ${gem_install_dest_dir}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
@@ -22,7 +22,9 @@ endfunction()]])
|
||||
|
||||
function(ly_install_code_function_override)
|
||||
string(CONFIGURE "${ly_copy_template}" ly_copy_function_linux @ONLY)
|
||||
install(CODE "${ly_copy_function_linux}")
|
||||
install(CODE "${ly_copy_function_linux}"
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
endfunction()
|
||||
|
||||
include(cmake/Platform/Common/Install_common.cmake)
|
||||
|
||||
@@ -42,8 +42,6 @@ function(ly_install_target_override)
|
||||
set(multiValueArgs)
|
||||
cmake_parse_arguments(ly_platform_install_target "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
get_property(install_component TARGET ${ly_platform_install_target_TARGET} PROPERTY INSTALL_COMPONENT)
|
||||
|
||||
# For bundles on Mac, we set the icons by passing in a path to the Images.xcassets directory.
|
||||
# However, the CMake install command expects paths to files for the the RESOURCE property.
|
||||
# More details can be found in the CMake issue: https://gitlab.kitware.com/cmake/cmake/-/issues/22409
|
||||
@@ -57,19 +55,19 @@ function(ly_install_target_override)
|
||||
TARGETS ${ly_platform_install_target_TARGET}
|
||||
ARCHIVE
|
||||
DESTINATION ${ly_platform_install_target_ARCHIVE_DIR}/${PAL_PLATFORM_NAME}/$<CONFIG>
|
||||
COMPONENT ${install_component}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
LIBRARY
|
||||
DESTINATION ${ly_platform_install_target_LIBRARY_DIR}/${PAL_PLATFORM_NAME}/$<CONFIG>/${ly_platform_install_target_LIBRARY_SUBDIR}
|
||||
COMPONENT ${install_component}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
RUNTIME
|
||||
DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${PAL_PLATFORM_NAME}/$<CONFIG>/${ly_platform_install_target_RUNTIME_SUBDIR}
|
||||
COMPONENT ${install_component}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
BUNDLE
|
||||
DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${PAL_PLATFORM_NAME}/$<CONFIG>/${ly_platform_install_target_RUNTIME_SUBDIR}
|
||||
COMPONENT ${install_component}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
RESOURCE
|
||||
DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${PAL_PLATFORM_NAME}/$<CONFIG>/${ly_platform_install_target_RUNTIME_SUBDIR}/
|
||||
COMPONENT ${install_component}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
|
||||
if (${is_bundle})
|
||||
@@ -95,7 +93,9 @@ function(ly_install_code_function_override)
|
||||
|
||||
endif()
|
||||
file(COPY \"\${source_file}\" DESTINATION \"\${target_directory}\" FILE_PERMISSIONS ${LY_COPY_PERMISSIONS})
|
||||
endfunction()")
|
||||
endfunction()"
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -142,6 +142,23 @@ foreach(project ${LY_PROJECTS})
|
||||
add_subdirectory(${project} "${project_folder_name}-${full_directory_hash}")
|
||||
ly_generate_project_build_path_setreg(${full_directory_path})
|
||||
add_project_json_external_subdirectories(${full_directory_path})
|
||||
|
||||
# Generate pak for project in release installs
|
||||
cmake_path(RELATIVE_PATH CMAKE_RUNTIME_OUTPUT_DIRECTORY BASE_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE runtime_output_directory)
|
||||
set(install_engine_pak_template [=[
|
||||
if("${CMAKE_INSTALL_CONFIG_NAME}" MATCHES "^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$")
|
||||
set(install_output_folder "${CMAKE_INSTALL_PREFIX}/@runtime_output_directory@/@PAL_PLATFORM_NAME@/${CMAKE_INSTALL_CONFIG_NAME}")
|
||||
message(STATUS "Generating ${install_output_folder}/Engine.pak from @full_directory_path@/Cache")
|
||||
file(ARCHIVE_CREATE OUTPUT ${install_output_folder}/Engine.pak
|
||||
PATHS @full_directory_path@/Cache
|
||||
FORMAT zip
|
||||
)
|
||||
message(STATUS "${install_output_folder}/Engine.pak generated")
|
||||
endif()
|
||||
]=])
|
||||
string(CONFIGURE "${install_engine_pak_template}" install_engine_pak_code @ONLY)
|
||||
ly_install_run_code("${install_engine_pak_code}")
|
||||
|
||||
endforeach()
|
||||
|
||||
# If just one project is defined we pass it as a parameter to the applications
|
||||
|
||||
@@ -118,6 +118,12 @@ endfunction()
|
||||
# The generated file contains the file to the each dependent targets
|
||||
# This can be used for example to determine which list of gems to load with an application
|
||||
function(ly_delayed_generate_settings_registry)
|
||||
|
||||
if(LY_MONOLITHIC_GAME) # No need to generate setregs for monolithic builds
|
||||
set_property(GLOBAL PROPERTY LY_DELAYED_LOAD_DEPENDENCIES) # Clear out the load targets from the global load dependencies list
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_property(ly_delayed_load_targets GLOBAL PROPERTY LY_DELAYED_LOAD_DEPENDENCIES)
|
||||
foreach(prefix_target ${ly_delayed_load_targets})
|
||||
string(REPLACE "," ";" prefix_target_list "${prefix_target}")
|
||||
@@ -201,7 +207,7 @@ function(ly_delayed_generate_settings_registry)
|
||||
set_property(GLOBAL PROPERTY LY_DELAYED_LOAD_"${prefix_target}")
|
||||
endforeach()
|
||||
|
||||
# Clear out the load targets from the glboal load dependencies list
|
||||
# Clear out the load targets from the global load dependencies list
|
||||
set_property(GLOBAL PROPERTY LY_DELAYED_LOAD_DEPENDENCIES)
|
||||
endfunction()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user