Updating the engine.json.in template for the cmake INSTALL target to add the list of external subdirectories to allow the installed layout to access the subdirectories via it's engine.json file

main
lumberyard-employee-dm 5 years ago
parent 911ad84e53
commit b99bcea24a

@ -13,6 +13,8 @@
include_guard()
set(LY_EXTERNAL_SUBDIRS "" CACHE STRING "List of subdirectories to recurse into when running cmake against the engine's CMakeLists.txt")
#! read_engine_external_subdirs
# Read the external subdirectories from the engine.json file
# External subdirectories are any folders with CMakeLists.txt in them

@ -224,6 +224,16 @@ function(ly_setup_cmake_install)
REGEX "Platform\/.*\/BuiltInPackages_.*\.cmake" EXCLUDE
)
# Transform the LY_EXTERNAL_SUBDIRS list into a json array
set(LY_INSTALL_EXTERNAL_SUBDIRS "[]")
set(external_subdir_index "0")
foreach(external_subdir ${LY_EXTERNAL_SUBDIRS})
math(EXPR external_subdir_index "${external_subdir_index} + 1")
file(RELATIVE_PATH engine_rel_external_subdir ${LY_ROOT_FOLDER} ${external_subdir})
string(JSON LY_INSTALL_EXTERNAL_SUBDIRS ERROR_VARIABLE external_subdir_error SET ${LY_INSTALL_EXTERNAL_SUBDIRS}
${external_subdir_index} "\"${engine_rel_external_subdir}\"")
endforeach()
configure_file(${LY_ROOT_FOLDER}/cmake/install/engine.json.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/engine.json @ONLY)
install(

@ -1,8 +1,11 @@
{
"engine_name": "@LY_VERSION_ENGINE_NAME@",
"restricted": "o3de",
"restricted_name": "o3de",
"FileVersion": 1,
"O3DEVersion": "@LY_VERSION_STRING@",
"O3DECopyrightYear": @LY_VERSION_COPYRIGHT_YEAR@,
"O3DEBuildNumber": @LY_VERSION_BUILD_NUMBER@
"O3DEBuildNumber": @LY_VERSION_BUILD_NUMBER@,
"external_subdirectories": @LY_INSTALL_EXTERNAL_SUBDIRS@,
"projects": [@LY_INSTALL_PROJECTS@],
"templates": [@LY_INSTALL_TEMPLATES@]
}

Loading…
Cancel
Save