CMP0075.rst 1.0 KB

1234567891011121314151617181920212223242526
  1. CMP0075
  2. -------
  3. Include file check macros honor ``CMAKE_REQUIRED_LIBRARIES``.
  4. In CMake 3.12 and above, the
  5. * ``check_include_file`` macro in the :module:`CheckIncludeFile` module, the
  6. * ``check_include_file_cxx`` macro in the
  7. :module:`CheckIncludeFileCXX` module, and the
  8. * ``check_include_files`` macro in the :module:`CheckIncludeFiles` module
  9. now prefer to link the check executable to the libraries listed in the
  10. ``CMAKE_REQUIRED_LIBRARIES`` variable. This policy provides compatibility
  11. with projects that have not been updated to expect this behavior.
  12. The ``OLD`` behavior for this policy is to ignore ``CMAKE_REQUIRED_LIBRARIES``
  13. in the include file check macros. The ``NEW`` behavior of this policy is to
  14. honor ``CMAKE_REQUIRED_LIBRARIES`` in the include file check macros.
  15. This policy was introduced in CMake version 3.12. CMake version
  16. |release| warns when the policy is not set and uses ``OLD`` behavior.
  17. Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
  18. explicitly.
  19. .. include:: DEPRECATED.txt