TestForSSTREAM.cmake 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #.rst:
  2. # TestForSSTREAM
  3. # --------------
  4. #
  5. # Test for compiler support of ANSI sstream header
  6. #
  7. # check if the compiler supports the standard ANSI sstream header
  8. #
  9. # ::
  10. #
  11. # CMAKE_NO_ANSI_STRING_STREAM - defined by the results
  12. #=============================================================================
  13. # Copyright 2006-2009 Kitware, Inc.
  14. #
  15. # Distributed under the OSI-approved BSD License (the "License");
  16. # see accompanying file Copyright.txt for details.
  17. #
  18. # This software is distributed WITHOUT ANY WARRANTY; without even the
  19. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20. # See the License for more information.
  21. #=============================================================================
  22. # (To distribute this file outside of CMake, substitute the full
  23. # License text for the above reference.)
  24. if(NOT DEFINED CMAKE_HAS_ANSI_STRING_STREAM)
  25. message(STATUS "Check for sstream")
  26. try_compile(CMAKE_HAS_ANSI_STRING_STREAM ${CMAKE_BINARY_DIR}
  27. ${CMAKE_ROOT}/Modules/TestForSSTREAM.cxx
  28. OUTPUT_VARIABLE OUTPUT)
  29. if (CMAKE_HAS_ANSI_STRING_STREAM)
  30. message(STATUS "Check for sstream - found")
  31. set (CMAKE_NO_ANSI_STRING_STREAM 0 CACHE INTERNAL
  32. "Does the compiler support sstream")
  33. file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
  34. "Determining if the CXX compiler has sstream passed with "
  35. "the following output:\n${OUTPUT}\n\n")
  36. else ()
  37. message(STATUS "Check for sstream - not found")
  38. set (CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
  39. "Does the compiler support sstream")
  40. file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
  41. "Determining if the CXX compiler has sstream failed with "
  42. "the following output:\n${OUTPUT}\n\n")
  43. endif ()
  44. endif()