545b7ec29f2f841909ddbe82bea9b7d3e1a67c6b
[platform/upstream/cmake.git] / Modules / TestForSSTREAM.cmake
1 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2 # file Copyright.txt or https://cmake.org/licensing for details.
3
4 #[=======================================================================[.rst:
5 TestForSSTREAM
6 --------------
7
8 Test for compiler support of ANSI sstream header
9
10 check if the compiler supports the standard ANSI sstream header
11
12 ::
13
14   CMAKE_NO_ANSI_STRING_STREAM - defined by the results
15 #]=======================================================================]
16
17 if(NOT DEFINED CMAKE_HAS_ANSI_STRING_STREAM)
18   message(CHECK_START "Check for sstream")
19   try_compile(CMAKE_HAS_ANSI_STRING_STREAM  ${CMAKE_BINARY_DIR}
20     ${CMAKE_ROOT}/Modules/TestForSSTREAM.cxx
21     OUTPUT_VARIABLE OUTPUT)
22   if (CMAKE_HAS_ANSI_STRING_STREAM)
23     message(CHECK_PASS "found")
24     set (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL
25          "Does the compiler support sstream")
26     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
27       "Determining if the CXX compiler has sstream passed with "
28       "the following output:\n${OUTPUT}\n\n")
29   else ()
30     message(CHECK_FAIL "not found")
31     set (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
32        "Does the compiler support sstream")
33     file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
34       "Determining if the CXX compiler has sstream failed with "
35       "the following output:\n${OUTPUT}\n\n")
36   endif ()
37 endif()
38
39
40
41