summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCCompiler.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-08-15 20:21:50 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-22 19:14:33 (GMT)
commit965a69dcaa0b67c730f45487abeee97ef652d545 (patch)
tree0b16a50604aa49212594137706c22b78479fb28f /Modules/CMakeDetermineCCompiler.cmake
parent9a9e1ee98d59ba1ed2a89a2858224a7f8a92bbf6 (diff)
downloadCMake-965a69dcaa0b67c730f45487abeee97ef652d545.zip
CMake-965a69dcaa0b67c730f45487abeee97ef652d545.tar.gz
CMake-965a69dcaa0b67c730f45487abeee97ef652d545.tar.bz2
Xcode: Detect the compiler id and tool location
Configure a hand-generated Xcode project to build the compiler id source file since we cannot run the compiler command-line tool directly. Add a post-build shell script phase to print out the compiler toolset build setting. Run xcodebuild to compile the identification binary. Parse the full path to the compiler tool from the xcodebuild output.
Diffstat (limited to 'Modules/CMakeDetermineCCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 3ce1a36..7f0ffee 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -44,6 +44,8 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
set(CMAKE_C_PLATFORM_ID "Windows")
set(CMAKE_C_COMPILER_ID "MSVC")
set(CMAKE_C_COMPILER "${CMAKE_GENERATOR_CC}")
+elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
+ set(CMAKE_C_COMPILER_XCODE_TYPE sourcecode.c.c)
else()
if(NOT CMAKE_C_COMPILER)
set(CMAKE_C_COMPILER_INIT NOTFOUND)