summaryrefslogtreecommitdiffstats
path: root/Source/cmOptionCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-04-17 20:16:06 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-04-17 20:16:06 (GMT)
commit0415b58573ba63a9c6168d8af05a165ea5e24774 (patch)
treeef79785f99fd23797aa8dcb27083c6a0cc9c1c5a /Source/cmOptionCommand.cxx
parentb7c368b5e37289f85f2155db1b594d6bc4a3f0a4 (diff)
downloadCMake-0415b58573ba63a9c6168d8af05a165ea5e24774.zip
CMake-0415b58573ba63a9c6168d8af05a165ea5e24774.tar.gz
CMake-0415b58573ba63a9c6168d8af05a165ea5e24774.tar.bz2
ENH: backwards compatible for VTK 4.0, add cmake version requires
Diffstat (limited to 'Source/cmOptionCommand.cxx')
-rw-r--r--Source/cmOptionCommand.cxx27
1 files changed, 24 insertions, 3 deletions
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx
index 2a943b8..4478a21 100644
--- a/Source/cmOptionCommand.cxx
+++ b/Source/cmOptionCommand.cxx
@@ -19,12 +19,33 @@
// cmOptionCommand
bool cmOptionCommand::InitialPass(std::vector<std::string> const& args)
{
- if(args.size() < 2 || args.size() > 3)
+ bool argError = false;
+ if(args.size() < 2)
{
- this->SetError("called with incorrect number of arguments");
+ argError = true;
+ }
+ // for VTK 4.0 we have to support the option command with more than 3 arguments
+ // if CMAKE_MINIMUM_REQUIRED_VERSION is not defined, if CMAKE_MINIMUM_REQUIRED_VERSION
+ // is defined, then we can have stricter checking.
+ if(m_Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION"))
+ {
+ if(args.size() > 3)
+ {
+ argError = true;
+ }
+ }
+ if(argError)
+ {
+ std::string m = "called with incorrect number of arguments: ";
+ for(int i =0; i < args.size(); ++i)
+ {
+ m += args[i];
+ m += " ";
+ }
+ this->SetError(m.c_str());
return false;
}
-
+
// Now check and see if the value has been stored in the cache
// already, if so use that value and don't look for the program
const char* cacheValue