diff --git a/cmake/EngineJson.cmake b/cmake/EngineJson.cmake index 9a82d4a2c5..c3ab29d09e 100644 --- a/cmake/EngineJson.cmake +++ b/cmake/EngineJson.cmake @@ -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 diff --git a/cmake/Platform/Common/Install_common.cmake b/cmake/Platform/Common/Install_common.cmake index ebe31a4cfa..b8202a1314 100644 --- a/cmake/Platform/Common/Install_common.cmake +++ b/cmake/Platform/Common/Install_common.cmake @@ -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( diff --git a/cmake/install/engine.json.in b/cmake/install/engine.json.in index 4a8579d864..1cfb1826ce 100644 --- a/cmake/install/engine.json.in +++ b/cmake/install/engine.json.in @@ -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@] }