1CMP0054
2-------
3
4.. versionadded:: 3.1
5
6Only interpret :command:`if` arguments as variables or keywords when unquoted.
7
8CMake 3.1 and above no longer implicitly dereference variables or
9interpret keywords in an :command:`if` command argument when
10it is a :ref:`Quoted Argument` or a :ref:`Bracket Argument`.
11
12The ``OLD`` behavior for this policy is to dereference variables and
13interpret keywords even if they are quoted or bracketed.
14The ``NEW`` behavior is to not dereference variables or interpret keywords
15that have been quoted or bracketed.
16
17Given the following partial example:
18
19::
20
21  set(A E)
22  set(E "")
23
24  if("${A}" STREQUAL "")
25    message("Result is TRUE before CMake 3.1 or when CMP0054 is OLD")
26  else()
27    message("Result is FALSE in CMake 3.1 and above if CMP0054 is NEW")
28  endif()
29
30After explicit expansion of variables this gives:
31
32::
33
34  if("E" STREQUAL "")
35
36With the policy set to ``OLD`` implicit expansion reduces this semantically to:
37
38::
39
40  if("" STREQUAL "")
41
42With the policy set to ``NEW`` the quoted arguments will not be
43further dereferenced:
44
45::
46
47  if("E" STREQUAL "")
48
49This policy was introduced in CMake version 3.1.
50CMake version |release| warns when the policy is not set and uses
51``OLD`` behavior.  Use the :command:`cmake_policy` command to set
52it to ``OLD`` or ``NEW`` explicitly.
53
54.. include:: DEPRECATED.txt
55