CMP0012.rst 1.2 KB

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