summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCCompiler.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-05-21 14:58:04 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-05-21 14:58:04 (GMT)
commitc8dd1caff941ac4f56bf7422437fc0982ab6043b (patch)
tree035892cba6854dcf50571b45829d550b8c4f222a /Modules/CMakeDetermineCCompiler.cmake
parent3b4aa3bf3581dc81fbdd307b9ed432a8a306a514 (diff)
downloadCMake-c8dd1caff941ac4f56bf7422437fc0982ab6043b.zip
CMake-c8dd1caff941ac4f56bf7422437fc0982ab6043b.tar.gz
CMake-c8dd1caff941ac4f56bf7422437fc0982ab6043b.tar.bz2
BUG: don't fail if a compiler is given in CMAKE_C/CXX_COMPILER but it can't
be found in the path Alex
Diffstat (limited to 'Modules/CMakeDetermineCCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 0ee390b..fd46bd6 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -63,12 +63,17 @@ IF(NOT CMAKE_C_COMPILER)
ELSE(NOT CMAKE_C_COMPILER)
# if a compiler was specified by the user but without path,
- # now try to find it with the full path and force it into the cache
+ # now try to find it with the full path
+ # if it is found, force it into the cache,
+ # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
+ # if the C compiler already had a path, reuse it for searching the CXX compiler
GET_FILENAME_COMPONENT(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH)
IF(NOT _CMAKE_USER_C_COMPILER_PATH)
FIND_PROGRAM(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER})
MARK_AS_ADVANCED(CMAKE_C_COMPILER_WITH_PATH)
- SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE FILEPATH "C compiler" FORCE)
+ IF(CMAKE_C_COMPILER_WITH_PATH)
+ SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE FILEPATH "C compiler" FORCE)
+ ENDIF(CMAKE_C_COMPILER_WITH_PATH)
ENDIF(NOT _CMAKE_USER_C_COMPILER_PATH)
ENDIF(NOT CMAKE_C_COMPILER)
MARK_AS_ADVANCED(CMAKE_C_COMPILER)