From 553cf52c86cd723bdcbcc47589bda1da46881f71 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 31 Aug 2021 18:03:06 -0700 Subject: [PATCH] some install fixes, now I dont see the INSTALL target on projects using the prebuilt-SDK Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- CMakeLists.txt | 2 +- Code/LauncherUnified/CMakeLists.txt | 1 + cmake/3rdParty.cmake | 16 +++------------- cmake/Install.cmake | 15 ++++++++++++++- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a668af6a1..43b0dd240e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/Code/LauncherUnified/CMakeLists.txt b/Code/LauncherUnified/CMakeLists.txt index c3d152a777..845c2cd6c7 100644 --- a/Code/LauncherUnified/CMakeLists.txt +++ b/Code/LauncherUnified/CMakeLists.txt @@ -111,6 +111,7 @@ ly_install_directory( Platform/${PAL_PLATFORM_NAME} Platform/Common DESTINATION LauncherGenerator/Platform + VERBATIM ) ly_install_files( FILES FindLauncherGenerator.cmake diff --git a/cmake/3rdParty.cmake b/cmake/3rdParty.cmake index cd72faa78d..4599c282f0 100644 --- a/cmake/3rdParty.cmake +++ b/cmake/3rdParty.cmake @@ -306,20 +306,10 @@ endfunction() function(ly_install_external_target 3RDPARTY_ROOT_DIRECTORY) # Install the Find file to our /cmake directory - install(FILES ${CMAKE_CURRENT_LIST_FILE} - DESTINATION cmake + 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() diff --git a/cmake/Install.cmake b/cmake/Install.cmake index 34f316e31e..b71b01eb7d 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -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)