Commit 06a9a3bd authored by Cristian Adam's avatar Cristian Adam

file(CONFIGURE): Allow angle brackets in content

Fixes: #21306
parent 85c2bb72
......@@ -2945,15 +2945,7 @@ bool HandleConfigureCommand(std::vector<std::string> const& args,
std::string outputFile = cmSystemTools::CollapseFullPath(
args[2], status.GetMakefile().GetCurrentBinaryDirectory());
std::string::size_type pos = input.find_first_of("<>");
if (pos != std::string::npos) {
status.SetError(cmStrCat("CONFIGURE called with CONTENT containing a \"",
input[pos],
"\". This character is not allowed."));
return false;
}
pos = outputFile.find_first_of("<>");
std::string::size_type pos = outputFile.find_first_of("<>");
if (pos != std::string::npos) {
status.SetError(cmStrCat("CONFIGURE called with OUTPUT containing a \"",
outputFile[pos],
......
......@@ -2,3 +2,5 @@ file(CONFIGURE
OUTPUT "file.txt"
CONTENT "foo-$<CONFIG>"
)
file(READ ${CMAKE_CURRENT_BINARY_DIR}/file.txt out)
message("${out}")
CMake Error at BadArgGeneratorExpressionContent.cmake:[0-9]+ \(file\):
file CONFIGURE called with CONTENT containing a "<". This character is not
allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
include(RunCMake)
run_cmake(AngleBracketsContent)
run_cmake(BadArg)
run_cmake(BadArgGeneratorExpressionContent)
run_cmake(BadArgGeneratorExpressionOutput)
run_cmake(DirOutput)
run_cmake(NewLineStyle-NoArg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment