diff options
author | Brad King <brad.king@kitware.com> | 2014-10-31 17:07:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-10-31 17:21:21 (GMT) |
commit | 1531df2b866df9aa52dc54219a4552e94f47b622 (patch) | |
tree | bbe448bdacda4249295f02cf1b1983d0737f7c27 /Source | |
parent | 4abbb1400d81e1288cdf1e2f708eaa938f7b3955 (diff) | |
download | CMake-1531df2b866df9aa52dc54219a4552e94f47b622.zip CMake-1531df2b866df9aa52dc54219a4552e94f47b622.tar.gz CMake-1531df2b866df9aa52dc54219a4552e94f47b622.tar.bz2 |
configure_file: Warn about unknown arguments
Extend the RunCMake.configure_file test with a case covering possible
common typos of the COPYONLY option.
Reported-by: Iosif Neitzke <iosif.neitzke@gmail.com>
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmConfigureFileCommand.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index 395e6c8..cb727a8 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -74,6 +74,7 @@ bool cmConfigureFileCommand this->CopyOnly = false; this->EscapeQuotes = false; + std::string unknown_args; this->AtOnly = false; for(unsigned int i=2;i < args.size();++i) { @@ -99,6 +100,18 @@ bool cmConfigureFileCommand { /* Ignore legacy option. */ } + else + { + unknown_args += " "; + unknown_args += args[i]; + unknown_args += "\n"; + } + } + if (!unknown_args.empty()) + { + std::string msg = "configure_file called with unknown argument(s):\n"; + msg += unknown_args; + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg); } if ( !this->ConfigureFile() ) |