summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCCompiler.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-11-08 22:24:45 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-11-08 22:24:45 (GMT)
commitf54bfe467c8988c7281a493a39b609e719c20c81 (patch)
treef3c440ca2202f490209db5bd7b0206fa6e153cd1 /Modules/CMakeDetermineCCompiler.cmake
parentf5d95fb078ec48755762931fe2882ed1cbe1171e (diff)
downloadCMake-f54bfe467c8988c7281a493a39b609e719c20c81.zip
CMake-f54bfe467c8988c7281a493a39b609e719c20c81.tar.gz
CMake-f54bfe467c8988c7281a493a39b609e719c20c81.tar.bz2
store the compiler in the cache
Diffstat (limited to 'Modules/CMakeDetermineCCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake14
1 files changed, 9 insertions, 5 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 1432fff..aac39a8 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -5,11 +5,15 @@
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
# as a default compiler
-FIND_PROGRAM(CMAKE_C_COMPILER_FULLPATH NAMES $ENV{CC} ${CMAKE_GENERATOR_CC} gcc cc cl bcc )
-GET_FILENAME_COMPONENT(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_FULLPATH} NAME_WE)
-# set this to notfound right after so that it is searched for each time this
-# file is included
-SET(CMAKE_C_COMPILER_FULLPATH NOTFOUND CACHE INTERNAL "full path to c compiler" FORCE)
+IF(NOT CMAKE_C_COMPILER)
+ FIND_PROGRAM(CMAKE_C_COMPILER_FULLPATH NAMES $ENV{CC} ${CMAKE_GENERATOR_CC} gcc cc cl bcc )
+ GET_FILENAME_COMPONENT(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_FULLPATH} NAME_WE)
+ # set this to notfound right after so that it is searched for each time this
+ # file is included
+ SET(CMAKE_C_COMPILER_FULLPATH NOTFOUND CACHE INTERNAL "full path to c compiler" FORCE)
+ SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING "C++ compiler")
+ENDIF(NOT CMAKE_C_COMPILER)
+MARK_AS_ADVANCED(CMAKE_C_COMPILER)
FIND_PROGRAM(CMAKE_AR NAMES ar PATHS /bin /usr/bin /usr/local/bin)
FIND_PROGRAM(CMAKE_RANLIB NAMES ranlib PATHS /bin /usr/bin /usr/local/bin)