3dec5d3b71
* LYN-2537 Moved the Engine and Editor folder to be within the EngineAssets folder * Fixed Documentation in bootstrap.cfg to correct the path to the user project specific registry file * Adding a newline to the output of AssetCatalog 'Registering asset..., but type is not set' message * Updating the AssetProcessorPlatformConfig.setreg Scan Folder to detect the @ENGINEROOT@/EngineAssets/Engine path for engine runtime assets and @ENGINEROOT@/EngineAssets/Editor path for engine tool assets * Updating references to Icons and other assets to account for moving the Engine and Editor folder under a single EngineAssets folder * Moving the Engine Settings Registry folder from Engine/Registry -> Registry * Removed the LY_PROJECT_CMAKE_PATH define as it is not portable to other locations. It is hard coded to the project location that was used for the CMake configuration. Furthermore it paths with backslashes within it are treated as escape characters and not a path separator * Updated the LyTestTools asset_processor.py script to copy the exclude.filetag from the EngineAssets/Engine directory now * Fixed Atom Shader Preprocessing when running using an External Project * Updated the TSGenerateAction.cpp to fix the build error with using a renamed variable * Updated the Install_Common.cmake ly_setup_others function to install the EngineAssets directory and the each of the Gem's Assets directory while maintaining the relative directory structure to the Engine Root Also updated the install step to install the Registry folder at the engine root * Fixed the copying of the Registry folder to be in the install root, instead of under a second 'Registry' folder * Moving the AssetProcessorPlatformConfig.setreg file over to the Registry folder * Updated the LyTestTools and C++ code to point that the new location of the AssetProcessorPlatformConfig.setreg file inside of the Registry folder * Renamed Test AssetProcessor*Config.ini files to have the .setreg extension * Converted the AssetProcessor test setreg files from ini format to json format using the SerializeContextTools convert-ini command * Updated the AssetProcessor CMakeLists.txt to copy over the test setreg files to the build folder * Updated the assetprocessor test file list to point at the renamed AsssetProcessor*Config setreg filenames * Removed the Output Prefix code from the AssetProcessor. The complexity that it brought to the AP code is not needed, as users can replicate the behavior by just moving there assets underneath a another folder, underneath the scan folder * Adding back support to read the AssetProcessorPlatformConfig.setreg file from the asset root. This is only needed for C++ UnitTests as they run in an environment where the accessing the Engine Settings Registry is not available * Updating the Install_common.cmake logic to copy any "Assets" folder to the install layout. The Script has also been updated to copy over the "Assets" folder in the Engine Root to the install layout instead of an "EngineAssets" folder * Updating References to EngineAssets source asset folder in code to be the Assets source folder * Moved the Engine Source Asset folder of 'EngineAssets' to a new folder name of 'Assets'. This is inline with the naming scheme we use for Gem asset folders * Adding the EngineFinder.cmake to the AutomatedTesting project to allow it to work in a project centric manner * Updating the LyTestTools copy_assets_to_project function to be able to copy assets with folders to the temporary project root Fixed an issue in LyTestTools where the temporary log directory could have shutil.rmtree being called twice on it leading to an exception which fails an automated test Updated the asset_procesor_gui_tests_2 AddScanFolder test to not use the output prefix, but instead place the source asset root into a subdirectory * Correct the AssetProcessorPlatformConfig Scan Folders for the EngineAssets directory to point at the Assets directory * Updated the asset procesor batch dependency test scan folder to point at the 'Assets' folder instead of 'EngineAssets'
200 lines
9.5 KiB
CMake
200 lines
9.5 KiB
CMake
#
|
|
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
|
# its licensors.
|
|
#
|
|
# For complete copyright and license terms please see the LICENSE at the root of this
|
|
# distribution (the "License"). All use of this software is governed by the License,
|
|
# or, if provided, by the license below or the license accompanying this file. Do not
|
|
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
#
|
|
|
|
# Launcher targets for a project need to be generated when configuring a project.
|
|
# When building the engine source, this file will be included by LauncherUnified's CMakeLists.txt
|
|
# When using an installed engine, this file will be included by the FindLauncherGenerator.cmake script
|
|
get_property(LY_PROJECTS_TARGET_NAME GLOBAL PROPERTY LY_PROJECTS_TARGET_NAME)
|
|
foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJECTS)
|
|
# Computes the realpath to the project
|
|
# If the project_path is relative, it is evaluated relative to the ${LY_ROOT_FOLDER}
|
|
# Otherwise the the absolute project_path is returned with symlinks resolved
|
|
file(REAL_PATH ${project_path} project_real_path BASE_DIRECTORY ${LY_ROOT_FOLDER})
|
|
if(NOT project_name)
|
|
if(NOT EXISTS ${project_real_path}/project.json)
|
|
message(FATAL_ERROR "The specified project path of ${project_real_path} does not contain a project.json file")
|
|
else()
|
|
# Add the project_name to global LY_PROJECTS_TARGET_NAME property
|
|
file(READ "${project_real_path}/project.json" project_json)
|
|
string(JSON project_name ERROR_VARIABLE json_error GET ${project_json} "project_name")
|
|
if(json_error)
|
|
message(FATAL_ERROR "There is an error reading the \"project_name\" key from the '${project_real_path}/project.json' file: ${json_error}")
|
|
endif()
|
|
message(WARNING "The project located at path ${project_real_path} has a valid \"project name\" of '${project_name}' read from it's project.json file."
|
|
" This indicates that the ${project_real_path}/CMakeLists.txt is not properly appending the \"project name\" "
|
|
"to the LY_PROJECTS_TARGET_NAME global property. Other configuration errors might occur")
|
|
endif()
|
|
endif()
|
|
################################################################################
|
|
# Monolithic game
|
|
################################################################################
|
|
if(LY_MONOLITHIC_GAME)
|
|
|
|
# In the monolithic case, we need to register the gem modules, to do so we will generate a StaticModules.inl
|
|
# file from StaticModules.in
|
|
|
|
get_property(game_gem_dependencies GLOBAL PROPERTY LY_DELAYED_DEPENDENCIES_${project_name}.GameLauncher)
|
|
|
|
unset(extern_module_declarations)
|
|
unset(module_invocations)
|
|
|
|
foreach(game_gem_dependency ${game_gem_dependencies})
|
|
# To match the convention on how gems targets vs gem modules are named, we remove the "Gem::" from prefix
|
|
# and remove the ".Static" from the suffix
|
|
string(REGEX REPLACE "^Gem::" "Gem_" game_gem_dependency ${game_gem_dependency})
|
|
string(REGEX REPLACE "^Project::" "Project_" game_gem_dependency ${game_gem_dependency})
|
|
# Replace "." with "_"
|
|
string(REPLACE "." "_" game_gem_dependency ${game_gem_dependency})
|
|
|
|
string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_${game_gem_dependency}();\n")
|
|
string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_${game_gem_dependency}());\n")
|
|
|
|
endforeach()
|
|
|
|
configure_file(StaticModules.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/${project_name}.GameLauncher/Includes/StaticModules.inl
|
|
)
|
|
|
|
set(game_build_dependencies
|
|
${game_gem_dependencies}
|
|
Legacy::CrySystem
|
|
Legacy::CryFont
|
|
Legacy::Cry3DEngine
|
|
)
|
|
|
|
if(PAL_TRAIT_BUILD_SERVER_SUPPORTED)
|
|
get_property(server_gem_dependencies GLOBAL PROPERTY LY_DELAYED_DEPENDENCIES_${project_name}.ServerLauncher)
|
|
|
|
unset(extern_module_declarations)
|
|
unset(module_invocations)
|
|
|
|
foreach(server_gem_dependency ${server_gem_dependencies})
|
|
# To match the convention on how gems targets vs gem modules are named, we remove the "Gem::" from prefix
|
|
# and remove the ".Static" from the suffix
|
|
string(REGEX REPLACE "^Gem::" "Gem_" server_gem_dependency ${server_gem_dependency})
|
|
string(REGEX REPLACE "^Project::" "Project_" server_gem_dependency ${server_gem_dependency})
|
|
# Replace "." with "_"
|
|
string(REPLACE "." "_" server_gem_dependency ${server_gem_dependency})
|
|
|
|
string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_${server_gem_dependency}();\n")
|
|
string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_${server_gem_dependency}());\n")
|
|
|
|
endforeach()
|
|
|
|
configure_file(StaticModules.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/${project_name}.ServerLauncher/Includes/StaticModules.inl
|
|
)
|
|
|
|
set(server_build_dependencies
|
|
${game_gem_dependencies}
|
|
Legacy::CrySystem
|
|
Legacy::CryFont
|
|
Legacy::Cry3DEngine
|
|
)
|
|
endif()
|
|
|
|
else()
|
|
|
|
set(game_runtime_dependencies
|
|
Legacy::CrySystem
|
|
Legacy::CryFont
|
|
Legacy::Cry3DEngine
|
|
)
|
|
if(PAL_TRAIT_BUILD_SERVER_SUPPORTED AND NOT LY_MONOLITHIC_GAME) # Only Atom is supported in monolithic builds
|
|
set(server_runtime_dependencies
|
|
Legacy::CryRenderNULL
|
|
)
|
|
endif()
|
|
|
|
endif()
|
|
|
|
################################################################################
|
|
# Game
|
|
################################################################################
|
|
ly_add_target(
|
|
NAME ${project_name}.GameLauncher ${PAL_TRAIT_LAUNCHERUNIFIED_LAUNCHER_TYPE}
|
|
NAMESPACE AZ
|
|
FILES_CMAKE
|
|
${CMAKE_CURRENT_LIST_DIR}/launcher_project_files.cmake
|
|
PLATFORM_INCLUDE_FILES
|
|
${pal_dir}/launcher_project_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
|
|
COMPILE_DEFINITIONS
|
|
PRIVATE
|
|
# Adds the name of the project/game
|
|
LY_PROJECT_NAME="${project_name}"
|
|
# Adds the ${project_name}_GameLauncher target as a define so for the Settings Registry to use
|
|
# when loading .setreg file specializations
|
|
# This is needed so that only gems for the project game launcher are loaded
|
|
LY_CMAKE_TARGET="${project_name}_GameLauncher"
|
|
INCLUDE_DIRECTORIES
|
|
PRIVATE
|
|
.
|
|
${CMAKE_CURRENT_BINARY_DIR}/${project_name}.GameLauncher/Includes # required for StaticModules.inl
|
|
BUILD_DEPENDENCIES
|
|
PRIVATE
|
|
AZ::Launcher.Static
|
|
AZ::Launcher.Game.Static
|
|
${game_build_dependencies}
|
|
RUNTIME_DEPENDENCIES
|
|
${game_runtime_dependencies}
|
|
)
|
|
# Needs to be set manually after ly_add_target to prevent the default location overriding it
|
|
set_target_properties(${project_name}.GameLauncher
|
|
PROPERTIES
|
|
FOLDER ${project_name}
|
|
)
|
|
|
|
################################################################################
|
|
# Server
|
|
################################################################################
|
|
if(PAL_TRAIT_BUILD_SERVER_SUPPORTED)
|
|
|
|
get_property(server_projects GLOBAL PROPERTY LY_LAUNCHER_SERVER_PROJECTS)
|
|
if(${project_name} IN_LIST server_projects)
|
|
|
|
ly_add_target(
|
|
NAME ${project_name}.ServerLauncher APPLICATION
|
|
NAMESPACE AZ
|
|
FILES_CMAKE
|
|
${CMAKE_CURRENT_LIST_DIR}/launcher_project_files.cmake
|
|
PLATFORM_INCLUDE_FILES
|
|
${pal_dir}/launcher_project_${PAL_PLATFORM_NAME_LOWERCASE}.cmake
|
|
COMPILE_DEFINITIONS
|
|
PRIVATE
|
|
# Adds the name of the project/game
|
|
LY_PROJECT_NAME="${project_name}"
|
|
# Adds the ${project_name}_ServerLauncher target as a define so for the Settings Registry to use
|
|
# when loading .setreg file specializations
|
|
# This is needed so that only gems for the project server launcher are loaded
|
|
LY_CMAKE_TARGET="${project_name}_ServerLauncher"
|
|
INCLUDE_DIRECTORIES
|
|
PRIVATE
|
|
.
|
|
${CMAKE_CURRENT_BINARY_DIR}/${project_name}.ServerLauncher/Includes # required for StaticModules.inl
|
|
BUILD_DEPENDENCIES
|
|
PRIVATE
|
|
AZ::Launcher.Static
|
|
AZ::Launcher.Server.Static
|
|
${server_build_dependencies}
|
|
RUNTIME_DEPENDENCIES
|
|
${server_runtime_dependencies}
|
|
)
|
|
# Needs to be set manually after ly_add_target to prevent the default location overriding it
|
|
set_target_properties(${project_name}.ServerLauncher
|
|
PROPERTIES
|
|
FOLDER ${project_name}
|
|
)
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endforeach()
|