1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
5 #include "cmConfigure.h" // IWYU pragma: keep
10 #include <cmext/string_view>
12 #include "cmListFileCache.h"
13 #include "cmMessageType.h" // IWYU pragma: keep
14 #include "cmPolicies.h"
17 class cmExpandedCommandArgument
;
20 class cmConditionEvaluator
23 cmConditionEvaluator(cmMakefile
& makefile
, cmListFileBacktrace bt
);
25 // this is a shared function for both If and Else to determine if the
26 // arguments were valid, and if so, was the response true. If there is
27 // an error, the errorString will be set.
28 bool IsTrue(const std::vector
<cmExpandedCommandArgument
>& args
,
29 std::string
& errorString
, MessageType
& status
);
34 // Filter the given variable definition based on policy CMP0054.
35 cmValue
GetDefinitionIfUnquoted(
36 const cmExpandedCommandArgument
& argument
) const;
38 cmValue
GetVariableOrString(const cmExpandedCommandArgument
& argument
) const;
40 bool IsKeyword(cm::static_string_view keyword
,
41 const cmExpandedCommandArgument
& argument
) const;
43 bool GetBooleanValue(cmExpandedCommandArgument
& arg
) const;
45 bool GetBooleanValueOld(cmExpandedCommandArgument
const& arg
,
48 bool GetBooleanValueWithAutoDereference(cmExpandedCommandArgument
& newArg
,
49 std::string
& errorString
,
51 bool oneArg
= false) const;
54 int matchKeysImpl(const cmExpandedCommandArgument
&);
56 template <int N
, typename T
, typename
... Keys
>
57 int matchKeysImpl(const cmExpandedCommandArgument
&, T
, Keys
...);
59 template <typename
... Keys
>
60 int matchKeys(const cmExpandedCommandArgument
&, Keys
...);
62 bool HandleLevel0(cmArgumentList
& newArgs
, std::string
& errorString
,
65 bool HandleLevel1(cmArgumentList
& newArgs
, std::string
&, MessageType
&);
67 bool HandleLevel2(cmArgumentList
& newArgs
, std::string
& errorString
,
70 bool HandleLevel3(cmArgumentList
& newArgs
, std::string
& errorString
,
73 bool HandleLevel4(cmArgumentList
& newArgs
, std::string
& errorString
,
77 cmListFileBacktrace Backtrace
;
78 cmPolicies::PolicyStatus Policy12Status
;
79 cmPolicies::PolicyStatus Policy54Status
;
80 cmPolicies::PolicyStatus Policy57Status
;
81 cmPolicies::PolicyStatus Policy64Status
;
82 cmPolicies::PolicyStatus Policy139Status
;