diff options
author | Brad King <brad.king@kitware.com> | 2001-12-18 19:55:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2001-12-18 19:55:11 (GMT) |
commit | aa49d94ce06b3df1a87b62d49190ae81428b8d2a (patch) | |
tree | 26e4d3fe84d6fc786039875433e87424e0e7344c /Source/cmIfCommand.cxx | |
parent | 73fd2381b9c63e5dffcc9aed8c76515f7390c809 (diff) | |
download | CMake-aa49d94ce06b3df1a87b62d49190ae81428b8d2a.zip CMake-aa49d94ce06b3df1a87b62d49190ae81428b8d2a.tar.gz CMake-aa49d94ce06b3df1a87b62d49190ae81428b8d2a.tar.bz2 |
ENH: Added error reporting for missing arguments to ENDIF.
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r-- | Source/cmIfCommand.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index e25502e..ba5bdfb 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. bool cmIfFunctionBlocker:: IsFunctionBlocked(const char *name, const std::vector<std::string> &args, - cmMakefile &) + cmMakefile &mf) { if (!strcmp(name,"ELSE") || !strcmp(name,"ENDIF")) { @@ -51,6 +51,22 @@ IsFunctionBlocked(const char *name, const std::vector<std::string> &args, { return false; } + else if(args.empty()) + { + std::string err = "Empty arguments for "; + err += name; + err += ". Did you mean "; + err += name; + err += "( "; + for(std::vector<std::string>::const_iterator a = m_Args.begin(); + a != m_Args.end();++a) + { + err += *a; + err += " "; + } + err += ")?"; + cmSystemTools::Error(err.c_str()); + } } return true; } |