summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCCompiler.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-12-06 15:02:19 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-12-06 15:02:19 (GMT)
commit35fb6f22baa7b3f1ca9f7e29be41c4b91b14554a (patch)
treeefede790843f1b48a7eaddd52a919886970ce841 /Modules/CMakeDetermineCCompiler.cmake
parent19aa18fd2622ae22934a4a831c6de3b6af20f151 (diff)
downloadCMake-35fb6f22baa7b3f1ca9f7e29be41c4b91b14554a.zip
CMake-35fb6f22baa7b3f1ca9f7e29be41c4b91b14554a.tar.gz
CMake-35fb6f22baa7b3f1ca9f7e29be41c4b91b14554a.tar.bz2
fix for generator picked compilers
Diffstat (limited to 'Modules/CMakeDetermineCCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake16
1 files changed, 13 insertions, 3 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 72a2a03..2198675 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -6,6 +6,8 @@
# as a default compiler
IF(NOT CMAKE_C_COMPILER)
+ SET(CMAKE_CXX_COMPILER_INIT NOTFOUND)
+
# if the user has specified CC via the environment, then use that without checking
IF($ENV{CC} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
@@ -13,13 +15,21 @@ IF(NOT CMAKE_C_COMPILER)
ELSE(EXISTS ${CMAKE_C_COMPILER_INIT})
MESSAGE(SEND_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
ENDIF(EXISTS ${CMAKE_C_COMPILER_INIT})
- ELSE($ENV{CC} MATCHES ".+")
+ ENDIF($ENV{CC} MATCHES ".+")
+
+ IF(CMAKE_GENERATOR_CC)
+ IF(NOT CMAKE_CC_COMPILER_INIT)
+ SET(CMAKE_CC_COMPILER_INIT ${CMAKE_GENERATOR_CC})
+ ENDIF(NOT CMAKE_CC_COMPILER_INIT)
+ ENDIF(CMAKE_GENERATOR_CC)
+
+ IF(NOT CMAKE_CC_COMPILER_INIT)
# if not in the envionment then search for the compiler in the path
- SET(CMAKE_C_COMPILER_LIST ${CMAKE_GENERATOR_CC} gcc cc cl bcc )
+ SET(CMAKE_C_COMPILER_LIST gcc cc cl bcc )
FIND_PROGRAM(CMAKE_C_COMPILER_FULLPATH NAMES ${CMAKE_C_COMPILER_LIST} )
GET_FILENAME_COMPONENT(CMAKE_C_COMPILER_INIT
${CMAKE_C_COMPILER_FULLPATH} NAME)
- ENDIF($ENV{CC} MATCHES ".+")
+ ENDIF(NOT CMAKE_CC_COMPILER_INIT)
# set this to notfound right after so that it is searched for each time this
# file is included
SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_INIT} CACHE STRING "C compiler")