mirror of
https://github.com/Kitware/CMake.git
synced 2026-06-25 01:08:18 +00:00
ExternalProject: Fix ENVIRONMENT_MODIFICATION with spaces in values
Fix commite301cbffcc(ExternalProject: Set environment variables, 2025-04-09, v4.2.0-rc1~480^2) to quote arguments for ``EVAL CODE``, used since commitcbf2daeed0(ExternalProject: Preserve empty string arguments, 2020-05-15, v3.18.0-rc1~99^2~1). Fixes: #27876
This commit is contained in:
@@ -2808,7 +2808,8 @@ function(_ep_add_configure_command name)
|
||||
PROPERTY _EP_CONFIGURE_ENVIRONMENT_MODIFICATION
|
||||
)
|
||||
if(environment)
|
||||
set(environment "ENVIRONMENT_MODIFICATION" ${environment})
|
||||
string(JOIN "]==] [==[" environment ${environment})
|
||||
set(environment "ENVIRONMENT_MODIFICATION [==[${environment}]==]")
|
||||
endif()
|
||||
|
||||
get_property(log
|
||||
@@ -2927,7 +2928,8 @@ function(_ep_add_build_command name)
|
||||
PROPERTY _EP_BUILD_ENVIRONMENT_MODIFICATION
|
||||
)
|
||||
if(environment)
|
||||
set(environment ENVIRONMENT_MODIFICATION ${environment})
|
||||
string(JOIN "]==] [==[" environment ${environment})
|
||||
set(environment "ENVIRONMENT_MODIFICATION [==[${environment}]==]")
|
||||
endif()
|
||||
|
||||
set(__cmdQuoted)
|
||||
@@ -3022,7 +3024,8 @@ function(_ep_add_install_command name)
|
||||
PROPERTY _EP_INSTALL_ENVIRONMENT_MODIFICATION
|
||||
)
|
||||
if(environment)
|
||||
set(environment ENVIRONMENT_MODIFICATION ${environment})
|
||||
string(JOIN "]==] [==[" environment ${environment})
|
||||
set(environment "ENVIRONMENT_MODIFICATION [==[${environment}]==]")
|
||||
endif()
|
||||
|
||||
set(__cmdQuoted)
|
||||
@@ -3110,7 +3113,8 @@ function(_ep_add_test_command name)
|
||||
PROPERTY _EP_TEST_ENVIRONMENT_MODIFICATION
|
||||
)
|
||||
if(environment)
|
||||
set(environment ENVIRONMENT_MODIFICATION ${environment})
|
||||
string(JOIN "]==] [==[" environment ${environment})
|
||||
set(environment "ENVIRONMENT_MODIFICATION [==[${environment}]==]")
|
||||
endif()
|
||||
|
||||
set(__cmdQuoted)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
.*(Performing custom step for 'CustomCommand'|CustomCommand-custom).*
|
||||
*-- Variable - CustomVar: custom.*
|
||||
*-- Variable - CustomVar2: custom2.*
|
||||
*-- Variable - CustomVar2: custom two.*
|
||||
*-- Stage: custom
|
||||
*-- Separator: ;
|
||||
*-- List: 1;2;3
|
||||
.*(Performing configure step for 'CustomCommand'|CustomCommand-configure).*
|
||||
*-- Stage: config
|
||||
*-- Stage: config step
|
||||
*-- Separator: ;
|
||||
*-- List: 4;5;6
|
||||
*-- MYLIST:
|
||||
@@ -15,15 +15,15 @@
|
||||
*-- Variable - Stage: config.*
|
||||
*-- Variable - ListVar: 4;5;6
|
||||
.*(Performing build step for 'CustomCommand'|CustomCommand-build).*
|
||||
*-- Stage: build
|
||||
*-- Stage: build step
|
||||
*-- Separator: ;
|
||||
*-- List: 4;5;6
|
||||
.*(Performing install step for 'CustomCommand'|CustomCommand-install).*
|
||||
*-- Stage: install
|
||||
*-- Stage: install step
|
||||
*-- Separator: ;
|
||||
*-- List: 4;5;6
|
||||
.*(Performing test step for 'CustomCommand'|CustomCommand-test).*
|
||||
*-- Stage: test
|
||||
*-- Stage: test step
|
||||
*-- Separator: ;
|
||||
*-- List: 4;5;6
|
||||
.*(Performing configure step for 'DefaultCommand'|DefaultCommand-configure).*
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
.*(Performing custom step for 'CustomCommand'|CustomCommand-custom).*
|
||||
*-- Variable - CustomVar: custom.*
|
||||
*-- Variable - CustomVar2: custom2.*
|
||||
*-- Variable - CustomVar2: custom two.*
|
||||
*-- Stage: custom
|
||||
*-- Separator: ;
|
||||
*-- List: 1;2;3
|
||||
.*(Performing configure step for 'CustomCommand'|CustomCommand-configure).*
|
||||
*-- Stage: config
|
||||
*-- Stage: config step
|
||||
*-- Separator: ;
|
||||
*-- List: 4;5;6
|
||||
*-- MYLIST:
|
||||
@@ -15,15 +15,15 @@
|
||||
*-- Variable - Stage: config.*
|
||||
*-- Variable - ListVar: 4;5;6
|
||||
.*(Performing build step for 'CustomCommand'|CustomCommand-build).*
|
||||
*-- Stage: build
|
||||
*-- Stage: build step
|
||||
*-- Separator: ;
|
||||
*-- List: 4;5;6
|
||||
.*(Performing install step for 'CustomCommand'|CustomCommand-install).*
|
||||
*-- Stage: install
|
||||
*-- Stage: install step
|
||||
*-- Separator: ;
|
||||
*-- List: 4;5;6
|
||||
.*(Performing test step for 'CustomCommand'|CustomCommand-test).*
|
||||
*-- Stage: test
|
||||
*-- Stage: test step
|
||||
*-- Separator: ;
|
||||
*-- List: 4;5;6
|
||||
.*(Performing configure step for 'DefaultCommand'|DefaultCommand-configure).*
|
||||
|
||||
@@ -21,23 +21,23 @@ ExternalProject_Add(CustomCommand
|
||||
COMMAND
|
||||
COMMAND "${CMAKE_COMMAND}" -DVARNAME=ListVar -P ${ScriptPath}
|
||||
CONFIGURE_ENVIRONMENT_MODIFICATION
|
||||
Stage=set:config
|
||||
"Stage=set:config step"
|
||||
ListVar=set:4,5,6
|
||||
ListSeparator=set:,
|
||||
BUILD_COMMAND "${CMAKE_COMMAND}" -P ${ScriptPath}
|
||||
BUILD_ENVIRONMENT_MODIFICATION
|
||||
Stage=set:build
|
||||
"Stage=set:build step"
|
||||
ListVar=set:4,5,6
|
||||
ListSeparator=set:,
|
||||
INSTALL_COMMAND "${CMAKE_COMMAND}" -P ${ScriptPath}
|
||||
INSTALL_ENVIRONMENT_MODIFICATION
|
||||
InstallVar=set:install
|
||||
Stage=set:install
|
||||
"Stage=set:install step"
|
||||
ListVar=set:4,5,6
|
||||
ListSeparator=set:,
|
||||
TEST_COMMAND "${CMAKE_COMMAND}" -P ${ScriptPath}
|
||||
TEST_ENVIRONMENT_MODIFICATION
|
||||
Stage=set:test
|
||||
"Stage=set:test step"
|
||||
ListVar=set:4,5,6
|
||||
ListSeparator=set:,)
|
||||
|
||||
@@ -48,7 +48,7 @@ ExternalProject_Add_Step(CustomCommand custom
|
||||
COMMAND "${CMAKE_COMMAND}" -P ${ScriptPath}
|
||||
ENVIRONMENT_MODIFICATION
|
||||
CustomVar=set:custom
|
||||
CustomVar2=set:custom2
|
||||
"CustomVar2=set:custom two"
|
||||
Stage=set:custom
|
||||
ListVar=set:1,2,3
|
||||
ListSeparator=set:,)
|
||||
|
||||
Reference in New Issue
Block a user