TestForANSIForScope.cmake 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. # - Check for ANSI for scope support
  2. # Check if the compiler supports std:: on stl classes.
  3. # CMAKE_NO_STD_NAMESPACE - holds result
  4. #
  5. IF("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
  6. MESSAGE(STATUS "Check for ANSI scope")
  7. TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE ${CMAKE_BINARY_DIR}
  8. ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx
  9. OUTPUT_VARIABLE OUTPUT)
  10. IF (CMAKE_ANSI_FOR_SCOPE)
  11. MESSAGE(STATUS "Check for ANSI scope - found")
  12. SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
  13. "Does the compiler support ansi for scope.")
  14. FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
  15. "Determining if the CXX compiler understands ansi for scopes passed with "
  16. "the following output:\n${OUTPUT}\n\n")
  17. ELSE (CMAKE_ANSI_FOR_SCOPE)
  18. MESSAGE(STATUS "Check for ANSI scope - not found")
  19. SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
  20. "Does the compiler support ansi for scope.")
  21. FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
  22. "Determining if the CXX compiler understands ansi for scopes failed with "
  23. "the following output:\n${OUTPUT}\n\n")
  24. ENDIF (CMAKE_ANSI_FOR_SCOPE)
  25. ENDIF("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")