From 71e9f4c0e5fc29a8bb74bc313eed05190da7bf96 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Sun, 25 Aug 2024 13:39:43 +0800 Subject: Make Prebuilt.cmake reimplementation more generic Anticipate the possibility that an archive isn't suffixed with a 64. Parentheses need to be escaped by quotes (backslashing would work too), otherwise they would be parsed as part of CMake commands syntax. Regex subexpressions shouldn't contain regex themselves (only verbatim or preprocessed strings are used within the parentheses). --- indra/cmake/Prebuilt.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake index 793da3338f..012dea5a50 100644 --- a/indra/cmake/Prebuilt.cmake +++ b/indra/cmake/Prebuilt.cmake @@ -55,13 +55,13 @@ macro (use_prebuilt_binary _binary) endif (${system_name} MATCHES freebsd) execute_process(COMMAND xmllint --xpath - "//map/map/map/map/map/map/string[contains(text(),'${_binary}')][contains(text(),'${system_name}64')]/text()" autobuild.xml + "//map/map/map/map/map/map/string[contains(text(),'${_binary}')][contains(text(),'${system_name}')]/text()" autobuild.xml WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/.. OUTPUT_VARIABLE package_url OUTPUT_STRIP_TRAILING_WHITESPACE ) endif ("${package_url}" STREQUAL "") - string(REGEX REPLACE ^https://github.com/secondlife/3p-${_binary}/releases/download/v[0-9]+.*/ "" package_name ${package_url}) + string(REGEX REPLACE "^https://(megapahit.net/downloads|github.com/secondlife/3p-${_binary}/releases/download|automated-builds-secondlife-com.s3.amazonaws.com/ct2).*/" "" package_name ${package_url}) file(DOWNLOAD ${package_url} ${CMAKE_BINARY_DIR}/${package_name} -- cgit v1.2.3