From aeab59d9e71df3cc036942aa9ea294c53c2ce9c8 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 15 Jul 2003 12:52:16 -0400 Subject: [PATCH] ENH: better error checking --- Source/cmAddCustomCommandCommand.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx index d1de8453a..e471dc339 100644 --- a/Source/cmAddCustomCommandCommand.cxx +++ b/Source/cmAddCustomCommandCommand.cxx @@ -149,6 +149,14 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector const& args this->SetError("Wrong syntax. A TARGET or OUTPUT must be specified."); return false; } + + if (source.empty() + && !target.empty() + && !output.empty()) + { + this->SetError("Wrong syntax. A TARGET and OUTPUT can not both be specified."); + return false; + } // If source is empty, use the target if(source.empty() && output.empty())