diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-10-22 22:17:07 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-10-22 22:17:07 (GMT) |
commit | da460f9008f5a949f663e749455e15fb5959d803 (patch) | |
tree | b4e9e7f1df292d53b2c8ab8274d87510fe5a6f64 /Modules/CMakeDetermineCXXCompiler.cmake | |
parent | 0692323fe0f0bbbb5ba325e21d0f155717436f84 (diff) | |
download | CMake-da460f9008f5a949f663e749455e15fb5959d803.zip CMake-da460f9008f5a949f663e749455e15fb5959d803.tar.gz CMake-da460f9008f5a949f663e749455e15fb5959d803.tar.bz2 |
test for gnu compiler
Diffstat (limited to 'Modules/CMakeDetermineCXXCompiler.cmake')
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 72ee90a..5b09e85 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -3,3 +3,12 @@ # loading this file to force a compiler. FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES $ENV{CXX} c++ g++ CC aCC cl bcc PATHS /bin /usr/bin /usr/local/bin ) + +# test to see if the cxx compiler is gnu +EXEC_PROGRAM(${CMAKE_CXX_COMPILER} ARGS -E ${CMAKE_ROOT}/Modules/CMakeTestGNU.c OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN) + +IF(NOT CMAKE_COMPILER_RETURN) + IF(${CMAKE_COMPILER_OUTPUT} MATCHES ".*THIS_IS_GNU.*" ) + SET(CMAKE_COMPILER_IS_GNUGXX 1) + ENDIF(${CMAKE_COMPILER_OUTPUT} MATCHES ".*THIS_IS_GNU.*" ) +ENDIF(NOT CMAKE_COMPILER_RETURN) |