summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2006-05-23 13:11:46 (GMT)
committerKen Martin <ken.martin@kitware.com>2006-05-23 13:11:46 (GMT)
commit50d058a3a1ed4fbb1a1df29ae9979d8c9812ceef (patch)
tree980f4a317110d0903d24e45486a840790833972f /Source/cmMacroCommand.cxx
parent4a2d72d313a0ee9463a6baac7a10ed6610159e38 (diff)
downloadCMake-50d058a3a1ed4fbb1a1df29ae9979d8c9812ceef.zip
CMake-50d058a3a1ed4fbb1a1df29ae9979d8c9812ceef.tar.gz
CMake-50d058a3a1ed4fbb1a1df29ae9979d8c9812ceef.tar.bz2
ENH: always compile progress
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index c8565a9..ca86b3b 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -252,11 +252,14 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
{
// record commands until we hit the ENDMACRO
// at the ENDMACRO call we shift gears and start looking for invocations
- if(cmSystemTools::LowerCase(lff.Name) == "endmacro")
+ if(cmSystemTools::LowerCase(lff.Name) == "macro")
{
- std::vector<std::string> expandedArguments;
- mf.ExpandArguments(lff.Arguments, expandedArguments);
- if(!expandedArguments.empty() && (expandedArguments[0] == this->Args[0]))
+ this->Depth++;
+ }
+ else if(cmSystemTools::LowerCase(lff.Name) == "endmacro")
+ {
+ // if this is the endmacro for this macro then execute
+ if (!this->Depth)
{
std::string name = this->Args[0];
std::vector<std::string>::size_type cc;
@@ -280,6 +283,11 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
mf.RemoveFunctionBlocker(lff);
return true;
}
+ else
+ {
+ // decrement for each nested macro that ends
+ this->Depth--;
+ }
}
// if it wasn't an endmacro and we are not executing then we must be
@@ -296,11 +304,14 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf)
{
std::vector<std::string> expandedArguments;
mf.ExpandArguments(lff.Arguments, expandedArguments);
- if(!expandedArguments.empty() && (expandedArguments[0] == this->Args[0]))
+ if ((!expandedArguments.empty() &&
+ (expandedArguments[0] == this->Args[0]))
+ || mf.IsOn("CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS"))
{
return true;
}
}
+
return false;
}