TestForANSIStreamHeaders.cmake 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. # - Test for compiler support of ANSI stream headers iostream, etc.
  2. # check if the compiler supports the standard ANSI iostream header (without the .h)
  3. # CMAKE_NO_ANSI_STREAM_HEADERS - defined by the results
  4. #
  5. #=============================================================================
  6. # Copyright 2002-2009 Kitware, Inc.
  7. #
  8. # Distributed under the OSI-approved BSD License (the "License");
  9. # see accompanying file Copyright.txt for details.
  10. #
  11. # This software is distributed WITHOUT ANY WARRANTY; without even the
  12. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. # See the License for more information.
  14. #=============================================================================
  15. # (To distribute this file outside of CMake, substitute the full
  16. # License text for the above reference.)
  17. INCLUDE(CheckIncludeFileCXX)
  18. IF(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
  19. CHECK_INCLUDE_FILE_CXX(iostream CMAKE_ANSI_STREAM_HEADERS)
  20. IF (CMAKE_ANSI_STREAM_HEADERS)
  21. SET (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL
  22. "Does the compiler support headers like iostream.")
  23. ELSE (CMAKE_ANSI_STREAM_HEADERS)
  24. SET (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL
  25. "Does the compiler support headers like iostream.")
  26. ENDIF (CMAKE_ANSI_STREAM_HEADERS)
  27. MARK_AS_ADVANCED(CMAKE_NO_ANSI_STREAM_HEADERS)
  28. ENDIF(NOT CMAKE_NO_ANSI_STREAM_HEADERS)