From dc8b48601cd03c79f45598d65467abc060d0b8ee Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 24 Aug 2021 10:36:31 -0700 Subject: [PATCH] PR comments/improvements Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/AWSCore/Code/CMakeLists.txt | 6 +----- cmake/Install.cmake | 16 +++++++++++----- python/CMakeLists.txt | 4 ++++ scripts/CMakeLists.txt | 4 ++-- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Gems/AWSCore/Code/CMakeLists.txt b/Gems/AWSCore/Code/CMakeLists.txt index 8489e38550..5fdefa9f9e 100644 --- a/Gems/AWSCore/Code/CMakeLists.txt +++ b/Gems/AWSCore/Code/CMakeLists.txt @@ -167,8 +167,4 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) endif() endif() -install(DIRECTORY "Tools/ResourceMappingTool" - DESTINATION "Gems/AWSCore/Code/Tools" - COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} - PATTERN "__pycache__" EXCLUDE -) +ly_install_directory(DIRECTORIES Tools/ResourceMappingTool) diff --git a/cmake/Install.cmake b/cmake/Install.cmake index 9135e141d5..5781fc7ae5 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -17,7 +17,12 @@ endif() # \arg:DESTINATION (optional) destination to install the directory to (relative to CMAKE_PREFIX_PATH) # \arg:EXCLUDE_PATTERNS (optional) patterns to exclude # -# \notes: refer to cmake's install(DIRECTORY documentation for more information +# \notes: +# - refer to cmake's install(DIRECTORY documentation for more information +# - If the directory contains programs/scripts, exclude them from this call and add a specific ly_install_files with +# PROGRAMS set. This is necessary to set the proper execution permissions. +# - This function will automatically filter out __pycache__, *.egg-info, CMakeLists.txt, *.cmake files. If those files +# need to be installed, use ly_install_files. # function(ly_install_directory) @@ -75,10 +80,11 @@ endfunction() #! ly_install_files: specifies files to be copied to the install layout at install time # # \arg:FILES files to install -# \arg:DESTINATION (optional) destination to install the directory to (relative to CMAKE_PREFIX_PATH) +# \arg:DESTINATION destination to install the directory to (relative to CMAKE_PREFIX_PATH) # \arg:PROGRAMS (optional) indicates if the files are programs that should be installed with EXECUTE permissions # -# \notes: refer to cmake's install(FILES/PROGRAMS documentation for more information +# \notes: +# - refer to cmake's install(FILES/PROGRAMS documentation for more information # function(ly_install_files) @@ -92,7 +98,7 @@ function(ly_install_files) message(FATAL_ERROR "You must provide a list of files to install") endif() if(NOT ly_install_files_DESTINATION) - message(FATAL_ERROR "You must provide a destination to install filest to") + message(FATAL_ERROR "You must provide a destination to install files to") endif() unset(files) @@ -109,7 +115,7 @@ function(ly_install_files) install(${install_type} ${files} DESTINATION ${ly_install_files_DESTINATION} - COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} # use the deafult for the time being + COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} # use the default for the time being ) endfunction() \ No newline at end of file diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 4e49c6396a..b2d01a08f8 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -6,6 +6,10 @@ # # +if(NOT PAL_TRAIT_BUILD_HOST_TOOLS) + return() +endif() + # common files to all platforms ly_install_files( FILES diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 5c55c58209..4e2dd1d780 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -8,8 +8,8 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) add_subdirectory(bundler) - add_subdirectory(detect_file_changes) add_subdirectory(commit_validation) - add_subdirectory(o3de) add_subdirectory(ctest) + add_subdirectory(detect_file_changes) + add_subdirectory(o3de) endif()