summaryrefslogtreecommitdiff
path: root/Modules/CMakeDetermineCompiler.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/CMakeDetermineCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCompiler.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 2d12c07578..f522c4408f 100644
--- a/Modules/CMakeDetermineCompiler.cmake
+++ b/Modules/CMakeDetermineCompiler.cmake
@@ -69,4 +69,17 @@ macro(_cmake_find_compiler lang)
endif()
unset(_${lang}_COMPILER_HINTS)
unset(_languages)
+
+ # Look for a make tool provided by Xcode
+ if(CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND" AND CMAKE_HOST_APPLE)
+ foreach(comp ${CMAKE_${lang}_COMPILER_LIST})
+ execute_process(COMMAND xcrun --find ${comp}
+ OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE _xcrun_err)
+ if(_xcrun_out)
+ set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${_xcrun_out}")
+ break()
+ endif()
+ endforeach()
+ endif()
endmacro()