From 14337a185fa92ff8dd20548a56a02f6aee6654bb Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Fri, 30 Oct 2026 09:57:19 +0100 Subject: [PATCH] [builtins] Allow using an already unpacked openui5 runtime distribution Add an OPENUI5_SOURCE_DIR CMake variable, analogous to CLAD_SOURCE_DIR, that points to an already unpacked openui5 runtime distribution. With it, ROOT can be built with builtin_openui5=ON without network access, as the download via ExternalProject and the connectivity check are skipped. --- builtins/openui5/CMakeLists.txt | 37 +++++++++++++++------ cmake/modules/SearchInstalledSoftware.cmake | 10 +++--- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/builtins/openui5/CMakeLists.txt b/builtins/openui5/CMakeLists.txt index a9b00e1a1eab4..b628289405ffb 100644 --- a/builtins/openui5/CMakeLists.txt +++ b/builtins/openui5/CMakeLists.txt @@ -1,13 +1,28 @@ set(OPENUI5_VERSION "1.152.0") -ExternalProject_Add( - OPENUI5 - URL ${lcgpackages}/openui5-runtime-${OPENUI5_VERSION}.zip - URL_HASH SHA256=4882023d4760ed4c20602e36dd183b02a538fc7e8bbfda607b6e25bd1cbbcdb1 - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" - SOURCE_DIR ${CMAKE_BINARY_DIR}/ui5/distribution - TIMEOUT 600 -) -install(DIRECTORY ${CMAKE_BINARY_DIR}/ui5/distribution/ DESTINATION ${CMAKE_INSTALL_OPENUI5DIR}/distribution/ COMPONENT libraries FILES_MATCHING PATTERN "*") +if(DEFINED OPENUI5_SOURCE_DIR) + # Use an already unpacked openui5 runtime distribution instead of + # downloading it, analogous to CLAD_SOURCE_DIR for clad. This allows to + # build ROOT without network access. + if(NOT EXISTS "${OPENUI5_SOURCE_DIR}/resources/sap-ui-core.js") + message(FATAL_ERROR "OPENUI5_SOURCE_DIR=${OPENUI5_SOURCE_DIR} does not contain an openui5 runtime distribution (resources/sap-ui-core.js not found)") + endif() + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/ui5) + execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink + ${OPENUI5_SOURCE_DIR} ${CMAKE_BINARY_DIR}/ui5/distribution) + set(_openui5_distribution_dir ${OPENUI5_SOURCE_DIR}) +else() + ExternalProject_Add( + OPENUI5 + URL ${lcgpackages}/openui5-runtime-${OPENUI5_VERSION}.zip + URL_HASH SHA256=4882023d4760ed4c20602e36dd183b02a538fc7e8bbfda607b6e25bd1cbbcdb1 + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "" + SOURCE_DIR ${CMAKE_BINARY_DIR}/ui5/distribution + TIMEOUT 600 + ) + set(_openui5_distribution_dir ${CMAKE_BINARY_DIR}/ui5/distribution) +endif() + +install(DIRECTORY ${_openui5_distribution_dir}/ DESTINATION ${CMAKE_INSTALL_OPENUI5DIR}/distribution/ COMPONENT libraries FILES_MATCHING PATTERN "*") diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index 74dc7fe9ff9d6..d09e1b8b2eab2 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -1128,10 +1128,12 @@ if(webgui) $ENV{OPENUI5DIR} ${CMAKE_BINARY_DIR}/ui5/distribution) else() if(builtin_openui5) - ROOT_CHECK_CONNECTION("builtin_openui5=OFF") - if (NO_CONNECTION) - message(SEND_ERROR "builtin_openui5=ON requires internet connection, check it or disable feature") - list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_openui5=OFF) + if(NOT DEFINED OPENUI5_SOURCE_DIR) + ROOT_CHECK_CONNECTION("builtin_openui5=OFF") + if (NO_CONNECTION) + message(SEND_ERROR "builtin_openui5=ON requires internet connection, check it or disable feature") + list(APPEND HOTFIX_BUILD_FLAGS -Dbuiltin_openui5=OFF) + endif() endif() add_subdirectory(builtins/openui5) else()