|
|
|
@@ -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()
|
|
|
|
|