1CMP0012
2-------
3
4:command:`if` recognizes numbers and boolean constants.
5
6In CMake versions 2.6.4 and lower the :command:`if` command implicitly
7dereferenced arguments corresponding to variables, even those named
8like numbers or boolean constants, except for ``0`` and ``1``.  Numbers and
9boolean constants such as ``true``, ``false``, ``yes``, ``no``, ``on``,
10``off``, ``y``, ``n``, ``notfound``, ``ignore`` (all case insensitive)
11were recognized in some cases but not all.  For example, the code ``if(TRUE)``
12might have evaluated as ``false``.
13Numbers such as 2 were recognized only in boolean expressions
14like ``if(NOT 2)`` (leading to ``false``) but not as a single-argument like
15``if(2)`` (also leading to ``false``).  Later versions of CMake prefer to
16treat numbers and boolean constants literally, so they should not be
17used as variable names.
18
19The ``OLD`` behavior for this policy is to implicitly dereference
20variables named like numbers and boolean constants.  The ``NEW`` behavior
21for this policy is to recognize numbers and boolean constants without
22dereferencing variables with such names.
23
24This policy was introduced in CMake version 2.8.0.  CMake version
25|release| warns when the policy is not set and uses ``OLD`` behavior.  Use
26the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
27
28.. include:: DEPRECATED.txt
29