TestForSSTREAM.cmake 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. # TestForSSTREAM
  5. # --------------
  6. #
  7. # Test for compiler support of ANSI sstream header
  8. #
  9. # check if the compiler supports the standard ANSI sstream header
  10. #
  11. # ::
  12. #
  13. # CMAKE_NO_ANSI_STRING_STREAM - defined by the results
  14. if(NOT DEFINED CMAKE_HAS_ANSI_STRING_STREAM)
  15. message(STATUS "Check for sstream")
  16. try_compile(CMAKE_HAS_ANSI_STRING_STREAM ${CMAKE_BINARY_DIR}
  17. ${CMAKE_ROOT}/Modules/TestForSSTREAM.cxx
  18. OUTPUT_VARIABLE OUTPUT)
  19. if (CMAKE_HAS_ANSI_STRING_STREAM)
  20. message(STATUS "Check for sstream - found")
  21. set (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL
  22. "Does the compiler support sstream")
  23. file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
  24. "Determining if the CXX compiler has sstream passed with "
  25. "the following output:\n${OUTPUT}\n\n")
  26. else ()
  27. message(STATUS "Check for sstream - not found")
  28. set (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
  29. "Does the compiler support sstream")
  30. file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
  31. "Determining if the CXX compiler has sstream failed with "
  32. "the following output:\n${OUTPUT}\n\n")
  33. endif ()
  34. endif()