summaryrefslogtreecommitdiffstats
path: root/Source/cmIfCommand.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-08-29 15:58:38 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-08-29 15:58:38 (GMT)
commite80acd971cdbd159140e1da76944258f437b96f4 (patch)
tree3f5918085b0411e2f036502040c1f5948e8881e8 /Source/cmIfCommand.cxx
parentfb43c6447606913ed0afca03c5018e6339e191ea (diff)
downloadCMake-e80acd971cdbd159140e1da76944258f437b96f4.zip
CMake-e80acd971cdbd159140e1da76944258f437b96f4.tar.gz
CMake-e80acd971cdbd159140e1da76944258f437b96f4.tar.bz2
ENH: also store the group matches from IF( MATCHES) in CMAKE_MATCH_(0..9)
Alex
Diffstat (limited to 'Source/cmIfCommand.cxx')
-rw-r--r--Source/cmIfCommand.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index cdcf79d..12d156c 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -15,6 +15,8 @@
=========================================================================*/
#include "cmIfCommand.h"
+#include "cmStringCommand.h"
+
#include <stdlib.h> // required for atof
#include <list>
#include <cmsys/RegularExpression.hxx>
@@ -215,7 +217,7 @@ namespace
bool cmIfCommand::IsTrue(const std::vector<std::string> &args,
- char **errorString, const cmMakefile *makefile)
+ char **errorString, cmMakefile *makefile)
{
// check for the different signatures
const char *def;
@@ -369,6 +371,7 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args,
{
def = cmIfCommand::GetVariableOrString(arg->c_str(), makefile);
const char* rex = (argP2)->c_str();
+ cmStringCommand::ClearMatches(makefile);
cmsys::RegularExpression regEntry;
if ( !regEntry.compile(rex) )
{
@@ -382,6 +385,7 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args,
if (regEntry.find(def))
{
*arg = "1";
+ cmStringCommand::StoreMatches(makefile, regEntry);
}
else
{