diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-02-29 17:18:11 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-02-29 17:18:11 (GMT) |
commit | f386c2aae09ff4af04a15ceebe41588fcbbae648 (patch) | |
tree | f6a6c2db3616485f7779941ae3b1ba4e00197ed8 | |
parent | 03ef00bc93511b6909f022a143c93bbb29bc2c58 (diff) | |
download | CMake-f386c2aae09ff4af04a15ceebe41588fcbbae648.zip CMake-f386c2aae09ff4af04a15ceebe41588fcbbae648.tar.gz CMake-f386c2aae09ff4af04a15ceebe41588fcbbae648.tar.bz2 |
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.
-rw-r--r-- | Source/cmForEachCommand.cxx | 8 | ||||
-rw-r--r-- | Source/cmFunctionCommand.cxx | 10 | ||||
-rw-r--r-- | Source/cmIfCommand.cxx | 7 | ||||
-rw-r--r-- | Source/cmMacroCommand.cxx | 8 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 9 | ||||
-rw-r--r-- | Source/cmWhileCommand.cxx | 7 |
6 files changed, 21 insertions, 28 deletions
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx index 848c6a4..b13a849 100644 --- a/Source/cmForEachCommand.cxx +++ b/Source/cmForEachCommand.cxx @@ -103,10 +103,10 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) { 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; } diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx index 1ff9d59..7394709 100644 --- a/Source/cmFunctionCommand.cxx +++ b/Source/cmFunctionCommand.cxx @@ -252,11 +252,11 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf) 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; } diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx index bc82c42..f38d265 100644 --- a/Source/cmIfCommand.cxx +++ b/Source/cmIfCommand.cxx @@ -145,9 +145,10 @@ bool cmIfFunctionBlocker::ShouldRemove(const cmListFileFunction& lff, { 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; } diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx index 6b92763..9f1c904 100644 --- a/Source/cmMacroCommand.cxx +++ b/Source/cmMacroCommand.cxx @@ -329,10 +329,10 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf) { 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; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 429eae8..c87a4dd 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3039,15 +3039,6 @@ void cmMakefile::DefineProperties(cmake *cm) "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 " diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx index 9684221..2836c14 100644 --- a/Source/cmWhileCommand.cxx +++ b/Source/cmWhileCommand.cxx @@ -93,9 +93,10 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) { 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; } |