TestForANSIForScope.cmake 809 B

12345678910111213141516171819202122232425
  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(NOT CMAKE_ANSI_FOR_SCOPE)
  7. MESSAGE(STATUS "Check for ANSI scope")
  8. TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE ${PROJECT_BINARY_DIR}
  9. ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx
  10. CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CMAKE_ANSI_CXXFLAGS})
  11. IF (CMAKE_ANSI_FOR_SCOPE)
  12. MESSAGE(STATUS "Check for ANSI scope - found")
  13. SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
  14. "Does the compiler support ansi for scope.")
  15. ELSE (CMAKE_ANSI_FOR_SCOPE)
  16. MESSAGE(STATUS "Check for ANSI scope - not found")
  17. SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
  18. "Does the compiler support ansi for scope.")
  19. ENDIF (CMAKE_ANSI_FOR_SCOPE)
  20. ENDIF(NOT CMAKE_ANSI_FOR_SCOPE)