From 70c9ed93f8ab72b2d856ff7c6eace36a52746067 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Thu, 22 Jul 2021 16:42:51 -0700 Subject: [PATCH] Make locations for LY_PACKAGE_DOWNLOAD_CACHE_LOCATION and LY_PACKAGE_UNPACK_LOCATION relative to LY_3RDPARTY_PATH across configurations (#2360) Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- cmake/3rdPartyPackages.cmake | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/cmake/3rdPartyPackages.cmake b/cmake/3rdPartyPackages.cmake index 2228e36653..efe67b4d24 100644 --- a/cmake/3rdPartyPackages.cmake +++ b/cmake/3rdPartyPackages.cmake @@ -40,22 +40,18 @@ endif() # If you keep packages after downloading, then they can be moved to a network share # or checked into source control so that others on the same project can avoid re-downloading set(LY_PACKAGE_KEEP_AFTER_DOWNLOADING TRUE CACHE BOOL "If enabled, packages will be kept after downloading them for later re-use") -set(LY_PACKAGE_DOWNLOAD_CACHE_LOCATION ${LY_3RDPARTY_PATH}/downloaded_packages CACHE PATH "You can make it store the packages in a folder of your choosing") +set(LY_PACKAGE_DOWNLOAD_CACHE_LOCATION @LY_3RDPARTY_PATH@/downloaded_packages CACHE PATH "Download location for packages (Defaults to @LY_3RDPARTY_PATH@/downloaded_packages)") if (DEFINED ENV{LY_PACKAGE_DOWNLOAD_CACHE_LOCATION}) set(LY_PACKAGE_DOWNLOAD_CACHE_LOCATION $ENV{LY_PACKAGE_DOWNLOAD_CACHE_LOCATION}) endif() +string(CONFIGURE ${LY_PACKAGE_DOWNLOAD_CACHE_LOCATION} LY_PACKAGE_DOWNLOAD_CACHE_LOCATION @ONLY) # LY_PACKAGE_UNPACK_LOCATION - you can change this to any path reachable. -set(LY_PACKAGE_UNPACK_LOCATION ${LY_3RDPARTY_PATH}/packages CACHE PATH "Location to unpack downloaded packages to") +set(LY_PACKAGE_UNPACK_LOCATION @LY_3RDPARTY_PATH@/packages CACHE PATH "Unpack location of downloaded packages (Defaults to @LY_3RDPARTY_PATH@/packages)") if (DEFINED ENV{LY_PACKAGE_UNPACK_LOCATION}) set(LY_PACKAGE_UNPACK_LOCATION $ENV{LY_PACKAGE_UNPACK_LOCATION}) endif() - -# note that sometimes the user configures first without populating LY_3RDPARTY_PATH -# in that case, we'll try overwriting the cache value, only if it is blank: -if (NOT LY_PACKAGE_UNPACK_LOCATION) - set(LY_PACKAGE_UNPACK_LOCATION ${LY_3RDPARTY_PATH}/packages CACHE PATH "Location to unpack downloaded packages to" FORCE ) -endif() +string(CONFIGURE ${LY_PACKAGE_UNPACK_LOCATION} LY_PACKAGE_UNPACK_LOCATION @ONLY) # while developing you can set one or both to true to force auto downloads from your local cache set(LY_PACKAGE_VALIDATE_CONTENTS FALSE CACHE BOOL "If enabled, will fully validate every file in every package based on the SHA256SUMS file from the package")