From 554a0094b6b800918939761750fb10cc24737c22 Mon Sep 17 00:00:00 2001 From: "CW01\\uig08771" Date: Sat, 8 Jul 2023 09:29:22 +0800 Subject: [PATCH] env value for VCS_URL Signed-off-by: CW01\uig08771 --- ament_cmake_vendor_package/cmake/ament_vendor.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ament_cmake_vendor_package/cmake/ament_vendor.cmake b/ament_cmake_vendor_package/cmake/ament_vendor.cmake index 4910e9d3..7a0322cd 100644 --- a/ament_cmake_vendor_package/cmake/ament_vendor.cmake +++ b/ament_cmake_vendor_package/cmake/ament_vendor.cmake @@ -66,9 +66,17 @@ macro(ament_vendor TARGET_NAME) "${_ARG_UNPARSED_ARGUMENTS}") endif() + set(ENV_VCS_URL_NAME ${TARGET_NAME}_VCS_URL) + if (DEFINED ENV{${ENV_VCS_URL_NAME}}) + message(STATUS "Use mirror of ${ENV_VCS_URL_NAME}: $ENV{${ENV_VCS_URL_NAME}}") + set(_ARG_VCS_URL $ENV{${ENV_VCS_URL_NAME}}) + endif() if(NOT _ARG_VCS_URL) message(FATAL_ERROR "ament_vendor() must be called with the VCS_URL argument") + else() + message(STATUS "VCS_URL: ${_ARG_VCS_URL}") endif() + if(_ARG_VCS_TYPE STREQUAL "path") if(_ARG_SOURCE_SUBDIR) message(FATAL_ERROR "ament_vendor() cannot use VCS_TYPE 'path' with SOURCE_SUBDIR argument")