CMP0070.rst 1.1 KB

12345678910111213141516171819202122232425
  1. CMP0070
  2. -------
  3. Define :command:`file(GENERATE)` behavior for relative paths.
  4. CMake 3.10 and newer define that relative paths given to ``INPUT`` and
  5. ``OUTPUT`` arguments of ``file(GENERATE)`` are interpreted relative to the
  6. current source and binary directories, respectively. CMake 3.9 and lower did
  7. not define any behavior for relative paths but did not diagnose them either
  8. and accidentally treated them relative to the process working directory.
  9. Policy ``CMP0070`` provides compatibility with projects that used the old
  10. undefined behavior.
  11. This policy affects behavior of relative paths given to ``file(GENERATE)``.
  12. The ``OLD`` behavior for this policy is to treat the paths relative to the
  13. working directory of CMake. The ``NEW`` behavior for this policy is to
  14. interpret relative paths with respect to the current source or binary
  15. directory of the caller.
  16. This policy was introduced in CMake version 3.10. CMake version
  17. |release| warns when the policy is not set and uses ``OLD`` behavior.
  18. Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
  19. explicitly.
  20. .. include:: DEPRECATED.txt