From c82f97c03ccdbb32036dcbfe71b622af34e3ed69 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Wed, 27 Oct 2021 16:59:39 -0700 Subject: [PATCH] Moves the inclusion of the platform-specific install files to the end of cmake/Install.cmake so the install wrapper functions are available Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- cmake/Install.cmake | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cmake/Install.cmake b/cmake/Install.cmake index a7340c29f3..b558590b9e 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -8,11 +8,6 @@ set(LY_INSTALL_ENABLED TRUE CACHE BOOL "Indicates if the install process is enabled") -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() - #! ly_install: wrapper to install that handles common functionality # # \notes: @@ -22,6 +17,10 @@ endif() # function(ly_install) + if(NOT LY_INSTALL_ENABLED) + return() + endif() + cmake_parse_arguments(ly_install "" "COMPONENT" "" ${ARGN}) if (NOT ly_install_COMPONENT OR "${ly_install_COMPONENT}" STREQUAL "${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}") # if it is installing under the default component, we need to de-duplicate since we can have @@ -194,3 +193,8 @@ function(ly_install_run_script SCRIPT) ) endfunction() + +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()