summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCXXCompiler.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-11-19 17:18:12 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-11-19 17:18:12 (GMT)
commit9b14032ab4188a1ed31c33d0b297a36aa6e2f85c (patch)
treec181e526501cf08665640e2b8fcc8860ced2790a /Modules/CMakeDetermineCXXCompiler.cmake
parent1a2a600a55dfce4f4741245ae31fcf0f227d3a21 (diff)
downloadCMake-9b14032ab4188a1ed31c33d0b297a36aa6e2f85c.zip
CMake-9b14032ab4188a1ed31c33d0b297a36aa6e2f85c.tar.gz
CMake-9b14032ab4188a1ed31c33d0b297a36aa6e2f85c.tar.bz2
BUG: fix handling of CXX
Diffstat (limited to 'Modules/CMakeDetermineCXXCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake17
1 files changed, 14 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 494f016..1fcdbec 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -6,9 +6,20 @@
# as a default compiler
IF(NOT CMAKE_CXX_COMPILER)
- FIND_PROGRAM(CMAKE_CXX_COMPILER_FULLPATH NAMES $ENV{CXX} ${CMAKE_GENERATOR_CXX} c++ g++ CC aCC cl bcc )
- GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_FULLPATH} NAME)
- SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING "C++ compiler")
+ SET(CMAKE_CXX_COMPILER_LIST ${CMAKE_GENERATOR_CXX} c++ g++ CC aCC cl bcc )
+ IF($ENV{CXX} MATCHES ".+")
+ SET(CMAKE_CXX_COMPILER_LIST $ENV{CXX})
+ ENDIF($ENV{CXX} MATCHES ".+")
+ FIND_PROGRAM(CMAKE_CXX_COMPILER_FULLPATH NAMES ${CMAKE_CXX_COMPILER_LIST})
+ GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER_INIT
+ ${CMAKE_CXX_COMPILER_FULLPATH} NAME)
+ SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_INIT}
+ CACHE STRING "C++ compiler")
+ IF($ENV{CXX} MATCHES ".+")
+ IF(NOT CMAKE_CXX_COMPILER)
+ MESSAGE(SEND_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}, make sure CXX does not have flags in it, use CXXFLAGS instead.")
+ ENDIF(NOT CMAKE_CXX_COMPILER)
+ ENDIF($ENV{CXX} MATCHES ".+")
ENDIF(NOT CMAKE_CXX_COMPILER)
MARK_AS_ADVANCED(CMAKE_CXX_COMPILER)