summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCCompiler.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeDetermineCCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake17
1 files changed, 5 insertions, 12 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 5c7bec5..9ebf0b3 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -31,6 +31,8 @@
# If not already set before, it also sets
# _CMAKE_TOOLCHAIN_PREFIX
+INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
+
IF(NOT CMAKE_C_COMPILER)
SET(CMAKE_C_COMPILER_INIT NOTFOUND)
@@ -53,21 +55,12 @@ IF(NOT CMAKE_C_COMPILER)
ENDIF(CMAKE_GENERATOR_CC)
# finally list compilers to try
- IF(CMAKE_C_COMPILER_INIT)
- SET(CMAKE_C_COMPILER_LIST ${CMAKE_C_COMPILER_INIT})
- ELSE(CMAKE_C_COMPILER_INIT)
+ IF(NOT CMAKE_C_COMPILER_INIT)
SET(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gcc ${_CMAKE_TOOLCHAIN_PREFIX}cc cl bcc xlc clang)
- ENDIF(CMAKE_C_COMPILER_INIT)
+ ENDIF()
- # Find the compiler.
- IF (_CMAKE_USER_CXX_COMPILER_PATH)
- FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} PATHS ${_CMAKE_USER_CXX_COMPILER_PATH} DOC "C compiler" NO_DEFAULT_PATH)
- ENDIF (_CMAKE_USER_CXX_COMPILER_PATH)
- FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} DOC "C compiler")
+ _cmake_find_compiler(C)
- IF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER)
- SET(CMAKE_C_COMPILER "${CMAKE_C_COMPILER_INIT}" CACHE FILEPATH "C compiler" FORCE)
- ENDIF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER)
ELSE(NOT CMAKE_C_COMPILER)
# we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt