TestForSTDNamespace.cmake 1.1 KB

1234567891011121314151617181920212223242526272829
  1. #
  2. # check if the compiler supports std:: on stl classes
  3. #
  4. # CMAKE_NO_STD_NAMESPACE - defined accoreding to the results
  5. #
  6. IF("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")
  7. MESSAGE(STATUS "Check for STD namespace")
  8. TRY_COMPILE(CMAKE_STD_NAMESPACE ${CMAKE_BINARY_DIR}
  9. ${CMAKE_ROOT}/Modules/TestForSTDNamespace.cxx)
  10. IF (CMAKE_STD_NAMESPACE)
  11. MESSAGE(STATUS "Check for STD namespace - found")
  12. SET (CMAKE_NO_STD_NAMESPACE 0 CACHE INTERNAL
  13. "Does the compiler support std::.")
  14. FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
  15. "Determining if the CXX compiler has std namespace passed with "
  16. "the following output:\n${OUTPUT}\n\n")
  17. ELSE (CMAKE_STD_NAMESPACE)
  18. MESSAGE(STATUS "Check for STD namespace - not found")
  19. SET (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL
  20. "Does the compiler support std::.")
  21. FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
  22. "Determining if the CXX compiler has std namespace failed with "
  23. "the following output:\n${OUTPUT}\n\n")
  24. ENDIF (CMAKE_STD_NAMESPACE)
  25. ENDIF("CMAKE_STD_NAMESPACE" MATCHES "^CMAKE_STD_NAMESPACE$")