fix uninitialized var in if(NOT foo bar STREQUAL "foo bar")
Also adds test to verify this.
This commit is contained in:
parent
b8ff1c1e72
commit
54fd9e38bb
|
@ -910,6 +910,7 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args,
|
||||||
if (newArgs.size() != 1)
|
if (newArgs.size() != 1)
|
||||||
{
|
{
|
||||||
errorString = "Unknown arguments specified";
|
errorString = "Unknown arguments specified";
|
||||||
|
status = cmake::FATAL_ERROR;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
if (NOT foo bar STREQUAL "foo bar")
|
||||||
|
endif()
|
|
@ -156,3 +156,11 @@ foreach(_bad 2x -2x)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
test_vars("")
|
test_vars("")
|
||||||
|
|
||||||
|
set(Invalid-Argument-RESULT 1)
|
||||||
|
set(Invalid-Argument-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?If-Invalid-Argument.cmake:1 \\(if\\):.*Unknown arguments specified.*")
|
||||||
|
|
||||||
|
include("@CMAKE_CURRENT_SOURCE_DIR@/CheckCMakeTest.cmake")
|
||||||
|
check_cmake_test(If
|
||||||
|
Invalid-Argument
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in New Issue