[cmake-commits] hoffman committed cmForEachCommand.cxx 1.26 1.27 cmFunctionCommand.cxx 1.4 1.5 cmIfCommand.cxx 1.82 1.83 cmMacroCommand.cxx 1.34 1.35 cmMakefile.cxx 1.437 1.438 cmWhileCommand.cxx 1.10 1.11

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Feb 29 12:18:13 EST 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv3425

Modified Files:
	cmForEachCommand.cxx cmFunctionCommand.cxx cmIfCommand.cxx 
	cmMacroCommand.cxx cmMakefile.cxx cmWhileCommand.cxx 
Log Message:
ENH: make CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS the default and remove the property.  If any value is specified in an endif, endforeach, endwhile, etc then make sure it matches the start string.  If no values are given then it is no longer an error.


Index: cmIfCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmIfCommand.cxx,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- cmIfCommand.cxx	23 Jan 2008 15:27:59 -0000	1.82
+++ cmIfCommand.cxx	29 Feb 2008 17:18:11 -0000	1.83
@@ -145,9 +145,10 @@
 {
   if (!cmSystemTools::Strucmp(lff.Name.c_str(),"endif"))
     {
-    if (cmSystemTools::IsOn
-        (mf.GetPropertyOrDefinition("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS"))
-        || lff.Arguments == this->Args)
+    // if the endif has arguments, then make sure
+    // they match the arguments of the matching if
+    if (lff.Arguments.size() == 0 ||
+        lff.Arguments == this->Args)
       {
       return true;
       }

Index: cmWhileCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmWhileCommand.cxx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cmWhileCommand.cxx	23 Jan 2008 15:27:59 -0000	1.10
+++ cmWhileCommand.cxx	29 Feb 2008 17:18:11 -0000	1.11
@@ -93,9 +93,10 @@
 {
   if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endwhile"))
     {
-    if (lff.Arguments == this->Args
-        || cmSystemTools::IsOn
-        (mf.GetPropertyOrDefinition("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS")))
+    // if the endwhile has arguments, then make sure
+    // they match the arguments of the matching while
+    if (lff.Arguments.size() == 0 ||
+        lff.Arguments == this->Args)
       {
       return true;
       }

Index: cmMacroCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMacroCommand.cxx,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- cmMacroCommand.cxx	23 Jan 2008 15:27:59 -0000	1.34
+++ cmMacroCommand.cxx	29 Feb 2008 17:18:11 -0000	1.35
@@ -329,10 +329,10 @@
     {
     std::vector<std::string> expandedArguments;
     mf.ExpandArguments(lff.Arguments, expandedArguments);
-    if ((!expandedArguments.empty() && 
-        (expandedArguments[0] == this->Args[0]))
-        || cmSystemTools::IsOn
-        (mf.GetPropertyOrDefinition("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS")))
+    // if the endmacro has arguments make sure they
+    // match the arguments of the macro
+    if ((expandedArguments.empty() ||
+         (expandedArguments[0] == this->Args[0])))
       {
       return true;
       }

Index: cmFunctionCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFunctionCommand.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cmFunctionCommand.cxx	23 Jan 2008 15:27:59 -0000	1.4
+++ cmFunctionCommand.cxx	29 Feb 2008 17:18:11 -0000	1.5
@@ -252,11 +252,11 @@
   if(!cmSystemTools::Strucmp(lff.Name.c_str(),"endfunction"))
     {
     std::vector<std::string> expandedArguments;
-    mf.ExpandArguments(lff.Arguments, expandedArguments);
-    if ((!expandedArguments.empty() && 
-        (expandedArguments[0] == this->Args[0]))
-        || cmSystemTools::IsOn
-        (mf.GetPropertyOrDefinition("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS")))
+    mf.ExpandArguments(lff.Arguments, expandedArguments); 
+    // if the endfunction has arguments then make sure
+    // they match the ones in the openeing function command
+    if ((expandedArguments.empty() ||
+         (expandedArguments[0] == this->Args[0])))
       {
       return true;
       }

Index: cmForEachCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmForEachCommand.cxx,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- cmForEachCommand.cxx	23 Jan 2008 15:27:59 -0000	1.26
+++ cmForEachCommand.cxx	29 Feb 2008 17:18:11 -0000	1.27
@@ -103,10 +103,10 @@
     {
     std::vector<std::string> expandedArguments;
     mf.ExpandArguments(lff.Arguments, expandedArguments);
-    if ((!expandedArguments.empty() && 
-         (expandedArguments[0] == this->Args[0]))
-        || cmSystemTools::IsOn
-        (mf.GetPropertyOrDefinition("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS")))
+    // if the endforeach has arguments then make sure
+    // they match the begin foreach arguments
+    if ((expandedArguments.empty() ||
+         (expandedArguments[0] == this->Args[0])))
       {
       return true;
       }

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.437
retrieving revision 1.438
diff -u -d -r1.437 -r1.438
--- cmMakefile.cxx	14 Feb 2008 21:42:29 -0000	1.437
+++ cmMakefile.cxx	29 Feb 2008 17:18:11 -0000	1.438
@@ -3039,15 +3039,6 @@
      "directory will not be removed during the \"make clean\" stage. ");
 
   cm->DefineProperty
-    ("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS", cmProperty::DIRECTORY,
-     "Allow loops to have non-matching closing statements.",
-     "If this is set then the closing statement of control "
-     "structures in CMake will not require an exact match to the "
-     "opening statement. For example  IF(foo) will not require "
-     "ENDIF(foo) but simple ENDIF() will work.",
-     true);
-
-  cm->DefineProperty
     ("LISTFILE_STACK", cmProperty::DIRECTORY,
      "The current stack of listfiles being processed.",
      "This property is mainly useful when trying to debug errors "



More information about the Cmake-commits mailing list