1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmCMakeMinimumRequired.cxx,v $
6 Date: $Date: 2002-06-19 19:21:49 $
7 Version: $Revision: 1.4 $
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 "cmCMakeMinimumRequired.h"
20 // cmCMakeMinimumRequired
21 bool cmCMakeMinimumRequired::InitialPass(std::vector
<std::string
> const& args
)
25 this->SetError("called with incorrect number of arguments");
28 if(args
[0] == "VERSION")
30 m_Makefile
->AddDefinition("CMAKE_MINIMUM_REQUIRED_VERSION", args
[1].c_str());
32 float version
= float(m_Makefile
->GetMajorVersion());
33 version
+= (float(m_Makefile
->GetMinorVersion()) * (float).1);
35 sscanf(args
[1].c_str(), "%f", &reqVersion
);
36 if(reqVersion
> version
)
39 str
<< "WARNING: This project requires version: " << args
[1].c_str() << " of cmake.\n"
40 << "You are running version: " << version
;
41 cmSystemTools::Message(str
.str().c_str());