mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 20:46:37 +08:00
@@ -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],
|
||||
|
@@ -0,0 +1 @@
|
||||
^foo-\$<CONFIG>$
|
6
Tests/RunCMake/File_Configure/AngleBracketsContent.cmake
Normal file
6
Tests/RunCMake/File_Configure/AngleBracketsContent.cmake
Normal file
@@ -0,0 +1,6 @@
|
||||
file(CONFIGURE
|
||||
OUTPUT "file.txt"
|
||||
CONTENT "foo-$<CONFIG>"
|
||||
)
|
||||
file(READ ${CMAKE_CURRENT_BINARY_DIR}/file.txt out)
|
||||
message("${out}")
|
@@ -1 +0,0 @@
|
||||
1
|
@@ -1,5 +0,0 @@
|
||||
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\)
|
@@ -1,4 +0,0 @@
|
||||
file(CONFIGURE
|
||||
OUTPUT "file.txt"
|
||||
CONTENT "foo-$<CONFIG>"
|
||||
)
|
@@ -1,7 +1,7 @@
|
||||
include(RunCMake)
|
||||
|
||||
run_cmake(AngleBracketsContent)
|
||||
run_cmake(BadArg)
|
||||
run_cmake(BadArgGeneratorExpressionContent)
|
||||
run_cmake(BadArgGeneratorExpressionOutput)
|
||||
run_cmake(DirOutput)
|
||||
run_cmake(NewLineStyle-NoArg)
|
||||
|
Reference in New Issue
Block a user