TestForANSIStreamHeaders.cmake 932 B

1234567891011121314151617181920212223242526272829303132
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #.rst:
  4. # TestForANSIStreamHeaders
  5. # ------------------------
  6. #
  7. # Test for compiler support of ANSI stream headers iostream, etc.
  8. #
  9. # check if the compiler supports the standard ANSI iostream header
  10. # (without the .h)
  11. #
  12. # ::
  13. #
  14. # CMAKE_NO_ANSI_STREAM_HEADERS - defined by the results
  15. include(${CMAKE_CURRENT_LIST_DIR}/CheckIncludeFileCXX.cmake)
  16. if(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
  17. CHECK_INCLUDE_FILE_CXX(iostream CMAKE_ANSI_STREAM_HEADERS)
  18. if (CMAKE_ANSI_STREAM_HEADERS)
  19. set (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL
  20. "Does the compiler support headers like iostream.")
  21. else ()
  22. set (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL
  23. "Does the compiler support headers like iostream.")
  24. endif ()
  25. mark_as_advanced(CMAKE_NO_ANSI_STREAM_HEADERS)
  26. endif()