[Cmake-commits] [cmake-commits] martink committed cmListFileCache.cxx 1.42 1.43
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu Mar 20 10:40:26 EDT 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv29261
Modified Files:
cmListFileCache.cxx
Log Message:
ENH: small simple projects do not need to specify cmake minimum required
Index: cmListFileCache.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListFileCache.cxx,v
retrieving revision 1.42
retrieving revision 1.43
diff -C 2 -d -r1.42 -r1.43
*** cmListFileCache.cxx 19 Mar 2008 19:18:21 -0000 1.42
--- cmListFileCache.cxx 20 Mar 2008 14:40:24 -0000 1.43
***************
*** 135,140 ****
}
}
! // if no version command is found this is a warning or error
if(!hasVersion)
{
cmOStringStream msg;
--- 135,173 ----
}
}
! // if no policy command is found this is an error if they use any non advanced functions or a lot of functions
if(!hasVersion)
+ {
+ bool isProblem = true;
+ if (this->Functions.size() < 30)
+ {
+ // the list of simple commands DO NOT ADD TO THIS LIST!!!!!
+ // these commands must have backwards compatibility forever and
+ // and that is a lot longer than your tiny mind can comprehend mortal
+ std::set<std::string> allowedCommands;
+ allowedCommands.insert("project");
+ allowedCommands.insert("set");
+ allowedCommands.insert("if");
+ allowedCommands.insert("endif");
+ allowedCommands.insert("else");
+ allowedCommands.insert("elseif");
+ allowedCommands.insert("add_executable");
+ allowedCommands.insert("add_library");
+ allowedCommands.insert("target_link_libraries");
+ allowedCommands.insert("option");
+ allowedCommands.insert("message");
+ isProblem = false;
+ for(std::vector<cmListFileFunction>::iterator i
+ = this->Functions.begin();
+ i != this->Functions.end(); ++i)
+ {
+ std::string name = cmSystemTools::LowerCase(i->Name);
+ if (allowedCommands.find(name) == allowedCommands.end())
+ {
+ isProblem = true;
+ }
+ }
+ }
+
+ if (isProblem)
{
cmOStringStream msg;
***************
*** 163,166 ****
--- 196,200 ----
}
}
+ }
}
More information about the Cmake-commits
mailing list