mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 15:20:56 -06:00
ExternalProject: Fix environment modification ops named with underscores
Extend commite301cbffcc(ExternalProject: Set environment variables, 2025-04-09, v4.2.0-rc1~480^2) and commit9cb590b843(ExternalProject: Fix lists and empty commands with environment modification, 2025-09-11, v4.2.0-rc1~9^2) to match `_` in environment modification operation names. Fixes: #27409
This commit is contained in:
@@ -2285,7 +2285,7 @@ function(ExternalProject_Add_Step name step)
|
||||
if(environment)
|
||||
set(env_args "")
|
||||
foreach(env_mod IN LISTS environment)
|
||||
if(env_mod MATCHES [[^([^=:]+)=([a-z]+):(.*)$]])
|
||||
if(env_mod MATCHES [[^([^=:]+)=([a-z_]+):(.*)$]])
|
||||
set(_value "${CMAKE_MATCH_3}")
|
||||
# Replace the separator only in the value in case it is `:`.
|
||||
if(sep)
|
||||
|
||||
@@ -67,7 +67,7 @@ ExternalProject_Add(DefaultCommand
|
||||
CMAKE_ARGS
|
||||
-DVARIABLE=ConfigVar
|
||||
CONFIGURE_ENVIRONMENT_MODIFICATION
|
||||
ConfigVar=set:config
|
||||
ConfigVar=string_append:fig # RunCMakeTest.cmake sets to "con"
|
||||
ListVar=set:7,8,9
|
||||
ListSeparator=set:,
|
||||
BUILD_ENVIRONMENT_MODIFICATION
|
||||
|
||||
@@ -261,6 +261,8 @@ if(GIT_EXECUTABLE)
|
||||
endif()
|
||||
|
||||
set(RunCMake_TEST_OUTPUT_MERGE 1)
|
||||
set(ENV{ConfigVar} "con")
|
||||
__ep_test_with_build(EnvVars)
|
||||
unset(ENV{ConfigVar})
|
||||
unset(RunCMake_TEST_OUTPUT_MERGE)
|
||||
run_cmake(InvalidEnvModification)
|
||||
|
||||
Reference in New Issue
Block a user