Merge topic 'uninitialized-var-in-if'

54fd9e3 fix uninitialized var in if(NOT foo bar STREQUAL "foo bar")
This commit is contained in:
David Cole 2012-01-25 11:17:46 -05:00 committed by CMake Topic Stage
commit 30620e7477
3 changed files with 11 additions and 0 deletions

View File

@ -910,6 +910,7 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args,
if (newArgs.size() != 1)
{
errorString = "Unknown arguments specified";
status = cmake::FATAL_ERROR;
return false;
}

View File

@ -0,0 +1,2 @@
if (NOT foo bar STREQUAL "foo bar")
endif()

View File

@ -156,3 +156,11 @@ foreach(_bad 2x -2x)
endforeach()
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
)