FIX: stupid pb fixed (close to being medieval'ed by The Ken)
[cmake.git] / Source / cmCMakeMinimumRequired.cxx
blobf19f17adfbd4c85eda008887805ef3eae38516e4
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmCMakeMinimumRequired.cxx,v $
5 Language: C++
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"
18 #include "stdio.h"
20 // cmCMakeMinimumRequired
21 bool cmCMakeMinimumRequired::InitialPass(std::vector<std::string> const& args)
23 if(args.size() != 2)
25 this->SetError("called with incorrect number of arguments");
26 return false;
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);
34 float reqVersion = 0;
35 sscanf(args[1].c_str(), "%f", &reqVersion);
36 if(reqVersion > version)
38 cmStringStream str;
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());
43 return true;