TestForSSTREAM.cmake 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # # - Test for std:: namespace support
  2. # check if the compiler supports std:: on stl classes
  3. # CMAKE_NO_ANSI_STRING_STREAM - defined by the results
  4. #
  5. #=============================================================================
  6. # Copyright 2006-2009 Kitware, Inc.
  7. #
  8. # Distributed under the OSI-approved BSD License (the "License");
  9. # see accompanying file Copyright.txt for details.
  10. #
  11. # This software is distributed WITHOUT ANY WARRANTY; without even the
  12. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. # See the License for more information.
  14. #=============================================================================
  15. # (To distributed this file outside of CMake, substitute the full
  16. # License text for the above reference.)
  17. IF("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")
  18. MESSAGE(STATUS "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(STATUS "Check for sstream - 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 (CMAKE_HAS_ANSI_STRING_STREAM)
  30. MESSAGE(STATUS "Check for sstream - 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 (CMAKE_HAS_ANSI_STRING_STREAM)
  37. ENDIF("CMAKE_HAS_ANSI_STRING_STREAM" MATCHES "^CMAKE_HAS_ANSI_STRING_STREAM$")