TestForSSTREAM.cmake 1.4 KB

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