summaryrefslogtreecommitdiffstats
path: root/Source/cmConditionEvaluator.h
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2014-09-04 18:21:28 (GMT)
committerNils Gladitz <nilsgladitz@gmail.com>2014-09-11 19:23:17 (GMT)
commit188a1f236e1594fc46163fbad5e062e3978c1e5a (patch)
treeee62bcd7bc77a1defe2080a17451c01a985d293a /Source/cmConditionEvaluator.h
parentb900c1ccaae7a500dda88240873122d0d899bf93 (diff)
downloadCMake-188a1f236e1594fc46163fbad5e062e3978c1e5a.zip
CMake-188a1f236e1594fc46163fbad5e062e3978c1e5a.tar.gz
CMake-188a1f236e1594fc46163fbad5e062e3978c1e5a.tar.bz2
If: Introduce policy CMP0054 - don't dereference quoted variables in if()
Diffstat (limited to 'Source/cmConditionEvaluator.h')
-rw-r--r--Source/cmConditionEvaluator.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h
index 9076988..01624f9 100644
--- a/Source/cmConditionEvaluator.h
+++ b/Source/cmConditionEvaluator.h
@@ -13,36 +13,41 @@
#define cmConditionEvaluator_h
#include "cmCommand.h"
+#include "cmExpandedCommandArgument.h"
class cmConditionEvaluator
{
public:
- typedef std::list<std::string> cmArgumentList;
+ typedef std::list<cmExpandedCommandArgument> cmArgumentList;
cmConditionEvaluator(cmMakefile& makefile);
// this is a shared function for both If and Else to determine if the
// arguments were valid, and if so, was the response true. If there is
// an error, the errorString will be set.
- bool IsTrue(const std::vector<std::string> &args,
+ bool IsTrue(const std::vector<cmExpandedCommandArgument> &args,
std::string &errorString,
cmake::MessageType &status);
private:
+ // Filter the given variable definition based on policy CMP0054.
+ const char* GetDefinitionIfUnquoted(
+ const cmExpandedCommandArgument& argument) const;
+
const char* GetVariableOrString(
- const std::string& argument) const;
+ const cmExpandedCommandArgument& argument) const;
bool IsKeyword(std::string const& keyword,
- std::string& argument) const;
+ cmExpandedCommandArgument& argument) const;
bool GetBooleanValue(
- std::string& arg) const;
+ cmExpandedCommandArgument& arg) const;
bool GetBooleanValueOld(
- std::string const& arg, bool one) const;
+ cmExpandedCommandArgument const& arg, bool one) const;
bool GetBooleanValueWithAutoDereference(
- std::string &newArg,
+ cmExpandedCommandArgument &newArg,
std::string &errorString,
cmake::MessageType &status,
bool oneArg = false) const;
@@ -85,6 +90,7 @@ private:
cmMakefile& Makefile;
cmPolicies::PolicyStatus Policy12Status;
+ cmPolicies::PolicyStatus Policy54Status;
};
#endif