summaryrefslogtreecommitdiffstats
path: root/Source/cmElseCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-07-10 15:38:38 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-07-10 15:38:38 (GMT)
commit32ad30e883bb8661d3fe5e6f0d969fc821c5f512 (patch)
tree0cad40c56a508980a6976390e984046b68d8298c /Source/cmElseCommand.cxx
parent9f6ebe4eb7d1294569cda4eb88f01ca7ae0e6815 (diff)
downloadCMake-32ad30e883bb8661d3fe5e6f0d969fc821c5f512.zip
CMake-32ad30e883bb8661d3fe5e6f0d969fc821c5f512.tar.gz
CMake-32ad30e883bb8661d3fe5e6f0d969fc821c5f512.tar.bz2
better error handling with if statements
Diffstat (limited to 'Source/cmElseCommand.cxx')
-rw-r--r--Source/cmElseCommand.cxx24
1 files changed, 10 insertions, 14 deletions
diff --git a/Source/cmElseCommand.cxx b/Source/cmElseCommand.cxx
index dd39690..2e309dd 100644
--- a/Source/cmElseCommand.cxx
+++ b/Source/cmElseCommand.cxx
@@ -28,22 +28,18 @@ bool cmElseCommand::InitialPass(std::vector<std::string> const& args)
return false;
}
+ // first remove any function blockers for the IF
+ m_Makefile->RemoveFunctionBlocker("ELSE",args);
+
// if is true create a blocker for the else
- if (isTrue)
- {
- cmIfFunctionBlocker *f = new cmIfFunctionBlocker();
- for(std::vector<std::string>::const_iterator j = args.begin();
- j != args.end(); ++j)
- {
- f->m_Args.push_back(*j);
- }
- m_Makefile->AddFunctionBlocker(f);
- }
- else
- {
- // remove any function blockers for this define
- m_Makefile->RemoveFunctionBlocker("ENDIF",args);
+ cmIfFunctionBlocker *f = new cmIfFunctionBlocker();
+ f->m_IsBlocking = isTrue;
+ for(std::vector<std::string>::const_iterator j = args.begin();
+ j != args.end(); ++j)
+ {
+ f->m_Args.push_back(*j);
}
+ m_Makefile->AddFunctionBlocker(f);
return true;
}