Merge topic 'file-download-unexpected-arg'

4dd997da file(DOWNLOAD|UPLOAD): Warn on unexpected arguments
This commit is contained in:
Brad King 2016-09-13 11:40:35 -04:00 committed by CMake Topic Stage
commit 8a56e311ec
10 changed files with 32 additions and 0 deletions

View File

@ -2564,6 +2564,11 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
return false;
}
hashMatchMSG = algo + " hash";
} else {
// Do not return error for compatibility reason.
std::string err = "Unexpected argument: ";
err += *i;
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, err.c_str());
}
++i;
}
@ -2812,6 +2817,11 @@ bool cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
statusVar = *i;
} else if (*i == "SHOW_PROGRESS") {
showProgress = true;
} else {
// Do not return error for compatibility reason.
std::string err = "Unexpected argument: ";
err += *i;
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, err.c_str());
}
++i;

View File

@ -0,0 +1,5 @@
^CMake Warning \(dev\) at DOWNLOAD-unused-argument.cmake:[0-9]+ \(file\):
Unexpected argument: JUNK
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.$

View File

@ -0,0 +1,5 @@
file(DOWNLOAD
"file://${CMAKE_CURRENT_SOURCE_DIR}/DOWNLOAD-unused-argument.txt"
"${CMAKE_CURRENT_BINARY_DIR}/unused-argument.txt"
JUNK
)

View File

@ -1,6 +1,8 @@
include(RunCMake)
run_cmake(DOWNLOAD-hash-mismatch)
run_cmake(DOWNLOAD-unused-argument)
run_cmake(UPLOAD-unused-argument)
run_cmake(INSTALL-DIRECTORY)
run_cmake(INSTALL-MESSAGE-bad)
run_cmake(FileOpenFailRead)

View File

@ -0,0 +1,5 @@
^CMake Warning \(dev\) at UPLOAD-unused-argument.cmake:[0-9]+ \(file\):
Unexpected argument: JUNK
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.$

View File

@ -0,0 +1,5 @@
file(UPLOAD
"${CMAKE_CURRENT_SOURCE_DIR}/UPLOAD-unused-argument.txt"
"file://${CMAKE_CURRENT_BINARY_DIR}/unused-argument.txt"
JUNK
)