From 2ddbd36f9a7ff537bb98b05d8894326fc7636c81 Mon Sep 17 00:00:00 2001 From: scottr Date: Mon, 17 May 2021 16:34:24 -0700 Subject: [PATCH] [cpack_installer] add option to specify license url. replicate online artifacts copy --- cmake/Packaging.cmake | 12 ++++++++---- .../Windows/PackagingBootstrapper.wxs | 18 +++++++++++++----- .../Platform/Windows/PackagingPostBuild.cmake | 19 +++++++++++++++++++ 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index 72216847f1..0fbd70e54c 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -13,10 +13,14 @@ if(NOT PAL_TRAIT_BUILD_CPACK_SUPPORTED) return() endif() -# set the common cpack variables first so they are accessible via configure_file -# when the platforms specific properties are applied below +# public facing options will eventually be converted into cpack specific ones below. +# all variables with the "CPACK_" prefix will automatically be cached for use in any +# of the build steps cpack runs e.g. pre-build, standard build, post-build. set(LY_INSTALLER_DOWNLOAD_URL "" CACHE STRING "URL embded into the installer to download additional artifacts") +set(LY_INSTALLER_LICENSE_URL "" CACHE STRING "Optionally embed a link to the license instead of raw text") +# set all common cpack variable overrides first so they can be accessible via configure_file +# when the platform specific settings are applied below set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}") set(CPACK_PACKAGE_VERSION "${LY_VERSION_STRING}") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Installation Tool") @@ -28,11 +32,11 @@ set(DEFAULT_LICENSE_NAME "Apache-2.0") set(DEFAULT_LICENSE_FILE "${CMAKE_SOURCE_DIR}/LICENSE.txt") set(CPACK_RESOURCE_FILE_LICENSE ${DEFAULT_LICENSE_FILE}) +set(CPACK_LICENSE_URL ${LY_INSTALLER_LICENSE_URL}) set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_VERSION}") -# CMAKE_SOURCE_DIR doesn't equate to anything during execution of pre/post build scripts. -# to pass it down, we can utilize the auto-caching of any variable with prefix "CPACK_" +# CMAKE_SOURCE_DIR doesn't equate to anything during execution of pre/post build scripts set(CPACK_SOURCE_DIR ${CMAKE_SOURCE_DIR}/cmake) # attempt to apply platform specific settings diff --git a/cmake/Platform/Windows/PackagingBootstrapper.wxs b/cmake/Platform/Windows/PackagingBootstrapper.wxs index 711b60d854..f231f05413 100644 --- a/cmake/Platform/Windows/PackagingBootstrapper.wxs +++ b/cmake/Platform/Windows/PackagingBootstrapper.wxs @@ -16,11 +16,19 @@ Value="[ProgramFiles64Folder]$(var.CPACK_PACKAGE_INSTALL_DIRECTORY)" bal:Overridable="yes"/> - - - + + + + + + + + +