mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-05 14:18:35 -06:00
The CMake language implicitly flattens lists so a ";" in a list element
must be escaped with a backslash. List expansion removes backslashes
escaping semicolons to leave raw semicolons in the values. Teach
ExternalData_Add_Test and ExternalData_Expand_Arguments to re-escape
semicolons found in list elements so the resulting argument lists work
as if constructed directly by the set() command.
For example:
ExternalData_Add_Test(Data NAME test1 COMMAND ... "a\\;b")
ExternalData_Expand_Arguments(Data args2 "c\\;d")
add_test(NAME test2 COMMAND ... ${args2})
should be equivalent to
set(args1 "a\\;b")
add_test(NAME test1 COMMAND ... ${args1})
set(args2 "c\\;d")
add_test(NAME test2 COMMAND ... ${args2})
which is equivalent to
add_test(NAME test1 COMMAND ... "a;b")
add_test(NAME test2 COMMAND ... "c;d")
Note that it is not possible to make ExternalData_Add_Test act exactly
like add_test when quoted arguments contain semicolons because the CMake
language flattens lists when constructing function ARGN values. This
re-escape approach at least allows test arguments to have semicolons.
While at it, teach ExternalData APIs to not transform "DATA{...;...}"
arguments because the contained semicolons are non-sensical.
Suggested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
28 lines
601 B
CMake
28 lines
601 B
CMake
include(RunCMake)
|
|
|
|
run_cmake(BadHashAlgo1)
|
|
run_cmake(BadOption1)
|
|
run_cmake(BadOption2)
|
|
run_cmake(BadSeries1)
|
|
run_cmake(BadSeries2)
|
|
run_cmake(BadSeries3)
|
|
run_cmake(Directory1)
|
|
run_cmake(Directory2)
|
|
run_cmake(Directory3)
|
|
run_cmake(Directory4)
|
|
run_cmake(Directory5)
|
|
run_cmake(LinkContentMD5)
|
|
run_cmake(LinkContentSHA1)
|
|
run_cmake(MissingData)
|
|
run_cmake(NoLinkInSource)
|
|
run_cmake(NoURLTemplates)
|
|
run_cmake(NormalData1)
|
|
run_cmake(NormalData2)
|
|
run_cmake(NormalData3)
|
|
run_cmake(NormalDataSub1)
|
|
run_cmake(NotUnderRoot)
|
|
run_cmake(Semicolon1)
|
|
run_cmake(Semicolon2)
|
|
run_cmake(Semicolon3)
|
|
run_cmake(SubDirectory1)
|