TestForANSIStreamHeaders.cmake 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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. Test for compiler support of ANSI stream headers iostream, etc.
  7. check if the compiler supports the standard ANSI iostream header
  8. (without the .h)
  9. ::
  10. CMAKE_NO_ANSI_STREAM_HEADERS - defined by the results
  11. #]=======================================================================]
  12. include(${CMAKE_CURRENT_LIST_DIR}/CheckIncludeFileCXX.cmake)
  13. if(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
  14. CHECK_INCLUDE_FILE_CXX(iostream CMAKE_ANSI_STREAM_HEADERS)
  15. if (CMAKE_ANSI_STREAM_HEADERS)
  16. set (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL
  17. "Does the compiler support headers like iostream.")
  18. else ()
  19. set (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL
  20. "Does the compiler support headers like iostream.")
  21. endif ()
  22. mark_as_advanced(CMAKE_NO_ANSI_STREAM_HEADERS)
  23. endif()