Imported Upstream version 2.8.11.2
[platform/upstream/cmake.git] / Modules / TestForANSIStreamHeaders.cmake
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 #=============================================================================
7 # Copyright 2002-2009 Kitware, Inc.
8 #
9 # Distributed under the OSI-approved BSD License (the "License");
10 # see accompanying file Copyright.txt for details.
11 #
12 # This software is distributed WITHOUT ANY WARRANTY; without even the
13 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 # See the License for more information.
15 #=============================================================================
16 # (To distribute this file outside of CMake, substitute the full
17 #  License text for the above reference.)
18
19 include(${CMAKE_CURRENT_LIST_DIR}/CheckIncludeFileCXX.cmake)
20
21 if(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
22   CHECK_INCLUDE_FILE_CXX(iostream CMAKE_ANSI_STREAM_HEADERS)
23   if (CMAKE_ANSI_STREAM_HEADERS)
24     set (CMAKE_NO_ANSI_STREAM_HEADERS 0 CACHE INTERNAL
25          "Does the compiler support headers like iostream.")
26   else ()
27     set (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL
28        "Does the compiler support headers like iostream.")
29   endif ()
30
31   mark_as_advanced(CMAKE_NO_ANSI_STREAM_HEADERS)
32 endif()
33
34