1
0

TestForSSTREAM.cmake 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # - Test for compiler support of ANSI sstream header
  2. # check if the compiler supports the standard ANSI sstream header
  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 distribute 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 ()
  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 ()
  37. endif()