[cpack_installer] some cpack cleanup and prep for online installer support (pre/post build steps)

This commit is contained in:
scottr
2021-05-11 18:07:19 -07:00
parent 9775822778
commit c777e2e353
4 changed files with 43 additions and 16 deletions
+24 -14
View File
@@ -13,6 +13,30 @@ 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
set(LY_INSTALLER_DOWNLOAD_URL "" CACHE PATH "URL embded into the installer to download additional artifacts")
set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION "${LY_VERSION_STRING}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Installation Tool")
string(TOLOWER ${PROJECT_NAME} _project_name_lower)
set(CPACK_PACKAGE_FILE_NAME "${_project_name_lower}_${LY_VERSION_STRING}_installer")
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_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_VERSION}")
# custom cpack cache variables for use in pre/post build scripts
set(CPACK_SOURCE_DIR ${CMAKE_SOURCE_DIR}/cmake)
set(CPACK_BINARY_DIR ${CMAKE_BINARY_DIR}/installer)
set(CPACK_DOWNLOAD_URL ${LY_INSTALLER_DOWNLOAD_URL})
# attempt to apply platform specific settings
ly_get_absolute_pal_filename(pal_dir ${CMAKE_SOURCE_DIR}/cmake/Platform/${PAL_HOST_PLATFORM_NAME})
include(${pal_dir}/Packaging_${PAL_HOST_PLATFORM_NAME_LOWERCASE}.cmake)
@@ -21,20 +45,6 @@ if(NOT CPACK_GENERATOR)
return()
endif()
set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}")
set(CPACK_PACKAGE_VERSION "${LY_VERSION_STRING}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Installation Tool")
string(TOLOWER ${PROJECT_NAME} _project_name_lower)
set(CPACK_PACKAGE_FILE_NAME "${_project_name_lower}_installer")
set(DEFAULT_LICENSE_NAME "Apache-2.0")
set(DEFAULT_LICENSE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
set(CPACK_RESOURCE_FILE_LICENSE ${DEFAULT_LICENSE_FILE})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_VERSION}")
# IMPORTANT: required to be included AFTER setting all property overrides
include(CPack REQUIRED)
@@ -0,0 +1,12 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
message(STATUS "Hello from CPack post build!")
@@ -32,7 +32,7 @@ set(CPACK_GENERATOR "WIX")
# however, they are unique for each run. instead, let's do the auto generation here and add it to
# the cache for run persistence. an additional cache file will be used to store the information on
# the original generation so we still have the ability to detect if they are still being used.
set(_guid_cache_file "${CMAKE_BINARY_DIR}/installer/wix_guid_cache.cmake")
set(_guid_cache_file "${CPACK_BINARY_DIR}/wix_guid_cache.cmake")
if(NOT EXISTS ${_guid_cache_file})
set(_wix_guid_namespace "6D43F57A-2917-4AD9-B758-1F13CDB08593")
@@ -89,4 +89,8 @@ endif()
set(CPACK_WIX_PRODUCT_GUID ${LY_WIX_PRODUCT_GUID})
set(CPACK_WIX_UPGRADE_GUID ${LY_WIX_UPGRADE_GUID})
set(CPACK_WIX_TEMPLATE "${CMAKE_SOURCE_DIR}/cmake/Platform/Windows/PackagingTemplate.wxs.in")
set(CPACK_WIX_TEMPLATE "${CPACK_SOURCE_DIR}/Platform/Windows/PackagingTemplate.wxs.in")
set(CPACK_POST_BUILD_SCRIPTS
${CPACK_SOURCE_DIR}/Platform/Windows/PackagingPostBuild.cmake
)
@@ -24,5 +24,6 @@ set(FILES
PALDetection_windows.cmake
Install_windows.cmake
Packaging_windows.cmake
PackagingPostBuild.cmake
PackagingTemplate.wxs.in
)