Imported Upstream version 2.8.9
[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(CheckIncludeFileCXX)
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 (CMAKE_ANSI_STREAM_HEADERS)   
27     SET (CMAKE_NO_ANSI_STREAM_HEADERS 1 CACHE INTERNAL 
28        "Does the compiler support headers like iostream.")
29   ENDIF (CMAKE_ANSI_STREAM_HEADERS)
30
31   MARK_AS_ADVANCED(CMAKE_NO_ANSI_STREAM_HEADERS)
32 ENDIF(NOT CMAKE_NO_ANSI_STREAM_HEADERS)
33
34