ENH: mark some vars as advanced (and resort the list)
[cmake.git] / Source / cmCMakeMinimumRequired.cxx
blobf97ae25ee76fa8fad149010d121c5e1b1181791e
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmCMakeMinimumRequired.cxx,v $
5 Language: C++
6 Date: $Date: 2002-10-10 14:43:59 $
7 Version: $Revision: 1.5 $
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 cmOStringStream 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;