From a0ab5920dafb3e20b29370f0cc63eda97c9d975b Mon Sep 17 00:00:00 2001 From: Steve Pham <82231385+spham-amzn@users.noreply.github.com> Date: Fri, 19 Nov 2021 18:04:15 -0800 Subject: [PATCH] Add trait to enable/disable the Resource Mapping Tool (#5814) * Add trait to enable/disable the Resource Mapping Tool Signed-off-by: spham <82231385+spham-amzn@users.noreply.github.com> * Moving ly_install_directory(DIRECTIORES Tools/ResourceMappingtool) into of the PAL_TRAIT_ENABLE_RESOURCE_MAPPING_TOOL block Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com> --- Gems/AWSCore/Code/CMakeLists.txt | 46 +++++++++++-------- .../Linux/PAL_traits_editor_linux.cmake | 9 ++++ .../Platform/Mac/PAL_traits_editor_mac.cmake | 9 ++++ .../Windows/PAL_traits_editor_windows.cmake | 9 ++++ 4 files changed, 54 insertions(+), 19 deletions(-) create mode 100644 Gems/AWSCore/Code/Platform/Linux/PAL_traits_editor_linux.cmake create mode 100644 Gems/AWSCore/Code/Platform/Mac/PAL_traits_editor_mac.cmake create mode 100644 Gems/AWSCore/Code/Platform/Windows/PAL_traits_editor_windows.cmake diff --git a/Gems/AWSCore/Code/CMakeLists.txt b/Gems/AWSCore/Code/CMakeLists.txt index d84f7814c3..f1521856e6 100644 --- a/Gems/AWSCore/Code/CMakeLists.txt +++ b/Gems/AWSCore/Code/CMakeLists.txt @@ -60,6 +60,9 @@ ly_create_alias( ) if (PAL_TRAIT_BUILD_HOST_TOOLS) + + include(${CMAKE_CURRENT_SOURCE_DIR}/Platform/${PAL_PLATFORM_NAME}/PAL_traits_editor_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) + ly_add_target( NAME AWSCore.Editor.Static STATIC NAMESPACE Gem @@ -97,25 +100,31 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Gem::AWSCore.Editor.Static ) - # This target is not a real gem module - # It is not meant to be loaded by the ModuleManager in C++ - ly_add_target( - NAME AWSCore.ResourceMappingTool MODULE - NAMESPACE Gem - OUTPUT_SUBDIRECTORY AWSCoreEditorQtBin - FILES_CMAKE - awscore_resourcemappingtool_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - Include/Private - BUILD_DEPENDENCIES - PRIVATE - Gem::AWSCore.Editor.Static - RUNTIME_DEPENDENCIES - 3rdParty::pyside2 + if (PAL_TRAIT_ENABLE_RESOURCE_MAPPING_TOOL) - ) - ly_add_dependencies(AWSCore.Editor AWSCore.ResourceMappingTool) + # This target is not a real gem module + # It is not meant to be loaded by the ModuleManager in C++ + ly_add_target( + NAME AWSCore.ResourceMappingTool MODULE + NAMESPACE Gem + OUTPUT_SUBDIRECTORY AWSCoreEditorQtBin + FILES_CMAKE + awscore_resourcemappingtool_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Include/Private + BUILD_DEPENDENCIES + PRIVATE + Gem::AWSCore.Editor.Static + RUNTIME_DEPENDENCIES + 3rdParty::pyside2 + + ) + ly_add_dependencies(AWSCore.Editor AWSCore.ResourceMappingTool) + + ly_install_directory(DIRECTORIES Tools/ResourceMappingTool) + + endif() # Builders and Tools (such as the Editor use AWSCore.Editor) use the .Editor module above. ly_create_alias( @@ -192,4 +201,3 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) endif() endif() -ly_install_directory(DIRECTORIES Tools/ResourceMappingTool) diff --git a/Gems/AWSCore/Code/Platform/Linux/PAL_traits_editor_linux.cmake b/Gems/AWSCore/Code/Platform/Linux/PAL_traits_editor_linux.cmake new file mode 100644 index 0000000000..deaaa60506 --- /dev/null +++ b/Gems/AWSCore/Code/Platform/Linux/PAL_traits_editor_linux.cmake @@ -0,0 +1,9 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +set(PAL_TRAIT_ENABLE_RESOURCE_MAPPING_TOOL TRUE) diff --git a/Gems/AWSCore/Code/Platform/Mac/PAL_traits_editor_mac.cmake b/Gems/AWSCore/Code/Platform/Mac/PAL_traits_editor_mac.cmake new file mode 100644 index 0000000000..e953c95955 --- /dev/null +++ b/Gems/AWSCore/Code/Platform/Mac/PAL_traits_editor_mac.cmake @@ -0,0 +1,9 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +set(PAL_TRAIT_ENABLE_RESOURCE_MAPPING_TOOL FALSE) diff --git a/Gems/AWSCore/Code/Platform/Windows/PAL_traits_editor_windows.cmake b/Gems/AWSCore/Code/Platform/Windows/PAL_traits_editor_windows.cmake new file mode 100644 index 0000000000..deaaa60506 --- /dev/null +++ b/Gems/AWSCore/Code/Platform/Windows/PAL_traits_editor_windows.cmake @@ -0,0 +1,9 @@ +# +# Copyright (c) Contributors to the Open 3D Engine Project. +# For complete copyright and license terms please see the LICENSE at the root of this distribution. +# +# SPDX-License-Identifier: Apache-2.0 OR MIT +# +# + +set(PAL_TRAIT_ENABLE_RESOURCE_MAPPING_TOOL TRUE)