1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmOptionCommand.cxx,v $
6 Date: $Date: 2002-04-25 11:59:57 $
7 Version: $Revision: 1.17 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmOptionCommand.h"
20 bool cmOptionCommand::InitialPass(std::vector
<std::string
> const& args
)
22 bool argError
= false;
27 // for VTK 4.0 we have to support the option command with more than 3 arguments
28 // if CMAKE_MINIMUM_REQUIRED_VERSION is not defined, if CMAKE_MINIMUM_REQUIRED_VERSION
29 // is defined, then we can have stricter checking.
30 if(m_Makefile
->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION"))
39 std::string m
= "called with incorrect number of arguments: ";
40 for(size_t i
=0; i
< args
.size(); ++i
)
45 this->SetError(m
.c_str());
49 // Now check and see if the value has been stored in the cache
50 // already, if so use that value and don't look for the program
51 const char* cacheValue
52 = m_Makefile
->GetDefinition(args
[0].c_str());
55 std::string initialValue
= "Off";
58 initialValue
= args
[2];
60 m_Makefile
->AddCacheDefinition(args
[0].c_str(),
61 cmSystemTools::IsOn(initialValue
.c_str()),