CMP0011.rst 1.2 KB

12345678910111213141516171819202122232425
  1. CMP0011
  2. -------
  3. Included scripts do automatic :command:`cmake_policy` PUSH and POP.
  4. In CMake 2.6.2 and below, CMake Policy settings in scripts loaded by
  5. the :command:`include` and :command:`find_package` commands would affect
  6. the includer. Explicit invocations of ``cmake_policy(PUSH)`` and
  7. ``cmake_policy(POP)`` were required to isolate policy changes and protect
  8. the includer. While some scripts intend to affect the policies of their
  9. includer, most do not. In CMake 2.6.3 and above, :command:`include` and
  10. :command:`find_package` by default ``PUSH`` and ``POP`` an entry on
  11. the policy stack around an included
  12. script, but provide a ``NO_POLICY_SCOPE`` option to disable it. This
  13. policy determines whether or not to imply ``NO_POLICY_SCOPE`` for
  14. compatibility. The ``OLD`` behavior for this policy is to imply
  15. ``NO_POLICY_SCOPE`` for :command:`include` and :command:`find_package` commands.
  16. The ``NEW`` behavior for this policy is to allow the commands to do
  17. their default cmake_policy ``PUSH`` and ``POP``.
  18. This policy was introduced in CMake version 2.6.3. CMake version
  19. |release| warns when the policy is not set and uses ``OLD`` behavior. Use
  20. the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
  21. .. include:: DEPRECATED.txt