Cherry-pick of Linux deb package to stabilization (#5778)
* Cherry-pick 49e8f35858
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Merging differences from development of other changes that need to be there for deb packaging
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Picks a needed change for the installer
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Fixes warning in mac
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Takes version from environment if defined
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Do not pick up version if it is empty string since that will also break version comparison
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* creating temp directories if they dont exist
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* removing a dependency to itself (Multiplayer.Builders is an alias of Multiplayer.Editor)
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Filters which runtime dependencies are passed from private build dependencies to only those that are actual targets.
This avoids something like a "d3d12" private build dependency from being passed to the runtime dependencies
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -8,6 +8,14 @@
|
||||
|
||||
include(cmake/FileUtil.cmake)
|
||||
|
||||
set(LY_INSTALL_EXTERNAL_BUILD_DIRS "" CACHE PATH "External build directories to be included in the install process. This allows to package non-monolithic and monolithic.")
|
||||
unset(normalized_external_build_dirs)
|
||||
foreach(external_dir ${LY_INSTALL_EXTERNAL_BUILD_DIRS})
|
||||
cmake_path(ABSOLUTE_PATH external_dir BASE_DIRECTORY ${LY_ROOT_FOLDER} NORMALIZE)
|
||||
list(APPEND normalized_external_build_dirs ${external_dir})
|
||||
endforeach()
|
||||
set(LY_INSTALL_EXTERNAL_BUILD_DIRS ${normalized_external_build_dirs})
|
||||
|
||||
set(CMAKE_INSTALL_MESSAGE NEVER) # Simplify messages to reduce output noise
|
||||
|
||||
define_property(TARGET PROPERTY LY_INSTALL_GENERATE_RUN_TARGET
|
||||
@@ -19,13 +27,25 @@ define_property(TARGET PROPERTY LY_INSTALL_GENERATE_RUN_TARGET
|
||||
]]
|
||||
)
|
||||
|
||||
ly_set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME Core)
|
||||
# We can have elements being installed under the following components:
|
||||
# - Core (required for all) (default)
|
||||
# - Default
|
||||
# - Default_$<CONFIG>
|
||||
# - Monolithic
|
||||
# - Monolithic_$<CONFIG>
|
||||
# Debug/Monolithic are build permutations, so for a CMake run, it can only generate
|
||||
# one of the permutations. Each build permutation can generate only one cmake_install.cmake.
|
||||
# Each build permutation will generate the same elements in Core.
|
||||
# CPack is able to put the two together by taking Core from one permutation and then taking
|
||||
# each permutation.
|
||||
|
||||
ly_set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME CORE)
|
||||
if(LY_MONOLITHIC_GAME)
|
||||
set(LY_BUILD_PERMUTATION Monolithic)
|
||||
else()
|
||||
set(LY_BUILD_PERMUTATION Default)
|
||||
endif()
|
||||
string(TOUPPER ${LY_BUILD_PERMUTATION} LY_INSTALL_PERMUTATION_COMPONENT)
|
||||
|
||||
cmake_path(RELATIVE_PATH CMAKE_RUNTIME_OUTPUT_DIRECTORY BASE_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE runtime_output_directory)
|
||||
cmake_path(RELATIVE_PATH CMAKE_LIBRARY_OUTPUT_DIRECTORY BASE_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE library_output_directory)
|
||||
@@ -65,14 +85,24 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
|
||||
continue()
|
||||
endif()
|
||||
|
||||
# For some cases (e.g. codegen) we generate headers that end up in the BUILD_DIR. Since the BUILD_DIR
|
||||
# is per-permutation, we need to install such headers per permutation. For the other cases, we can install
|
||||
# under the default component since they are shared across permutations/configs.
|
||||
cmake_path(IS_PREFIX CMAKE_BINARY_DIR ${include_directory} NORMALIZE include_directory_child_of_build)
|
||||
if(NOT include_directory_child_of_build)
|
||||
set(include_directory_component ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME})
|
||||
else()
|
||||
set(include_directory_component ${LY_INSTALL_PERMUTATION_COMPONENT})
|
||||
endif()
|
||||
|
||||
unset(rel_include_dir)
|
||||
cmake_path(RELATIVE_PATH include_directory BASE_DIRECTORY ${LY_ROOT_FOLDER} OUTPUT_VARIABLE rel_include_dir)
|
||||
cmake_path(APPEND rel_include_dir "..")
|
||||
cmake_path(NORMAL_PATH rel_include_dir OUTPUT_VARIABLE destination_dir)
|
||||
|
||||
install(DIRECTORY ${include_directory}
|
||||
|
||||
ly_install(DIRECTORY ${include_directory}
|
||||
DESTINATION ${destination_dir}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
COMPONENT ${include_directory_component}
|
||||
FILES_MATCHING
|
||||
PATTERN *.h
|
||||
PATTERN *.hpp
|
||||
@@ -94,9 +124,9 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
|
||||
cmake_path(RELATIVE_PATH target_library_output_directory BASE_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} OUTPUT_VARIABLE target_library_output_subdirectory)
|
||||
endif()
|
||||
|
||||
if(COMMAND ly_install_target_override)
|
||||
if(COMMAND ly_setup_target_install_targets_override)
|
||||
# Mac needs special handling because of a cmake issue
|
||||
ly_install_target_override(TARGET ${TARGET_NAME}
|
||||
ly_setup_target_install_targets_override(TARGET ${TARGET_NAME}
|
||||
ARCHIVE_DIR ${archive_output_directory}
|
||||
LIBRARY_DIR ${library_output_directory}
|
||||
RUNTIME_DIR ${runtime_output_directory}
|
||||
@@ -104,18 +134,23 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
|
||||
RUNTIME_SUBDIR ${target_runtime_output_subdirectory}
|
||||
)
|
||||
else()
|
||||
install(
|
||||
TARGETS ${TARGET_NAME}
|
||||
ARCHIVE
|
||||
DESTINATION ${archive_output_directory}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
LIBRARY
|
||||
DESTINATION ${library_output_directory}/${target_library_output_subdirectory}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
RUNTIME
|
||||
DESTINATION ${runtime_output_directory}/${target_runtime_output_subdirectory}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
|
||||
string(TOUPPER ${conf} UCONF)
|
||||
ly_install(TARGETS ${TARGET_NAME}
|
||||
ARCHIVE
|
||||
DESTINATION ${archive_output_directory}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
CONFIGURATIONS ${conf}
|
||||
LIBRARY
|
||||
DESTINATION ${library_output_directory}/${target_library_output_subdirectory}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
CONFIGURATIONS ${conf}
|
||||
RUNTIME
|
||||
DESTINATION ${runtime_output_directory}/${target_runtime_output_subdirectory}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
CONFIGURATIONS ${conf}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# CMakeLists.txt related files
|
||||
@@ -189,8 +224,14 @@ function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME absolute_tar
|
||||
if("${target_type}" STREQUAL "STATIC_LIBRARY")
|
||||
set(build_deps_target "${build_deps_target};${build_deps_PRIVATE}")
|
||||
endif()
|
||||
# But we will also pass the private dependencies as runtime dependencies (note the comment above)
|
||||
set(RUNTIME_DEPENDENCIES_PLACEHOLDER ${build_deps_PRIVATE})
|
||||
|
||||
# But we will also pass the private dependencies as runtime dependencies (as long as they are targets, note the comment above)
|
||||
foreach(build_dep_private IN LISTS build_deps_PRIVATE)
|
||||
if(TARGET ${build_dep_private})
|
||||
list(APPEND RUNTIME_DEPENDENCIES_PLACEHOLDER "${build_dep_private}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
foreach(build_dependency IN LISTS build_deps_target)
|
||||
# Skip wrapping produced when targets are not created in the same directory
|
||||
if(build_dependency)
|
||||
@@ -280,10 +321,15 @@ set_property(TARGET ${NAME_PLACEHOLDER}
|
||||
|
||||
set(target_install_source_dir ${CMAKE_CURRENT_BINARY_DIR}/install/${relative_target_source_dir})
|
||||
file(GENERATE OUTPUT "${target_install_source_dir}/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}/${NAME_PLACEHOLDER}_$<CONFIG>.cmake" CONTENT "${target_file_contents}")
|
||||
install(FILES "${target_install_source_dir}/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}/${NAME_PLACEHOLDER}_$<CONFIG>.cmake"
|
||||
DESTINATION ${relative_target_source_dir}/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
|
||||
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
|
||||
string(TOUPPER ${conf} UCONF)
|
||||
ly_install(FILES "${target_install_source_dir}/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}/${NAME_PLACEHOLDER}_${conf}.cmake"
|
||||
DESTINATION ${relative_target_source_dir}/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
CONFIGURATIONS ${conf}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# Since a CMakeLists.txt could contain multiple targets, we generate it in a folder per target
|
||||
ly_file_read(${LY_ROOT_FOLDER}/cmake/install/InstalledTarget.in target_cmakelists_template)
|
||||
@@ -323,7 +369,8 @@ function(ly_setup_subdirectory absolute_target_source_dir)
|
||||
@cmake_copyright_comment@
|
||||
include(Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
|
||||
]] @ONLY)
|
||||
install(FILES "${target_install_source_dir}/CMakeLists.txt"
|
||||
|
||||
ly_install(FILES "${target_install_source_dir}/CMakeLists.txt"
|
||||
DESTINATION ${relative_target_source_dir}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
@@ -338,7 +385,7 @@ else()
|
||||
include(Platform/${PAL_PLATFORM_NAME}/Default/permutation.cmake)
|
||||
endif()
|
||||
]])
|
||||
install(FILES "${target_install_source_dir}/Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake"
|
||||
ly_install(FILES "${target_install_source_dir}/Platform/${PAL_PLATFORM_NAME}/platform_${PAL_PLATFORM_NAME_LOWERCASE}.cmake"
|
||||
DESTINATION ${relative_target_source_dir}/Platform/${PAL_PLATFORM_NAME}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
@@ -358,9 +405,10 @@ endif()
|
||||
"${GEM_VARIANT_TO_LOAD_PLACEHOLDER}"
|
||||
"${ENABLE_GEMS_PLACEHOLDER}"
|
||||
)
|
||||
install(FILES "${target_install_source_dir}/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}/permutation.cmake"
|
||||
DESTINATION ${relative_target_source_dir}//Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
|
||||
ly_install(FILES "${target_install_source_dir}/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}/permutation.cmake"
|
||||
DESTINATION ${relative_target_source_dir}/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}
|
||||
)
|
||||
|
||||
endfunction()
|
||||
@@ -368,7 +416,7 @@ endfunction()
|
||||
#! ly_setup_cmake_install: install the "cmake" folder
|
||||
function(ly_setup_cmake_install)
|
||||
|
||||
install(DIRECTORY "${LY_ROOT_FOLDER}/cmake"
|
||||
ly_install(DIRECTORY "${LY_ROOT_FOLDER}/cmake"
|
||||
DESTINATION .
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
PATTERN "__pycache__" EXCLUDE
|
||||
@@ -378,22 +426,24 @@ function(ly_setup_cmake_install)
|
||||
)
|
||||
|
||||
# Connect configuration types
|
||||
install(FILES "${LY_ROOT_FOLDER}/cmake/install/ConfigurationTypes.cmake"
|
||||
ly_install(FILES "${LY_ROOT_FOLDER}/cmake/install/ConfigurationTypes.cmake"
|
||||
DESTINATION cmake
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
# Inject code that will generate each ConfigurationType_<CONFIG>.cmake file
|
||||
set(install_configuration_type_template [=[
|
||||
configure_file(@LY_ROOT_FOLDER@/cmake/install/ConfigurationType_config.cmake.in
|
||||
${CMAKE_INSTALL_PREFIX}/cmake/Platform/@PAL_PLATFORM_NAME@/@LY_BUILD_PERMUTATION@/ConfigurationTypes_${CMAKE_INSTALL_CONFIG_NAME}.cmake
|
||||
|
||||
# generate each ConfigurationType_<CONFIG>.cmake file and install it under that configuration
|
||||
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
|
||||
string(TOUPPER ${conf} UCONF)
|
||||
configure_file("${LY_ROOT_FOLDER}/cmake/install/ConfigurationType_config.cmake.in"
|
||||
"${CMAKE_BINARY_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}/ConfigurationTypes_${conf}.cmake"
|
||||
@ONLY
|
||||
)
|
||||
message(STATUS "Generated ${CMAKE_INSTALL_PREFIX}/cmake/Platform/@PAL_PLATFORM_NAME@/@LY_BUILD_PERMUTATION@/ConfigurationTypes_${CMAKE_INSTALL_CONFIG_NAME}.cmake")
|
||||
]=])
|
||||
string(CONFIGURE "${install_configuration_type_template}" install_configuration_type @ONLY)
|
||||
install(CODE "${install_configuration_type}"
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
ly_install(FILES "${CMAKE_BINARY_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}/ConfigurationTypes_${conf}.cmake"
|
||||
DESTINATION cmake/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
CONFIGURATIONS ${conf}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# Transform the LY_EXTERNAL_SUBDIRS list into a json array
|
||||
set(indent " ")
|
||||
@@ -412,8 +462,7 @@ function(ly_setup_cmake_install)
|
||||
|
||||
configure_file(${LY_ROOT_FOLDER}/cmake/install/engine.json.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/engine.json @ONLY)
|
||||
|
||||
install(
|
||||
FILES
|
||||
ly_install(FILES
|
||||
"${LY_ROOT_FOLDER}/CMakeLists.txt"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake/engine.json"
|
||||
DESTINATION .
|
||||
@@ -437,18 +486,18 @@ function(ly_setup_cmake_install)
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
install(FILES ${additional_find_files}
|
||||
ly_install(FILES ${additional_find_files}
|
||||
DESTINATION cmake/3rdParty
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
install(FILES ${additional_platform_files}
|
||||
ly_install(FILES ${additional_platform_files}
|
||||
DESTINATION cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
|
||||
# Findo3de.cmake file: we generate a different Findo3de.cmake file than the one we have in the source dir.
|
||||
configure_file(${LY_ROOT_FOLDER}/cmake/install/Findo3de.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake @ONLY)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake"
|
||||
ly_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake"
|
||||
DESTINATION cmake
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
@@ -467,9 +516,9 @@ function(ly_setup_cmake_install)
|
||||
${find_subdirectories}
|
||||
"
|
||||
)
|
||||
install(FILES "${permutation_find_subdirectories}"
|
||||
ly_install(FILES "${permutation_find_subdirectories}"
|
||||
DESTINATION cmake/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}
|
||||
)
|
||||
|
||||
set(pal_builtin_file ${CMAKE_CURRENT_BINARY_DIR}/cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}/BuiltInPackages_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
|
||||
@@ -483,7 +532,7 @@ else()
|
||||
endif()
|
||||
"
|
||||
)
|
||||
install(FILES "${pal_builtin_file}"
|
||||
ly_install(FILES "${pal_builtin_file}"
|
||||
DESTINATION cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
@@ -506,9 +555,9 @@ endif()
|
||||
file(GENERATE OUTPUT ${permutation_builtin_file}
|
||||
CONTENT ${builtinpackages}
|
||||
)
|
||||
install(FILES "${permutation_builtin_file}"
|
||||
ly_install(FILES "${permutation_builtin_file}"
|
||||
DESTINATION cmake/3rdParty/Platform/${PAL_PLATFORM_NAME}/${LY_BUILD_PERMUTATION}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}
|
||||
)
|
||||
|
||||
endfunction()
|
||||
@@ -517,15 +566,27 @@ endfunction()
|
||||
function(ly_setup_runtime_dependencies)
|
||||
|
||||
# Common functions used by the bellow code
|
||||
if(COMMAND ly_install_code_function_override)
|
||||
ly_install_code_function_override()
|
||||
if(COMMAND ly_setup_runtime_dependencies_copy_function_override)
|
||||
ly_setup_runtime_dependencies_copy_function_override()
|
||||
else()
|
||||
install(CODE
|
||||
# despite this copy function being the same, we need to install it per component that uses it
|
||||
# (which is per-configuration per-permutation component)
|
||||
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
|
||||
string(TOUPPER ${conf} UCONF)
|
||||
ly_install(CODE
|
||||
"function(ly_copy source_file target_directory)
|
||||
file(COPY \"\${source_file}\" DESTINATION \"\${target_directory}\" FILE_PERMISSIONS ${LY_COPY_PERMISSIONS})
|
||||
cmake_path(GET source_file FILENAME target_filename)
|
||||
cmake_path(APPEND full_target_directory \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\" \"\${target_directory}\")
|
||||
cmake_path(APPEND target_file \"\${full_target_directory}\" \"\${target_filename}\")
|
||||
if(\"\${source_file}\" IS_NEWER_THAN \"\${target_file}\")
|
||||
message(STATUS \"Copying \${source_file} to \${full_target_directory}...\")
|
||||
file(COPY \"\${source_file}\" DESTINATION \"\${full_target_directory}\" FILE_PERMISSIONS ${LY_COPY_PERMISSIONS} FOLLOW_SYMLINK_CHAIN)
|
||||
file(TOUCH_NOCREATE \"${target_file}\")
|
||||
endif()
|
||||
endfunction()"
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
unset(runtime_commands)
|
||||
@@ -545,12 +606,7 @@ endfunction()"
|
||||
endif()
|
||||
|
||||
# runtime dependencies that need to be copied to the output
|
||||
# Anywhere CMAKE_INSTALL_PREFIX is used, it has to be escaped so it is baked into the cmake_install.cmake script instead
|
||||
# of baking the path. This is needed so `cmake --install --prefix <someprefix>` works regardless of the CMAKE_INSTALL_PREFIX
|
||||
# used to generate the solution.
|
||||
# CMAKE_INSTALL_PREFIX is still used when building the INSTALL target
|
||||
set(install_output_folder "\${CMAKE_INSTALL_PREFIX}/${runtime_output_directory}")
|
||||
set(target_file_dir "${install_output_folder}/${target_runtime_output_subdirectory}")
|
||||
set(target_file_dir "${runtime_output_directory}/${target_runtime_output_subdirectory}")
|
||||
ly_get_runtime_dependencies(runtime_dependencies ${target})
|
||||
foreach(runtime_dependency ${runtime_dependencies})
|
||||
unset(runtime_command)
|
||||
@@ -564,9 +620,12 @@ endfunction()"
|
||||
|
||||
list(REMOVE_DUPLICATES runtime_commands)
|
||||
list(JOIN runtime_commands " " runtime_commands_str) # the spaces are just to see the right identation in the cmake_install.cmake file
|
||||
install(CODE "${runtime_commands_str}"
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
|
||||
string(TOUPPER ${conf} UCONF)
|
||||
ly_install(CODE "${runtime_commands_str}"
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
endfunction()
|
||||
|
||||
@@ -653,16 +712,17 @@ function(ly_setup_assets)
|
||||
endif()
|
||||
|
||||
if(IS_DIRECTORY ${gem_absolute_path})
|
||||
install(DIRECTORY "${gem_absolute_path}"
|
||||
ly_install(DIRECTORY "${gem_absolute_path}"
|
||||
DESTINATION ${gem_install_dest_dir}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
elseif (EXISTS ${gem_absolute_path})
|
||||
install(FILES ${gem_absolute_path}
|
||||
ly_install(FILES ${gem_absolute_path}
|
||||
DESTINATION ${gem_install_dest_dir}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
endif()
|
||||
|
||||
endforeach()
|
||||
|
||||
endforeach()
|
||||
@@ -733,7 +793,7 @@ function(ly_setup_o3de_install)
|
||||
ly_setup_assets()
|
||||
|
||||
# Misc
|
||||
install(FILES
|
||||
ly_install(FILES
|
||||
${LY_ROOT_FOLDER}/pytest.ini
|
||||
${LY_ROOT_FOLDER}/LICENSE.txt
|
||||
${LY_ROOT_FOLDER}/README.md
|
||||
@@ -743,7 +803,7 @@ function(ly_setup_o3de_install)
|
||||
|
||||
# Inject other build directories
|
||||
foreach(external_dir ${LY_INSTALL_EXTERNAL_BUILD_DIRS})
|
||||
install(CODE
|
||||
ly_install(CODE
|
||||
"set(LY_CORE_COMPONENT_ALREADY_INCLUDED TRUE)
|
||||
include(${external_dir}/cmake_install.cmake)
|
||||
set(LY_CORE_COMPONENT_ALREADY_INCLUDED FALSE)"
|
||||
@@ -755,4 +815,4 @@ set(LY_CORE_COMPONENT_ALREADY_INCLUDED FALSE)"
|
||||
ly_post_install_steps()
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
endfunction()
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
message(STATUS "Executing packaging postbuild...")
|
||||
|
||||
# ly_is_s3_url
|
||||
# if the given URL is a s3 url of thr form "s3://(stuff)" then sets
|
||||
# the output_variable_name to TRUE otherwise unsets it.
|
||||
function (ly_is_s3_url download_url output_variable_name)
|
||||
if ("${download_url}" MATCHES "s3://.*")
|
||||
set(${output_variable_name} TRUE PARENT_SCOPE)
|
||||
else()
|
||||
unset(${output_variable_name} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(ly_upload_to_url in_url in_local_path in_file_regex)
|
||||
|
||||
message(STATUS "Uploading ${in_local_path}/${in_file_regex} artifacts to ${CPACK_UPLOAD_URL}")
|
||||
ly_is_s3_url(${in_url} _is_s3_bucket)
|
||||
if(NOT _is_s3_bucket)
|
||||
message(FATAL_ERROR "Only S3 installer uploading is supported at this time")
|
||||
endif()
|
||||
|
||||
# strip the scheme and extract the bucket/key prefix from the URL
|
||||
string(REPLACE "s3://" "" _stripped_url ${in_url})
|
||||
string(REPLACE "/" ";" _tokens ${_stripped_url})
|
||||
|
||||
list(POP_FRONT _tokens _bucket)
|
||||
string(JOIN "/" _prefix ${_tokens})
|
||||
|
||||
set(_extra_args [[{"ACL":"bucket-owner-full-control"}]])
|
||||
|
||||
file(TO_NATIVE_PATH "${LY_ROOT_FOLDER}/scripts/build/tools/upload_to_s3.py" _upload_script)
|
||||
|
||||
set(_upload_command
|
||||
${CPACK_LY_PYTHON_CMD} -s
|
||||
-u ${_upload_script}
|
||||
--base_dir ${in_local_path}
|
||||
--file_regex="${in_file_regex}"
|
||||
--bucket ${_bucket}
|
||||
--key_prefix ${_prefix}
|
||||
--extra_args ${_extra_args}
|
||||
)
|
||||
|
||||
if(CPACK_AWS_PROFILE)
|
||||
list(APPEND _upload_command --profile ${CPACK_AWS_PROFILE})
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_upload_command}
|
||||
RESULT_VARIABLE _upload_result
|
||||
OUTPUT_VARIABLE _upload_output
|
||||
ERROR_VARIABLE _upload_error
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if (${_upload_result} EQUAL 0)
|
||||
message(STATUS "Artifact uploading complete!")
|
||||
else()
|
||||
message(FATAL_ERROR "An error occurred uploading to s3.\n Output: ${_upload_output}\n\ Error: ${_upload_error}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(ly_upload_to_latest in_url in_path)
|
||||
|
||||
message(STATUS "Updating latest tagged build")
|
||||
|
||||
# make sure we can extra the commit info from the URL first
|
||||
string(REGEX MATCH "([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9a-zA-Z]+)"
|
||||
commit_info ${in_url}
|
||||
)
|
||||
if(NOT commit_info)
|
||||
message(FATAL_ERROR "Failed to extract the build tag")
|
||||
endif()
|
||||
|
||||
# Create a temp directory where we are going to rename the file to take out the version
|
||||
# and then upload it
|
||||
set(temp_dir ${CPACK_BINARY_DIR}/temp)
|
||||
if(NOT EXISTS ${temp_dir})
|
||||
file(MAKE_DIRECTORY ${temp_dir})
|
||||
endif()
|
||||
file(COPY ${in_path} DESTINATION ${temp_dir})
|
||||
|
||||
cmake_path(GET in_path FILENAME in_path_filename)
|
||||
string(REPLACE "_${CPACK_PACKAGE_VERSION}" "" non_versioned_in_path_filename ${in_path_filename})
|
||||
file(RENAME "${temp_dir}/${in_path_filename}" "${temp_dir}/${non_versioned_in_path_filename}")
|
||||
|
||||
# include the commit info in a text file that will live next to the exe
|
||||
set(_temp_info_file ${temp_dir}/build_tag.txt)
|
||||
file(WRITE ${_temp_info_file} ${commit_info})
|
||||
|
||||
# update the URL and upload
|
||||
string(REPLACE
|
||||
${commit_info} "Latest"
|
||||
latest_upload_url ${in_url}
|
||||
)
|
||||
|
||||
ly_upload_to_url(
|
||||
${latest_upload_url}
|
||||
${temp_dir}
|
||||
".*(${non_versioned_in_path_filename}|build_tag.txt)$"
|
||||
)
|
||||
|
||||
# cleanup the temp files
|
||||
file(REMOVE_RECURSE ${temp_dir})
|
||||
message(STATUS "Latest build update complete!")
|
||||
|
||||
endfunction()
|
||||
@@ -0,0 +1,5 @@
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
@@ -272,7 +272,7 @@ function(ly_delayed_generate_runtime_dependencies)
|
||||
endforeach()
|
||||
|
||||
# Generate the output file, note the STAMP_OUTPUT_FILE need to match with the one defined in LYWrappers.cmake
|
||||
set(STAMP_OUTPUT_FILE ${CMAKE_BINARY_DIR}/runtime_dependencies/$<CONFIG>/${target}_$<CONFIG>.stamp)
|
||||
set(STAMP_OUTPUT_FILE ${CMAKE_BINARY_DIR}/runtime_dependencies/$<CONFIG>/${target}.stamp)
|
||||
set(target_file_dir "$<TARGET_FILE_DIR:${target}>")
|
||||
set(target_file "$<TARGET_FILE:${target}>")
|
||||
ly_file_read(${LY_RUNTIME_DEPENDENCIES_TEMPLATE} template_file)
|
||||
|
||||
@@ -9,14 +9,22 @@
|
||||
cmake_policy(SET CMP0012 NEW) # new policy for the if that evaluates a boolean out of "if(NOT ${same_location})"
|
||||
|
||||
function(ly_copy source_file target_directory)
|
||||
get_filename_component(target_filename "${source_file}" NAME)
|
||||
cmake_path(COMPARE "${source_file}" EQUAL "${target_directory}/${target_filename}" same_location)
|
||||
cmake_path(GET source_file FILENAME target_filename)
|
||||
cmake_path(APPEND target_file "${target_directory}" "${target_filename}")
|
||||
cmake_path(COMPARE "${source_file}" EQUAL "${target_file}" same_location)
|
||||
if(NOT ${same_location})
|
||||
file(LOCK ${target_directory}/${target_filename}.lock GUARD FUNCTION TIMEOUT 300)
|
||||
if("${source_file}" IS_NEWER_THAN "${target_directory}/${target_filename}")
|
||||
file(LOCK ${target_file}.lock GUARD FUNCTION TIMEOUT 300)
|
||||
file(SIZE "${source_file}" source_file_size)
|
||||
if(EXISTS "${target_file}")
|
||||
file(SIZE "${target_file}" target_file_size)
|
||||
else()
|
||||
set(target_file_size 0)
|
||||
endif()
|
||||
if((NOT source_file_size EQUAL target_file_size) OR "${source_file}" IS_NEWER_THAN "${target_file}")
|
||||
message(STATUS "Copying \"${source_file}\" to \"${target_directory}\"...")
|
||||
file(MAKE_DIRECTORY "${full_target_directory}")
|
||||
file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN)
|
||||
file(TOUCH_NOCREATE ${target_directory}/${target_filename})
|
||||
file(TOUCH_NOCREATE ${target_file})
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@@ -6,25 +6,41 @@
|
||||
#
|
||||
#
|
||||
|
||||
#! ly_install_code_function_override: Linux-specific copy function to handle RPATH fixes
|
||||
#! ly_setup_runtime_dependencies_copy_function_override: Linux-specific copy function to handle RPATH fixes
|
||||
set(ly_copy_template [[
|
||||
function(ly_copy source_file target_directory)
|
||||
file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN)
|
||||
get_filename_component(target_filename_ext "${source_file}" LAST_EXT)
|
||||
if("${source_file}" MATCHES "qt/plugins" AND "${target_filename_ext}" STREQUAL ".so")
|
||||
get_filename_component(target_filename "${source_file}" NAME)
|
||||
file(RPATH_CHANGE FILE "${target_directory}/${target_filename}" OLD_RPATH "\$ORIGIN/../../lib" NEW_RPATH "\$ORIGIN/..")
|
||||
elseif("${source_file}" MATCHES "lrelease")
|
||||
get_filename_component(target_filename "${source_file}" NAME)
|
||||
file(RPATH_CHANGE FILE "${target_directory}/${target_filename}" OLD_RPATH "\$ORIGIN/../lib" NEW_RPATH "\$ORIGIN")
|
||||
cmake_path(GET source_file FILENAME target_filename)
|
||||
cmake_path(APPEND full_target_directory "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}" "${target_directory}")
|
||||
cmake_path(APPEND target_file "${full_target_directory}" "${target_filename}")
|
||||
if("${source_file}" IS_NEWER_THAN "${target_file}")
|
||||
message(STATUS "Copying ${source_file} to ${full_target_directory}...")
|
||||
file(MAKE_DIRECTORY "${full_target_directory}")
|
||||
file(COPY "${source_file}" DESTINATION "${full_target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN)
|
||||
file(TOUCH_NOCREATE "${target_file}")
|
||||
|
||||
# Special case for install
|
||||
cmake_PATH(GET source_file EXTENSION target_filename_ext)
|
||||
if("${target_filename_ext}" STREQUAL ".so")
|
||||
if("${source_file}" MATCHES "qt/plugins")
|
||||
file(RPATH_CHANGE FILE "${target_file}" OLD_RPATH "\$ORIGIN/../../lib" NEW_RPATH "\$ORIGIN/..")
|
||||
endif()
|
||||
if(CMAKE_INSTALL_DO_STRIP)
|
||||
execute_process(COMMAND @CMAKE_STRIP@ "${target_file}")
|
||||
endif()
|
||||
elseif("${source_file}" MATCHES "lrelease")
|
||||
file(RPATH_CHANGE FILE "${target_file}" OLD_RPATH "\$ORIGIN/../lib" NEW_RPATH "\$ORIGIN")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()]])
|
||||
|
||||
function(ly_install_code_function_override)
|
||||
function(ly_setup_runtime_dependencies_copy_function_override)
|
||||
string(CONFIGURE "${ly_copy_template}" ly_copy_function_linux @ONLY)
|
||||
install(CODE "${ly_copy_function_linux}"
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
|
||||
string(TOUPPER ${conf} UCONF)
|
||||
ly_install(CODE "${ly_copy_function_linux}"
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
)
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
include(cmake/Platform/Common/Install_common.cmake)
|
||||
|
||||
@@ -16,7 +16,7 @@ ly_set(PAL_TRAIT_BUILD_TESTS_SUPPORTED TRUE)
|
||||
ly_set(PAL_TRAIT_BUILD_UNITY_SUPPORTED TRUE)
|
||||
ly_set(PAL_TRAIT_BUILD_UNITY_EXCLUDE_EXTENSIONS)
|
||||
ly_set(PAL_TRAIT_BUILD_EXCLUDE_ALL_TEST_RUNS_FROM_IDE FALSE)
|
||||
ly_set(PAL_TRAIT_BUILD_CPACK_SUPPORTED FALSE)
|
||||
ly_set(PAL_TRAIT_BUILD_CPACK_SUPPORTED TRUE)
|
||||
|
||||
ly_set(PAL_TRAIT_PROF_PIX_SUPPORTED FALSE)
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
set -o errexit # exit on the first failure encountered
|
||||
|
||||
{
|
||||
if [[ ! -f "/usr/lib/x86_64-linux-gnu/libffi.so.6" ]]; then
|
||||
sudo ln -s /usr/lib/x86_64-linux-gnu/libffi.so.7 /usr/lib/x86_64-linux-gnu/libffi.so.6
|
||||
fi
|
||||
|
||||
pushd @CPACK_PACKAGING_INSTALL_PREFIX@
|
||||
python/get_python.sh
|
||||
chown -R $SUDO_USER .
|
||||
popd
|
||||
} &> /dev/null # hide output
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
set -o errexit # exit on the first failure encountered
|
||||
|
||||
{
|
||||
pushd @CPACK_PACKAGING_INSTALL_PREFIX@
|
||||
popd
|
||||
} &> /dev/null # hide output
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
set -o errexit # exit on the first failure encountered
|
||||
|
||||
{
|
||||
# We dont remove this symlink that we potentially created because the user could have
|
||||
# installed themselves.
|
||||
#if [[ -L "/usr/lib/x86_64-linux-gnu/libffi.so.6" ]]; then
|
||||
# sudo rm /usr/lib/x86_64-linux-gnu/libffi.so.6
|
||||
#fi
|
||||
|
||||
pushd @CPACK_PACKAGING_INSTALL_PREFIX@
|
||||
# delete python downloads
|
||||
rm -rf python/downloaded_packages python/runtime
|
||||
popd
|
||||
} &> /dev/null # hide output
|
||||
@@ -0,0 +1,62 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." LY_ROOT_FOLDER)
|
||||
include(${LY_ROOT_FOLDER}/cmake/Platform/Common/PackagingPostBuild_common.cmake)
|
||||
|
||||
file(${CPACK_PACKAGE_CHECKSUM} ${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}.deb file_checksum)
|
||||
file(WRITE ${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}.deb.sha256 "${file_checksum} ${CPACK_PACKAGE_FILE_NAME}.deb")
|
||||
|
||||
if(CPACK_UPLOAD_URL)
|
||||
|
||||
# use the internal default path if somehow not specified from cpack_configure_downloads
|
||||
if(NOT CPACK_UPLOAD_DIRECTORY)
|
||||
set(CPACK_UPLOAD_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}/CPackUploads)
|
||||
endif()
|
||||
|
||||
# Copy the artifacts intended to be uploaded to a remote server into the folder specified
|
||||
# through CPACK_UPLOAD_DIRECTORY. This mimics the same process cpack does natively for
|
||||
# some other frameworks that have built-in online installer support.
|
||||
message(STATUS "Copying packaging artifacts to upload directory...")
|
||||
file(REMOVE_RECURSE ${CPACK_UPLOAD_DIRECTORY})
|
||||
file(GLOB _artifacts
|
||||
"${CPACK_TOPLEVEL_DIRECTORY}/*.deb"
|
||||
"${CPACK_TOPLEVEL_DIRECTORY}/*.sha256"
|
||||
)
|
||||
file(COPY ${_artifacts}
|
||||
DESTINATION ${CPACK_UPLOAD_DIRECTORY}
|
||||
)
|
||||
message(STATUS "Artifacts copied to ${CPACK_UPLOAD_DIRECTORY}")
|
||||
|
||||
# TODO: copy gpg file to CPACK_UPLOAD_DIRECTORY
|
||||
|
||||
ly_upload_to_url(
|
||||
${CPACK_UPLOAD_URL}
|
||||
${CPACK_UPLOAD_DIRECTORY}
|
||||
".*(.deb|.gpg|.sha256)$"
|
||||
)
|
||||
|
||||
# for auto tagged builds, we will also upload a second copy of just the boostrapper
|
||||
# to a special "Latest" folder under the branch in place of the commit date/hash
|
||||
if(CPACK_AUTO_GEN_TAG)
|
||||
|
||||
set(latest_deb_package "${CPACK_UPLOAD_DIRECTORY}/${CPACK_PACKAGE_NAME}_latest.deb")
|
||||
file(COPY_FILE
|
||||
${CPACK_UPLOAD_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}.deb
|
||||
${latest_deb_package}
|
||||
)
|
||||
ly_upload_to_latest(${CPACK_UPLOAD_URL} ${latest_deb_package})
|
||||
|
||||
# TODO: upload gpg file to latest
|
||||
|
||||
# Generate a checksum file for latest and upload it
|
||||
set(latest_hash_file "${CPACK_UPLOAD_DIRECTORY}/${CPACK_PACKAGE_NAME}_latest.deb.sha256")
|
||||
file(WRITE "${latest_hash_file}" "${file_checksum} ${CPACK_PACKAGE_NAME}_latest.deb")
|
||||
ly_upload_to_latest(${CPACK_UPLOAD_URL} "${latest_hash_file}")
|
||||
endif()
|
||||
endif()
|
||||
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." LY_ROOT_FOLDER)
|
||||
include(${LY_ROOT_FOLDER}/cmake/Platform/Common/PackagingPreBuild_common.cmake)
|
||||
|
||||
if(NOT CPACK_UPLOAD_URL) # Skip signing if we are not uploading the package
|
||||
return()
|
||||
endif()
|
||||
|
||||
# TODO: do signing
|
||||
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
set(CPACK_GENERATOR DEB)
|
||||
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/${CPACK_PACKAGE_NAME}/${LY_VERSION_STRING}")
|
||||
|
||||
set(_cmake_package_name "cmake-${CPACK_DESIRED_CMAKE_VERSION}-linux-x86_64")
|
||||
set(CPACK_CMAKE_PACKAGE_FILE "${_cmake_package_name}.tar.gz")
|
||||
set(CPACK_CMAKE_PACKAGE_HASH "3f827544f9c82e74ddf5016461fdfcfea4ede58a26f82612f473bf6bfad8bfc2")
|
||||
|
||||
# get all the package dependencies, extracted from scripts\build\build_node\Platform\Linux\package-list.ubuntu-focal.txt
|
||||
set(package_dependencies
|
||||
libffi7
|
||||
clang-12
|
||||
ninja-build
|
||||
# Build Libraries
|
||||
libglu1-mesa-dev # For Qt (GL dependency)
|
||||
libxcb-xinerama0 # For Qt plugins at runtime
|
||||
libxcb-xinput0 # For Qt plugins at runtime
|
||||
libfontconfig1-dev # For Qt plugins at runtime
|
||||
libcurl4-openssl-dev # For HttpRequestor
|
||||
# libsdl2-dev # for WWise/Audio
|
||||
libxcb-xkb-dev # For xcb keyboard input
|
||||
libxkbcommon-x11-dev # For xcb keyboard input
|
||||
libxkbcommon-dev # For xcb keyboard input
|
||||
libxcb-xfixes0-dev # For mouse input
|
||||
libxcb-xinput-dev # For mouse input
|
||||
zlib1g-dev
|
||||
mesa-common-dev
|
||||
)
|
||||
list(JOIN package_dependencies "," CPACK_DEBIAN_PACKAGE_DEPENDS)
|
||||
|
||||
# Post-installation and pre/post removal scripts
|
||||
configure_file("${LY_ROOT_FOLDER}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/postinst.in"
|
||||
"${CMAKE_BINARY_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/postinst"
|
||||
@ONLY
|
||||
)
|
||||
configure_file("${LY_ROOT_FOLDER}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/prerm.in"
|
||||
"${CMAKE_BINARY_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/prerm"
|
||||
@ONLY
|
||||
)
|
||||
configure_file("${LY_ROOT_FOLDER}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/postrm.in"
|
||||
"${CMAKE_BINARY_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/postrm"
|
||||
@ONLY
|
||||
)
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
||||
${CMAKE_BINARY_DIR}/cmake/Platform/Linux/Packaging/postinst
|
||||
${CMAKE_BINARY_DIR}/cmake/Platform/Linux/Packaging/prerm
|
||||
${CMAKE_BINARY_DIR}/cmake/Platform/Linux/Packaging/postrm
|
||||
)
|
||||
@@ -10,11 +10,19 @@ set(FILES
|
||||
../Common/Configurations_common.cmake
|
||||
../Common/Clang/Configurations_clang.cmake
|
||||
../Common/Install_common.cmake
|
||||
../Common/PackagingPostBuild_common.cmake
|
||||
../Common/PackagingPreBuild_common.cmake
|
||||
CompilerSettings_linux.cmake
|
||||
Configurations_linux.cmake
|
||||
Install_linux.cmake
|
||||
LYTestWrappers_linux.cmake
|
||||
LYWrappers_linux.cmake
|
||||
Packaging_linux.cmake
|
||||
PackagingPostBuild_linux.cmake
|
||||
PackagingPreBuild_linux.cmake
|
||||
PAL_linux.cmake
|
||||
PALDetection_linux.cmake
|
||||
RPathChange.cmake
|
||||
runtime_dependencies_linux.cmake.in
|
||||
RuntimeDependencies_linux.cmake
|
||||
)
|
||||
|
||||
@@ -9,23 +9,33 @@
|
||||
cmake_policy(SET CMP0012 NEW) # new policy for the if that evaluates a boolean out of "if(NOT ${same_location})"
|
||||
|
||||
function(ly_copy source_file target_directory)
|
||||
get_filename_component(target_filename "${source_file}" NAME)
|
||||
get_filename_component(target_filename_ext "${source_file}" LAST_EXT)
|
||||
cmake_path(COMPARE "${source_file}" EQUAL "${target_directory}/${target_filename}" same_location)
|
||||
cmake_path(GET source_file FILENAME target_filename)
|
||||
cmake_path(APPEND target_file "${target_directory}" "${target_filename}")
|
||||
cmake_path(COMPARE "${source_file}" EQUAL "${target_file}" same_location)
|
||||
if(NOT ${same_location})
|
||||
file(LOCK ${target_directory}/${target_filename}.lock GUARD FUNCTION TIMEOUT 300)
|
||||
if("${source_file}" IS_NEWER_THAN "${target_directory}/${target_filename}")
|
||||
file(LOCK ${target_file}.lock GUARD FUNCTION TIMEOUT 300)
|
||||
file(SIZE "${source_file}" source_file_size)
|
||||
if(EXISTS "${target_file}")
|
||||
file(SIZE "${target_file}" target_file_size)
|
||||
else()
|
||||
set(target_file_size 0)
|
||||
endif()
|
||||
if((NOT source_file_size EQUAL target_file_size) OR "${source_file}" IS_NEWER_THAN "${target_file}")
|
||||
message(STATUS "Copying \"${source_file}\" to \"${target_directory}\"...")
|
||||
file(MAKE_DIRECTORY "${full_target_directory}")
|
||||
file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN)
|
||||
|
||||
file(TOUCH_NOCREATE "${target_file}")
|
||||
|
||||
# Special case, shared libraries that are copied from qt/plugins have their RPATH set to \$ORIGIN/../../lib
|
||||
# which is the correct relative path based on the source location. But when we copy it to their subfolder,
|
||||
# the rpath needs to be adjusted to the parent ($ORIGIN/..)
|
||||
if("${source_file}" MATCHES "qt/plugins" AND "${target_filename_ext}" STREQUAL ".so")
|
||||
file(RPATH_CHANGE FILE "${target_directory}/${target_filename}" OLD_RPATH "\$ORIGIN/../../lib" NEW_RPATH "\$ORIGIN/..")
|
||||
file(RPATH_CHANGE FILE "${target_file}" OLD_RPATH "\$ORIGIN/../../lib" NEW_RPATH "\$ORIGIN/..")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
@LY_COPY_COMMANDS@
|
||||
|
||||
file(TOUCH @STAMP_OUTPUT_FILE@)
|
||||
|
||||
@@ -130,27 +130,36 @@ endfunction()
|
||||
|
||||
function(ly_copy source_file target_directory)
|
||||
|
||||
if("${source_file}" MATCHES "\\.[Ff]ramework[^\\.]")
|
||||
if("${source_file}" MATCHES "\\.[Ff]ramework")
|
||||
|
||||
# fixup origin to copy the whole Framework folder
|
||||
string(REGEX REPLACE "(.*\\.[Ff]ramework).*" "\\1" source_file "${source_file}")
|
||||
|
||||
endif()
|
||||
get_filename_component(target_filename "${source_file}" NAME)
|
||||
file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN)
|
||||
|
||||
# Our Qt and Python frameworks aren't in the correct bundle format to be codesigned.
|
||||
if("${target_filename}" MATCHES "(Qt[^.]+)\\.[Ff]ramework")
|
||||
fixup_qt_framework(${CMAKE_MATCH_1} "${target_directory}/${target_filename}")
|
||||
# For some Qt frameworks(QtCore), signing the bundle doesn't work because of bundle
|
||||
# format issues(despite the fixes above). But once we've patched the framework above, there's
|
||||
# only one executable that we need to sign so we can do it directly.
|
||||
set(target_filename "${target_filename}/Versions/5/${CMAKE_MATCH_1}")
|
||||
elseif("${target_filename}" MATCHES "Python.framework")
|
||||
fixup_python_framework("${target_directory}/${target_filename}")
|
||||
codesign_python_framework_binaries("${target_directory}/${target_filename}")
|
||||
cmake_path(GET source_file FILENAME target_filename)
|
||||
cmake_path(APPEND full_target_directory "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}" "${target_directory}")
|
||||
cmake_path(APPEND target_file "${full_target_directory}" "${target_filename}")
|
||||
|
||||
if("${source_file}" IS_NEWER_THAN "${target_file}")
|
||||
message(STATUS "Copying ${source_file} to ${full_target_directory}...")
|
||||
file(MAKE_DIRECTORY "${full_target_directory}")
|
||||
file(COPY "${source_file}" DESTINATION "${full_target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN)
|
||||
file(TOUCH_NOCREATE "${target_file}")
|
||||
|
||||
# Our Qt and Python frameworks aren't in the correct bundle format to be codesigned.
|
||||
if("${target_filename}" MATCHES "(Qt[^.]+)\\.[Ff]ramework")
|
||||
fixup_qt_framework(${CMAKE_MATCH_1} "${target_file}")
|
||||
# For some Qt frameworks(QtCore), signing the bundle doesn't work because of bundle
|
||||
# format issues(despite the fixes above). But once we've patched the framework above, there's
|
||||
# only one executable that we need to sign so we can do it directly.
|
||||
set(target_filename "${target_filename}/Versions/5/${CMAKE_MATCH_1}")
|
||||
elseif("${target_filename}" MATCHES "Python.framework")
|
||||
fixup_python_framework("${target_file}")
|
||||
codesign_python_framework_binaries("${target_file}")
|
||||
endif()
|
||||
codesign_file("${target_file}" "none")
|
||||
endif()
|
||||
codesign_file("${target_directory}/${target_filename}" "none")
|
||||
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -39,10 +39,10 @@ file(GENERATE
|
||||
# This needs to be done here because it needs to update the install prefix
|
||||
# before cmake does anything else in the install process.
|
||||
configure_file(${LY_ROOT_FOLDER}/cmake/Platform/Mac/PreInstallSteps_mac.cmake.in ${CMAKE_BINARY_DIR}/runtime_install/PreInstallSteps_mac.cmake @ONLY)
|
||||
install(SCRIPT ${CMAKE_BINARY_DIR}/runtime_install/PreInstallSteps_mac.cmake COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME})
|
||||
ly_install(SCRIPT ${CMAKE_BINARY_DIR}/runtime_install/PreInstallSteps_mac.cmake COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME})
|
||||
|
||||
#! ly_install_target_override: Mac specific target installation
|
||||
function(ly_install_target_override)
|
||||
#! ly_setup_target_install_targets_override: Mac specific target installation
|
||||
function(ly_setup_target_install_targets_override)
|
||||
|
||||
set(options)
|
||||
set(oneValueArgs TARGET ARCHIVE_DIR LIBRARY_DIR RUNTIME_DIR LIBRARY_SUBDIR RUNTIME_SUBDIR)
|
||||
@@ -58,24 +58,31 @@ function(ly_install_target_override)
|
||||
set_property(TARGET ${ly_platform_install_target_TARGET} PROPERTY RESOURCE "")
|
||||
endif()
|
||||
|
||||
install(
|
||||
TARGETS ${ly_platform_install_target_TARGET}
|
||||
ARCHIVE
|
||||
DESTINATION ${ly_platform_install_target_ARCHIVE_DIR}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
LIBRARY
|
||||
DESTINATION ${ly_platform_install_target_LIBRARY_DIR}/${ly_platform_install_target_LIBRARY_SUBDIR}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
RUNTIME
|
||||
DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${ly_platform_install_target_RUNTIME_SUBDIR}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
BUNDLE
|
||||
DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${ly_platform_install_target_RUNTIME_SUBDIR}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
RESOURCE
|
||||
DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${ly_platform_install_target_RUNTIME_SUBDIR}
|
||||
COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}
|
||||
)
|
||||
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
|
||||
string(TOUPPER ${conf} UCONF)
|
||||
ly_install(TARGETS ${TARGET_NAME}
|
||||
ARCHIVE
|
||||
DESTINATION ${ly_platform_install_target_ARCHIVE_DIR}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
CONFIGURATIONS ${conf}
|
||||
LIBRARY
|
||||
DESTINATION ${ly_platform_install_target_LIBRARY_DIR}/${ly_platform_install_target_LIBRARY_SUBDIR}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
CONFIGURATIONS ${conf}
|
||||
RUNTIME
|
||||
DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${ly_platform_install_target_RUNTIME_SUBDIR}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
CONFIGURATIONS ${conf}
|
||||
BUNDLE
|
||||
DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${ly_platform_install_target_RUNTIME_SUBDIR}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
CONFIGURATIONS ${conf}
|
||||
RESOURCE
|
||||
DESTINATION ${ly_platform_install_target_RUNTIME_DIR}/${ly_platform_install_target_RUNTIME_SUBDIR}
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
CONFIGURATIONS ${conf}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
set(install_relative_binaries_path "${ly_platform_install_target_RUNTIME_DIR}/${ly_platform_install_target_RUNTIME_SUBDIR}")
|
||||
|
||||
@@ -102,11 +109,16 @@ function(ly_install_target_override)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#! ly_install_code_function_override: Mac specific copy function to handle frameworks
|
||||
function(ly_install_code_function_override)
|
||||
#! ly_setup_runtime_dependencies_copy_function_override: Mac specific copy function to handle frameworks
|
||||
function(ly_setup_runtime_dependencies_copy_function_override)
|
||||
|
||||
configure_file(${LY_ROOT_FOLDER}/cmake/Platform/Mac/InstallUtils_mac.cmake.in ${CMAKE_BINARY_DIR}/runtime_install/InstallUtils_mac.cmake @ONLY)
|
||||
ly_install_run_script(${CMAKE_BINARY_DIR}/runtime_install/InstallUtils_mac.cmake)
|
||||
foreach(conf IN LISTS CMAKE_CONFIGURATION_TYPES)
|
||||
string(TOUPPER ${conf} UCONF)
|
||||
ly_install(SCRIPT "${CMAKE_BINARY_DIR}/runtime_install/InstallUtils_mac.cmake"
|
||||
COMPONENT ${LY_INSTALL_PERMUTATION_COMPONENT}_${UCONF}
|
||||
)
|
||||
endforeach()
|
||||
|
||||
endfunction()
|
||||
|
||||
@@ -135,4 +147,3 @@ function(ly_post_install_steps)
|
||||
")
|
||||
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." LY_ROOT_FOLDER)
|
||||
include(${LY_ROOT_FOLDER}/cmake/Platform/Common/PackagingPostBuild_common.cmake)
|
||||
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." LY_ROOT_FOLDER)
|
||||
include(${LY_ROOT_FOLDER}/cmake/Platform/Common/PackagingPreBuild_common.cmake)
|
||||
@@ -34,7 +34,7 @@ endif()
|
||||
|
||||
function(ly_copy source_file target_directory)
|
||||
|
||||
get_filename_component(target_filename "${source_file}" NAME)
|
||||
cmake_path(GET source_file FILENAME target_filename)
|
||||
|
||||
# If target_directory is a bundle
|
||||
if("${target_directory}" MATCHES "\\.app/Contents/MacOS")
|
||||
@@ -113,20 +113,37 @@ function(ly_copy source_file target_directory)
|
||||
|
||||
endif()
|
||||
|
||||
cmake_path(COMPARE "${source_file}" EQUAL "${target_directory}/${target_filename}" same_location)
|
||||
cmake_path(APPEND target_file "${target_directory}" "${target_filename}")
|
||||
cmake_path(COMPARE "${source_file}" EQUAL "${target_file}" same_location)
|
||||
if(NOT ${same_location})
|
||||
if(NOT EXISTS "${target_directory}")
|
||||
file(MAKE_DIRECTORY "${target_directory}")
|
||||
endif()
|
||||
if(NOT EXISTS "${target_directory}/${target_filename}" OR "${source_file}" IS_NEWER_THAN "${target_directory}/${target_filename}")
|
||||
message(STATUS "Copying \"${source_file}\" to \"${target_directory}\"...")
|
||||
if(NOT target_is_bundle)
|
||||
# if it is a bundle, there is no contention about the files in the destination, each bundle target will copy everything
|
||||
# we dont want these files to invalidate the bundle and cause a new signature
|
||||
file(LOCK ${target_directory}/${target_filename}.lock GUARD FUNCTION TIMEOUT 300)
|
||||
|
||||
set(is_framework FALSE)
|
||||
if("${source_file}" MATCHES "\\.[Ff]ramework")
|
||||
set(is_framework TRUE)
|
||||
endif()
|
||||
if(NOT is_framework)
|
||||
# if it is a bundle, there is no contention about the files in the destination, each bundle target will copy everything
|
||||
# we dont want these files to invalidate the bundle and cause a new signature
|
||||
file(LOCK ${target_file}.lock GUARD FUNCTION TIMEOUT 300)
|
||||
file(SIZE "${source_file}" source_file_size)
|
||||
if(EXISTS "${target_file}")
|
||||
file(SIZE "${target_file}" target_file_size)
|
||||
else()
|
||||
set(target_file_size 0)
|
||||
endif()
|
||||
else()
|
||||
set(source_file_size 0)
|
||||
set(target_file_size 0)
|
||||
endif()
|
||||
|
||||
if((NOT source_file_size EQUAL target_file_size) OR "${source_file}" IS_NEWER_THAN "${target_file}")
|
||||
message(STATUS "Copying \"${source_file}\" to \"${target_directory}\"...")
|
||||
file(MAKE_DIRECTORY "${target_directory}")
|
||||
file(COPY "${source_file}" DESTINATION "${target_directory}" FILE_PERMISSIONS @LY_COPY_PERMISSIONS@ FOLLOW_SYMLINK_CHAIN)
|
||||
file(TOUCH_NOCREATE ${target_directory}/${target_filename})
|
||||
file(TOUCH_NOCREATE "${target_file}")
|
||||
set(anything_new TRUE PARENT_SCOPE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -1,237 +0,0 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
# convert the path to a windows style path using string replace because TO_NATIVE_PATH
|
||||
# only works on real paths
|
||||
string(REPLACE "/" "\\" _fixed_package_install_dir ${CPACK_PACKAGE_INSTALL_DIRECTORY})
|
||||
|
||||
# directory where the auto generated files live e.g <build>/_CPack_Package/win64/WIX
|
||||
set(_cpack_wix_out_dir ${CPACK_TOPLEVEL_DIRECTORY})
|
||||
set(_bootstrap_out_dir "${CPACK_TOPLEVEL_DIRECTORY}/bootstrap")
|
||||
|
||||
set(_bootstrap_filename "${CPACK_PACKAGE_FILE_NAME}_installer.exe")
|
||||
set(_bootstrap_output_file ${_cpack_wix_out_dir}/${_bootstrap_filename})
|
||||
|
||||
set(_ext_flags
|
||||
-ext WixBalExtension
|
||||
)
|
||||
|
||||
set(_addtional_defines
|
||||
-dCPACK_BOOTSTRAP_THEME_FILE=${CPACK_BINARY_DIR}/BootstrapperTheme
|
||||
-dCPACK_BOOTSTRAP_UPGRADE_GUID=${CPACK_WIX_BOOTSTRAP_UPGRADE_GUID}
|
||||
-dCPACK_DOWNLOAD_SITE=${CPACK_DOWNLOAD_SITE}
|
||||
-dCPACK_LOCAL_INSTALLER_DIR=${_cpack_wix_out_dir}
|
||||
-dCPACK_PACKAGE_FILE_NAME=${CPACK_PACKAGE_FILE_NAME}
|
||||
-dCPACK_PACKAGE_INSTALL_DIRECTORY=${_fixed_package_install_dir}
|
||||
-dCPACK_WIX_PRODUCT_LOGO=${CPACK_WIX_PRODUCT_LOGO}
|
||||
-dCPACK_RESOURCE_PATH=${CPACK_SOURCE_DIR}/Platform/Windows/Packaging
|
||||
)
|
||||
|
||||
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." _root_path)
|
||||
file(TO_NATIVE_PATH "${_root_path}/scripts/signer/Platform/Windows/signer.ps1" _sign_script)
|
||||
|
||||
if(CPACK_LICENSE_URL)
|
||||
list(APPEND _addtional_defines -dCPACK_LICENSE_URL=${CPACK_LICENSE_URL})
|
||||
endif()
|
||||
|
||||
set(_candle_command
|
||||
${CPACK_WIX_CANDLE_EXECUTABLE}
|
||||
-nologo
|
||||
-arch x64
|
||||
"-I${_cpack_wix_out_dir}" # to include cpack_variables.wxi
|
||||
${_addtional_defines}
|
||||
${_ext_flags}
|
||||
"${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/Bootstrapper.wxs"
|
||||
-o "${_bootstrap_out_dir}/"
|
||||
)
|
||||
|
||||
set(_light_command
|
||||
${CPACK_WIX_LIGHT_EXECUTABLE}
|
||||
-nologo
|
||||
${_ext_flags}
|
||||
${_bootstrap_out_dir}/*.wixobj
|
||||
-o "${_bootstrap_output_file}"
|
||||
)
|
||||
|
||||
set(_signing_command
|
||||
psexec.exe
|
||||
-accepteula
|
||||
-nobanner
|
||||
-s
|
||||
powershell.exe
|
||||
-NoLogo
|
||||
-ExecutionPolicy Bypass
|
||||
-File ${_sign_script}
|
||||
)
|
||||
|
||||
message(STATUS "Signing package files in ${_cpack_wix_out_dir}")
|
||||
execute_process(
|
||||
COMMAND ${_signing_command} -packagePath ${_cpack_wix_out_dir}
|
||||
RESULT_VARIABLE _signing_result
|
||||
ERROR_VARIABLE _signing_errors
|
||||
OUTPUT_VARIABLE _signing_output
|
||||
ECHO_OUTPUT_VARIABLE
|
||||
)
|
||||
|
||||
if(NOT ${_signing_result} EQUAL 0)
|
||||
message(FATAL_ERROR "An error occurred during signing package files. ${_signing_errors}")
|
||||
endif()
|
||||
|
||||
message(STATUS "Creating Bootstrap Installer...")
|
||||
execute_process(
|
||||
COMMAND ${_candle_command}
|
||||
RESULT_VARIABLE _candle_result
|
||||
ERROR_VARIABLE _candle_errors
|
||||
)
|
||||
if(NOT ${_candle_result} EQUAL 0)
|
||||
message(FATAL_ERROR "An error occurred invoking candle.exe. ${_candle_errors}")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_light_command}
|
||||
RESULT_VARIABLE _light_result
|
||||
ERROR_VARIABLE _light_errors
|
||||
)
|
||||
if(NOT ${_light_result} EQUAL 0)
|
||||
message(FATAL_ERROR "An error occurred invoking light.exe. ${_light_errors}")
|
||||
endif()
|
||||
|
||||
file(COPY ${_bootstrap_output_file}
|
||||
DESTINATION ${CPACK_PACKAGE_DIRECTORY}
|
||||
)
|
||||
|
||||
message(STATUS "Bootstrap installer generated to ${CPACK_PACKAGE_DIRECTORY}/${_bootstrap_filename}")
|
||||
|
||||
message(STATUS "Signing bootstrap installer in ${CPACK_PACKAGE_DIRECTORY}")
|
||||
execute_process(
|
||||
COMMAND ${_signing_command} -bootstrapPath ${CPACK_PACKAGE_DIRECTORY}/${_bootstrap_filename}
|
||||
RESULT_VARIABLE _signing_result
|
||||
ERROR_VARIABLE _signing_errors
|
||||
OUTPUT_VARIABLE _signing_output
|
||||
ECHO_OUTPUT_VARIABLE
|
||||
)
|
||||
|
||||
if(NOT ${_signing_result} EQUAL 0)
|
||||
message(FATAL_ERROR "An error occurred during signing bootstrap installer. ${_signing_errors}")
|
||||
endif()
|
||||
|
||||
# use the internal default path if somehow not specified from cpack_configure_downloads
|
||||
if(NOT CPACK_UPLOAD_DIRECTORY)
|
||||
set(CPACK_UPLOAD_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}/CPackUploads)
|
||||
endif()
|
||||
|
||||
# copy the artifacts intended to be uploaded to a remote server into the folder specified
|
||||
# through cpack_configure_downloads. this mimics the same process cpack does natively for
|
||||
# some other frameworks that have built-in online installer support.
|
||||
message(STATUS "Copying installer artifacts to upload directory...")
|
||||
file(REMOVE_RECURSE ${CPACK_UPLOAD_DIRECTORY})
|
||||
file(GLOB _artifacts "${_cpack_wix_out_dir}/*.msi" "${_cpack_wix_out_dir}/*.cab")
|
||||
file(COPY ${_artifacts}
|
||||
DESTINATION ${CPACK_UPLOAD_DIRECTORY}
|
||||
)
|
||||
message(STATUS "Artifacts copied to ${CPACK_UPLOAD_DIRECTORY}")
|
||||
|
||||
if(NOT CPACK_UPLOAD_URL)
|
||||
return()
|
||||
endif()
|
||||
|
||||
file(TO_NATIVE_PATH "${_cpack_wix_out_dir}" _cpack_wix_out_dir)
|
||||
file(TO_NATIVE_PATH "${_root_path}/python/python.cmd" _python_cmd)
|
||||
file(TO_NATIVE_PATH "${_root_path}/scripts/build/tools/upload_to_s3.py" _upload_script)
|
||||
|
||||
function(upload_to_s3 in_url in_local_path in_file_regex)
|
||||
|
||||
# strip the scheme and extract the bucket/key prefix from the URL
|
||||
string(REPLACE "s3://" "" _stripped_url ${in_url})
|
||||
string(REPLACE "/" ";" _tokens ${_stripped_url})
|
||||
|
||||
list(POP_FRONT _tokens _bucket)
|
||||
string(JOIN "/" _prefix ${_tokens})
|
||||
|
||||
set(_extra_args [[{"ACL":"bucket-owner-full-control"}]])
|
||||
|
||||
set(_upload_command
|
||||
${_python_cmd} -s
|
||||
-u ${_upload_script}
|
||||
--base_dir ${in_local_path}
|
||||
--file_regex="${in_file_regex}"
|
||||
--bucket ${_bucket}
|
||||
--key_prefix ${_prefix}
|
||||
--extra_args ${_extra_args}
|
||||
)
|
||||
|
||||
if(CPACK_AWS_PROFILE)
|
||||
list(APPEND _upload_command --profile ${CPACK_AWS_PROFILE})
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_upload_command}
|
||||
RESULT_VARIABLE _upload_result
|
||||
OUTPUT_VARIABLE _upload_output
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if (NOT ${_upload_result} EQUAL 0)
|
||||
message(FATAL_ERROR "An error occurred uploading to s3.\nOutput:\n${_upload_output}")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
message(STATUS "Uploading artifacts to ${CPACK_UPLOAD_URL}")
|
||||
upload_to_s3(
|
||||
${CPACK_UPLOAD_URL}
|
||||
${_cpack_wix_out_dir}
|
||||
".*(cab|exe|msi)$"
|
||||
)
|
||||
message(STATUS "Artifact uploading complete!")
|
||||
|
||||
# for auto tagged builds, we will also upload a second copy of just the boostrapper
|
||||
# to a special "Latest" folder under the branch in place of the commit date/hash
|
||||
if(CPACK_AUTO_GEN_TAG)
|
||||
message(STATUS "Updating latest tagged build")
|
||||
|
||||
# make sure we can extra the commit info from the URL first
|
||||
string(REGEX MATCH "([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9a-zA-Z]+)"
|
||||
_commit_info ${CPACK_UPLOAD_URL}
|
||||
)
|
||||
if(NOT _commit_info)
|
||||
message(FATAL_ERROR "Failed to extract the build tag")
|
||||
endif()
|
||||
|
||||
set(_temp_dir ${_cpack_wix_out_dir}/temp)
|
||||
if(NOT EXISTS ${_temp_dir})
|
||||
file(MAKE_DIRECTORY ${_temp_dir})
|
||||
endif()
|
||||
|
||||
# strip the version number form the exe name in the one uploaded to latest
|
||||
string(TOLOWER "${CPACK_PACKAGE_NAME}_installer.exe" _non_versioned_exe)
|
||||
set(_temp_exe_copy ${_temp_dir}/${_non_versioned_exe})
|
||||
|
||||
file(COPY ${_bootstrap_output_file} DESTINATION ${_temp_dir})
|
||||
file(RENAME "${_temp_dir}/${_bootstrap_filename}" ${_temp_exe_copy})
|
||||
|
||||
# include the commit info in a text file that will live next to the exe
|
||||
set(_temp_info_file ${_temp_dir}/build_tag.txt)
|
||||
file(WRITE ${_temp_info_file} ${_commit_info})
|
||||
|
||||
# update the URL and upload
|
||||
string(REPLACE
|
||||
${_commit_info} "Latest"
|
||||
_latest_upload_url ${CPACK_UPLOAD_URL}
|
||||
)
|
||||
|
||||
upload_to_s3(
|
||||
${_latest_upload_url}
|
||||
${_temp_dir}
|
||||
".*(${_non_versioned_exe}|build_tag.txt)$"
|
||||
)
|
||||
|
||||
# cleanup the temp files
|
||||
file(REMOVE_RECURSE ${_temp_dir})
|
||||
|
||||
message(STATUS "Latest build update complete!")
|
||||
endif()
|
||||
@@ -0,0 +1,166 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." LY_ROOT_FOLDER)
|
||||
include(${LY_ROOT_FOLDER}/cmake/Platform/Common/PackagingPostBuild_common.cmake)
|
||||
|
||||
# convert the path to a windows style path using string replace because TO_NATIVE_PATH
|
||||
# only works on real paths
|
||||
string(REPLACE "/" "\\" _fixed_package_install_dir ${CPACK_PACKAGE_INSTALL_DIRECTORY})
|
||||
|
||||
# directory where the auto generated files live e.g <build>/_CPack_Package/win64/WIX
|
||||
set(_cpack_wix_out_dir ${CPACK_TOPLEVEL_DIRECTORY})
|
||||
set(_bootstrap_out_dir "${CPACK_TOPLEVEL_DIRECTORY}/bootstrap")
|
||||
|
||||
set(_bootstrap_filename "${CPACK_PACKAGE_FILE_NAME}_installer.exe")
|
||||
set(_bootstrap_output_file ${_cpack_wix_out_dir}/${_bootstrap_filename})
|
||||
|
||||
set(_ext_flags
|
||||
-ext WixBalExtension
|
||||
)
|
||||
|
||||
set(_addtional_defines
|
||||
-dCPACK_BOOTSTRAP_THEME_FILE=${CPACK_BINARY_DIR}/BootstrapperTheme
|
||||
-dCPACK_BOOTSTRAP_UPGRADE_GUID=${CPACK_WIX_BOOTSTRAP_UPGRADE_GUID}
|
||||
-dCPACK_DOWNLOAD_SITE=${CPACK_DOWNLOAD_SITE}
|
||||
-dCPACK_LOCAL_INSTALLER_DIR=${_cpack_wix_out_dir}
|
||||
-dCPACK_PACKAGE_FILE_NAME=${CPACK_PACKAGE_FILE_NAME}
|
||||
-dCPACK_PACKAGE_INSTALL_DIRECTORY=${_fixed_package_install_dir}
|
||||
-dCPACK_WIX_PRODUCT_LOGO=${CPACK_WIX_PRODUCT_LOGO}
|
||||
-dCPACK_RESOURCE_PATH=${CPACK_SOURCE_DIR}/Platform/Windows/Packaging
|
||||
)
|
||||
|
||||
if(CPACK_LICENSE_URL)
|
||||
list(APPEND _addtional_defines -dCPACK_LICENSE_URL=${CPACK_LICENSE_URL})
|
||||
endif()
|
||||
|
||||
set(_candle_command
|
||||
${CPACK_WIX_CANDLE_EXECUTABLE}
|
||||
-nologo
|
||||
-arch x64
|
||||
"-I${_cpack_wix_out_dir}" # to include cpack_variables.wxi
|
||||
${_addtional_defines}
|
||||
${_ext_flags}
|
||||
"${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/Bootstrapper.wxs"
|
||||
-o "${_bootstrap_out_dir}/"
|
||||
)
|
||||
|
||||
set(_light_command
|
||||
${CPACK_WIX_LIGHT_EXECUTABLE}
|
||||
-nologo
|
||||
${_ext_flags}
|
||||
${_bootstrap_out_dir}/*.wixobj
|
||||
-o "${_bootstrap_output_file}"
|
||||
)
|
||||
|
||||
if(CPACK_UPLOAD_URL) # Skip signing if we are not uploading the package
|
||||
file(TO_NATIVE_PATH "${LY_ROOT_FOLDER}/scripts/signer/Platform/Windows/signer.ps1" _sign_script)
|
||||
|
||||
unset(_signing_command)
|
||||
find_program(_psiexec_path psexec.exe)
|
||||
if(_psiexec_path)
|
||||
list(APPEND _signing_command
|
||||
${_psiexec_path}
|
||||
-accepteula
|
||||
-nobanner
|
||||
-s
|
||||
)
|
||||
endif()
|
||||
|
||||
find_program(_powershell_path powershell.exe REQUIRED)
|
||||
list(APPEND _signing_command
|
||||
${_powershell_path}
|
||||
-NoLogo
|
||||
-ExecutionPolicy Bypass
|
||||
-File ${_sign_script}
|
||||
)
|
||||
|
||||
message(STATUS "Signing package files in ${_cpack_wix_out_dir}")
|
||||
execute_process(
|
||||
COMMAND ${_signing_command} -packagePath ${_cpack_wix_out_dir}
|
||||
RESULT_VARIABLE _signing_result
|
||||
ERROR_VARIABLE _signing_errors
|
||||
OUTPUT_VARIABLE _signing_output
|
||||
ECHO_OUTPUT_VARIABLE
|
||||
)
|
||||
|
||||
if(NOT ${_signing_result} EQUAL 0)
|
||||
message(FATAL_ERROR "An error occurred during signing package files. ${_signing_errors}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "Creating Bootstrap Installer...")
|
||||
execute_process(
|
||||
COMMAND ${_candle_command}
|
||||
RESULT_VARIABLE _candle_result
|
||||
ERROR_VARIABLE _candle_errors
|
||||
)
|
||||
if(NOT ${_candle_result} EQUAL 0)
|
||||
message(FATAL_ERROR "An error occurred invoking candle.exe. ${_candle_errors}")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${_light_command}
|
||||
RESULT_VARIABLE _light_result
|
||||
ERROR_VARIABLE _light_errors
|
||||
)
|
||||
if(NOT ${_light_result} EQUAL 0)
|
||||
message(FATAL_ERROR "An error occurred invoking light.exe. ${_light_errors}")
|
||||
endif()
|
||||
|
||||
message(STATUS "Bootstrap installer generated to ${_bootstrap_output_file}")
|
||||
|
||||
if(CPACK_UPLOAD_URL) # Skip signing if we are not uploading the package
|
||||
message(STATUS "Signing bootstrap installer in ${_bootstrap_output_file}")
|
||||
execute_process(
|
||||
COMMAND ${_signing_command} -bootstrapPath ${_bootstrap_output_file}
|
||||
RESULT_VARIABLE _signing_result
|
||||
ERROR_VARIABLE _signing_errors
|
||||
OUTPUT_VARIABLE _signing_output
|
||||
ECHO_OUTPUT_VARIABLE
|
||||
)
|
||||
|
||||
if(NOT ${_signing_result} EQUAL 0)
|
||||
message(FATAL_ERROR "An error occurred during signing bootstrap installer. ${_signing_errors}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# use the internal default path if somehow not specified from cpack_configure_downloads
|
||||
if(NOT CPACK_UPLOAD_DIRECTORY)
|
||||
set(CPACK_UPLOAD_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}/CPackUploads)
|
||||
endif()
|
||||
|
||||
# Copy the artifacts intended to be uploaded to a remote server into the folder specified
|
||||
# through CPACK_UPLOAD_DIRECTORY. This mimics the same process cpack does natively for
|
||||
# some other frameworks that have built-in online installer support.
|
||||
message(STATUS "Copying packaging artifacts to upload directory...")
|
||||
file(REMOVE_RECURSE ${CPACK_UPLOAD_DIRECTORY})
|
||||
file(GLOB _artifacts
|
||||
"${_cpack_wix_out_dir}/*.msi"
|
||||
"${_cpack_wix_out_dir}/*.cab"
|
||||
"${_cpack_wix_out_dir}/*.exe"
|
||||
)
|
||||
file(COPY ${_artifacts}
|
||||
DESTINATION ${CPACK_UPLOAD_DIRECTORY}
|
||||
)
|
||||
message(STATUS "Artifacts copied to ${CPACK_UPLOAD_DIRECTORY}")
|
||||
|
||||
if(CPACK_UPLOAD_URL)
|
||||
file(TO_NATIVE_PATH "${_cpack_wix_out_dir}" _cpack_wix_out_dir)
|
||||
ly_upload_to_url(
|
||||
${CPACK_UPLOAD_URL}
|
||||
${_cpack_wix_out_dir}
|
||||
".*(cab|exe|msi)$"
|
||||
)
|
||||
|
||||
# for auto tagged builds, we will also upload a second copy of just the boostrapper
|
||||
# to a special "Latest" folder under the branch in place of the commit date/hash
|
||||
if(CPACK_AUTO_GEN_TAG)
|
||||
ly_upload_to_latest(${CPACK_UPLOAD_URL} ${_bootstrap_output_file})
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,37 +0,0 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." _root_path)
|
||||
set(_cpack_wix_out_dir ${CPACK_TOPLEVEL_DIRECTORY})
|
||||
file(TO_NATIVE_PATH "${_root_path}/scripts/signer/Platform/Windows/signer.ps1" _sign_script)
|
||||
|
||||
set(_signing_command
|
||||
psexec.exe
|
||||
-accepteula
|
||||
-nobanner
|
||||
-s
|
||||
powershell.exe
|
||||
-NoLogo
|
||||
-ExecutionPolicy Bypass
|
||||
-File ${_sign_script}
|
||||
)
|
||||
|
||||
message(STATUS "Signing executable files in ${_cpack_wix_out_dir}")
|
||||
execute_process(
|
||||
COMMAND ${_signing_command} -exePath ${_cpack_wix_out_dir}
|
||||
RESULT_VARIABLE _signing_result
|
||||
ERROR_VARIABLE _signing_errors
|
||||
OUTPUT_VARIABLE _signing_output
|
||||
ECHO_OUTPUT_VARIABLE
|
||||
)
|
||||
|
||||
if(NOT ${_signing_result} EQUAL 0)
|
||||
message(FATAL_ERROR "An error occurred during signing executable files. ${_signing_errors}")
|
||||
endif()
|
||||
|
||||
message(STATUS "Signing exes complete!")
|
||||
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
#
|
||||
#
|
||||
|
||||
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." LY_ROOT_FOLDER)
|
||||
include(${LY_ROOT_FOLDER}/cmake/Platform/Common/PackagingPreBuild_common.cmake)
|
||||
|
||||
if(NOT CPACK_UPLOAD_URL) # Skip signing if we are not uploading the package
|
||||
return()
|
||||
endif()
|
||||
|
||||
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." _root_path)
|
||||
set(_cpack_wix_out_dir ${CPACK_TOPLEVEL_DIRECTORY})
|
||||
file(TO_NATIVE_PATH "${_root_path}/scripts/signer/Platform/Windows/signer.ps1" _sign_script)
|
||||
|
||||
unset(_signing_command)
|
||||
find_program(_psiexec_path psexec.exe)
|
||||
if(_psiexec_path)
|
||||
list(APPEND _signing_command
|
||||
${_psiexec_path}
|
||||
-accepteula
|
||||
-nobanner
|
||||
-s
|
||||
)
|
||||
endif()
|
||||
|
||||
find_program(_powershell_path powershell.exe REQUIRED)
|
||||
list(APPEND _signing_command
|
||||
${_powershell_path}
|
||||
-NoLogo
|
||||
-ExecutionPolicy Bypass
|
||||
-File ${_sign_script}
|
||||
)
|
||||
|
||||
# This requires to have a valid local certificate. In continuous integration, these certificates are stored
|
||||
# in the machine directly.
|
||||
# You can generate a test certificate to be able to run this in a PowerShell elevated promp with:
|
||||
# New-SelfSignedCertificate -DnsName foo.o3de.com -Type CodeSigning -CertStoreLocation Cert:\CurrentUser\My
|
||||
# Export-Certificate -Cert (Get-ChildItem Cert:\CurrentUser\My\<cert thumbprint>) -Filepath "c:\selfsigned.crt"
|
||||
# Import-Certificate -FilePath "c:\selfsigned.crt" -Cert Cert:\CurrentUser\TrustedPublisher
|
||||
# Import-Certificate -FilePath "c:\selfsigned.crt" -Cert Cert:\CurrentUser\Root
|
||||
|
||||
message(STATUS "Signing executable files in ${_cpack_wix_out_dir}")
|
||||
execute_process(
|
||||
COMMAND ${_signing_command} -exePath ${_cpack_wix_out_dir}
|
||||
RESULT_VARIABLE _signing_result
|
||||
ERROR_VARIABLE _signing_errors
|
||||
OUTPUT_VARIABLE _signing_output
|
||||
ECHO_OUTPUT_VARIABLE
|
||||
)
|
||||
|
||||
if(NOT ${_signing_result} EQUAL 0)
|
||||
message(FATAL_ERROR "An error occurred during signing executable files. ${_signing_errors}")
|
||||
else()
|
||||
message(STATUS "Signing exes complete!")
|
||||
endif()
|
||||
@@ -23,16 +23,12 @@ set(CPACK_WIX_ROOT ${LY_INSTALLER_WIX_ROOT})
|
||||
|
||||
set(CPACK_GENERATOR WIX)
|
||||
|
||||
set(CPACK_THREADS 0)
|
||||
set(_cmake_package_name "cmake-${CPACK_DESIRED_CMAKE_VERSION}-windows-x86_64")
|
||||
set(CPACK_CMAKE_PACKAGE_FILE "${_cmake_package_name}.zip")
|
||||
set(CPACK_CMAKE_PACKAGE_HASH "15a49e2ab81c1822d75b1b1a92f7863f58e31f6d6aac1c4103eef2b071be3112")
|
||||
|
||||
# workaround for shortening the path cpack installs to by stripping the platform directory and forcing monolithic
|
||||
# mode to strip out component folders. this unfortunately is the closest we can get to changing the install location
|
||||
# as CPACK_PACKAGING_INSTALL_PREFIX/CPACK_SET_DESTDIR isn't supported for the WiX generator
|
||||
# workaround for shortening the path cpack installs to by stripping the platform directory
|
||||
set(CPACK_TOPLEVEL_TAG "")
|
||||
set(CPACK_MONOLITHIC_INSTALL ON)
|
||||
|
||||
# CPack will generate the WiX product/upgrade GUIDs further down the chain if they weren't supplied
|
||||
# however, they are unique for each run. instead, let's do the auto generation here and add it to
|
||||
@@ -108,45 +104,35 @@ set(_raw_text_license [[
|
||||
<Text Name="EulaAcceptance" X="42" Y="-56" Width="-42" Height="18" TabStop="yes" FontId="1" HideWhenDisabled="yes">#(loc.InstallEulaAcceptance)</Text>
|
||||
]])
|
||||
|
||||
if(LY_INSTALLER_DOWNLOAD_URL)
|
||||
set(WIX_THEME_WARNING_IMAGE ${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/warning.png)
|
||||
set(WIX_THEME_WARNING_IMAGE ${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/warning.png)
|
||||
|
||||
if(LY_INSTALLER_LICENSE_URL)
|
||||
set(WIX_THEME_INSTALL_LICENSE_ELEMENTS ${_hyperlink_license})
|
||||
set(WIX_THEME_EULA_ACCEPTANCE_TEXT "<a href=\"#\">Terms of Use</a>")
|
||||
else()
|
||||
set(WIX_THEME_INSTALL_LICENSE_ELEMENTS ${_raw_text_license})
|
||||
set(WIX_THEME_EULA_ACCEPTANCE_TEXT "Terms of Use above")
|
||||
endif()
|
||||
|
||||
# theme ux file
|
||||
configure_file(
|
||||
"${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/BootstrapperTheme.xml.in"
|
||||
"${CPACK_BINARY_DIR}/BootstrapperTheme.xml"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# theme localization file
|
||||
configure_file(
|
||||
"${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/BootstrapperTheme.wxl.in"
|
||||
"${CPACK_BINARY_DIR}/BootstrapperTheme.wxl"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
set(_embed_artifacts "no")
|
||||
|
||||
# the bootstrapper will at the very least need a different upgrade guid
|
||||
generate_wix_guid(CPACK_WIX_BOOTSTRAP_UPGRADE_GUID "${_guid_seed_base}_Bootstrap_UpgradeCode")
|
||||
|
||||
set(CPACK_PRE_BUILD_SCRIPTS
|
||||
${CPACK_SOURCE_DIR}/Platform/Windows/PackagingPreBuild.cmake
|
||||
)
|
||||
|
||||
set(CPACK_POST_BUILD_SCRIPTS
|
||||
${CPACK_SOURCE_DIR}/Platform/Windows/PackagingPostBuild.cmake
|
||||
)
|
||||
if(LY_INSTALLER_LICENSE_URL)
|
||||
set(WIX_THEME_INSTALL_LICENSE_ELEMENTS ${_hyperlink_license})
|
||||
set(WIX_THEME_EULA_ACCEPTANCE_TEXT "<a href=\"#\">Terms of Use</a>")
|
||||
else()
|
||||
set(WIX_THEME_INSTALL_LICENSE_ELEMENTS ${_raw_text_license})
|
||||
set(WIX_THEME_EULA_ACCEPTANCE_TEXT "Terms of Use above")
|
||||
endif()
|
||||
|
||||
# theme ux file
|
||||
configure_file(
|
||||
"${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/BootstrapperTheme.xml.in"
|
||||
"${CPACK_BINARY_DIR}/BootstrapperTheme.xml"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
# theme localization file
|
||||
configure_file(
|
||||
"${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/BootstrapperTheme.wxl.in"
|
||||
"${CPACK_BINARY_DIR}/BootstrapperTheme.wxl"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
set(_embed_artifacts "no")
|
||||
|
||||
# the bootstrapper will at the very least need a different upgrade guid
|
||||
generate_wix_guid(CPACK_WIX_BOOTSTRAP_UPGRADE_GUID "${_guid_seed_base}_Bootstrap_UpgradeCode")
|
||||
|
||||
set(CPACK_WIX_CANDLE_EXTRA_FLAGS
|
||||
-dCPACK_EMBED_ARTIFACTS=${_embed_artifacts}
|
||||
-dCPACK_CMAKE_PACKAGE_NAME=${_cmake_package_name}
|
||||
|
||||
@@ -15,6 +15,8 @@ set(FILES
|
||||
../Common/MSVC/VisualStudio_common.cmake
|
||||
../Common/Install_common.cmake
|
||||
../Common/LYWrappers_default.cmake
|
||||
../Common/PackagingPostBuild_common.cmake
|
||||
../Common/PackagingPreBuild_common.cmake
|
||||
../Common/TargetIncludeSystemDirectories_unsupported.cmake
|
||||
Configurations_windows.cmake
|
||||
LYTestWrappers_windows.cmake
|
||||
@@ -23,7 +25,8 @@ set(FILES
|
||||
PALDetection_windows.cmake
|
||||
Install_windows.cmake
|
||||
Packaging_windows.cmake
|
||||
PackagingPostBuild.cmake
|
||||
PackagingPostBuild_windows.cmake
|
||||
PackagingPreBuild_windows.cmake
|
||||
Packaging/Bootstrapper.wxs
|
||||
Packaging/BootstrapperTheme.wxl.in
|
||||
Packaging/BootstrapperTheme.xml.in
|
||||
|
||||
Reference in New Issue
Block a user