Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Modules / TestForANSIForScope.cmake
blob5d27bb421eb7fcb762f6b0ca64c07839554ebf08
1 # - Check for ANSI for scope support
2 # Check if the compiler supports std:: on stl classes.
3 #  CMAKE_NO_ANSI_FOR_SCOPE - holds result
6 IF("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")
7   MESSAGE(STATUS "Check for ANSI scope")
8   TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE  ${CMAKE_BINARY_DIR} 
9     ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx
10     OUTPUT_VARIABLE OUTPUT)
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     FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
16       "Determining if the CXX compiler understands ansi for scopes passed with "
17       "the following output:\n${OUTPUT}\n\n")
18   ELSE (CMAKE_ANSI_FOR_SCOPE)
19     MESSAGE(STATUS "Check for ANSI scope - not found")
20     SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL 
21       "Does the compiler support ansi for scope.")
22     FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
23       "Determining if the CXX compiler understands ansi for scopes failed with "
24       "the following output:\n${OUTPUT}\n\n")
25   ENDIF (CMAKE_ANSI_FOR_SCOPE)
26 ENDIF("CMAKE_ANSI_FOR_SCOPE" MATCHES "^CMAKE_ANSI_FOR_SCOPE$")