summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2003-07-15 16:52:16 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2003-07-15 16:52:16 (GMT)
commitaeab59d9e71df3cc036942aa9ea294c53c2ce9c8 (patch)
tree2743ea597e279d5db3ff563bd487f63b141a4f09
parent53510fa6034234ab65b20a15f29f6f8e4625318a (diff)
downloadCMake-aeab59d9e71df3cc036942aa9ea294c53c2ce9c8.zip
CMake-aeab59d9e71df3cc036942aa9ea294c53c2ce9c8.tar.gz
CMake-aeab59d9e71df3cc036942aa9ea294c53c2ce9c8.tar.bz2
ENH: better error checking
-rw-r--r--Source/cmAddCustomCommandCommand.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index d1de845..e471dc3 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -149,6 +149,14 @@ bool cmAddCustomCommandCommand::InitialPass(std::vector<std::string> 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())