summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmAlgorithms.h2
-rw-r--r--Source/cmConditionEvaluator.cxx10
3 files changed, 12 insertions, 2 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index e147247..d3b2ff5 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 4)
-set(CMake_VERSION_PATCH 20160201)
+set(CMake_VERSION_PATCH 20160202)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index 54617f3..bb65ea5 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -230,7 +230,7 @@ template<typename Range>
std::string cmJoin(Range const& r, std::string delimiter)
{
return cmJoin(r, delimiter.c_str());
-};
+}
template<typename Range>
typename Range::const_iterator cmRemoveN(Range& r, size_t n)
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index 5330acd..6a0ebec 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -12,6 +12,7 @@
#include "cmConditionEvaluator.h"
#include "cmOutputConverter.h"
+#include "cmAlgorithms.h"
cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile,
const cmListFileContext &context,
@@ -578,6 +579,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList &newArgs,
cmake::MessageType &status)
{
int reducible;
+ std::string def_buf;
const char *def;
const char *def2;
do
@@ -594,6 +596,14 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList &newArgs,
IsKeyword("MATCHES", *argP1))
{
def = this->GetVariableOrString(*arg);
+ if (def != arg->c_str() // yes, we compare the pointer value
+ && cmHasLiteralPrefix(arg->GetValue(), "CMAKE_MATCH_"))
+ {
+ // The string to match is owned by our match result variables.
+ // Move it to our own buffer before clearing them.
+ def_buf = def;
+ def = def_buf.c_str();
+ }
const char* rex = argP2->c_str();
this->Makefile.ClearMatches();
cmsys::RegularExpression regEntry;