[Cmake-commits] [cmake-commits] king committed cmCMakeMinimumRequired.cxx 1.18 1.19 cmCMakeMinimumRequired.h 1.13 1.14
cmake-commits at cmake.org
cmake-commits at cmake.org
Sat Jan 3 15:48:00 EST 2009
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv9150/Source
Modified Files:
cmCMakeMinimumRequired.cxx cmCMakeMinimumRequired.h
Log Message:
ENH: Ignore unknown cmake_minimum_required args
When cmake_minimum_required is called with an unknown argument it should
not complain about it if the version specified is in the future. This
allows the proper error to be shown about the current CMake being too
old.
Index: cmCMakeMinimumRequired.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCMakeMinimumRequired.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C 2 -d -r1.13 -r1.14
*** cmCMakeMinimumRequired.h 13 Mar 2008 21:32:13 -0000 1.13
--- cmCMakeMinimumRequired.h 3 Jan 2009 20:47:58 -0000 1.14
***************
*** 84,87 ****
--- 84,91 ----
cmTypeMacro(cmCMakeMinimumRequired, cmCommand);
+
+ private:
+ std::vector<std::string> UnknownArguments;
+ bool EnforceUnknownArguments();
};
Index: cmCMakeMinimumRequired.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmCMakeMinimumRequired.cxx,v
retrieving revision 1.18
retrieving revision 1.19
diff -C 2 -d -r1.18 -r1.19
*** cmCMakeMinimumRequired.cxx 24 Mar 2008 14:56:26 -0000 1.18
--- cmCMakeMinimumRequired.cxx 3 Jan 2009 20:47:58 -0000 1.19
***************
*** 48,55 ****
else
{
! cmOStringStream e;
! e << "called with unknown argument \"" << args[i].c_str() << "\".";
! this->SetError(e.str().c_str());
! return false;
}
}
--- 48,52 ----
else
{
! this->UnknownArguments.push_back(args[i]);
}
}
***************
*** 63,67 ****
if(version_string.empty())
{
! return true;
}
--- 60,64 ----
if(version_string.empty())
{
! return this->EnforceUnknownArguments();
}
***************
*** 108,111 ****
--- 105,114 ----
}
+ // The version is not from the future, so enforce unknown arguments.
+ if(!this->EnforceUnknownArguments())
+ {
+ return false;
+ }
+
if (required_major < 2 || required_major == 2 && required_minor < 4)
{
***************
*** 120,121 ****
--- 123,137 ----
}
+ //----------------------------------------------------------------------------
+ bool cmCMakeMinimumRequired::EnforceUnknownArguments()
+ {
+ if(!this->UnknownArguments.empty())
+ {
+ cmOStringStream e;
+ e << "called with unknown argument \""
+ << this->UnknownArguments[0] << "\".";
+ this->SetError(e.str().c_str());
+ return false;
+ }
+ return true;
+ }
More information about the Cmake-commits
mailing list