summaryrefslogtreecommitdiff
path: root/Modules/CMakeDetermineCXXCompiler.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-08-15 16:21:50 -0400
committerBrad King <brad.king@kitware.com>2012-08-22 15:14:33 -0400
commit965a69dcaa0b67c730f45487abeee97ef652d545 (patch)
tree0b16a50604aa49212594137706c22b78479fb28f /Modules/CMakeDetermineCXXCompiler.cmake
parent9a9e1ee98d59ba1ed2a89a2858224a7f8a92bbf6 (diff)
downloadcmake-965a69dcaa0b67c730f45487abeee97ef652d545.tar.gz
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/CMakeDetermineCXXCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 6ed2c68f60..110fcb184c 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -43,6 +43,8 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
set(CMAKE_CXX_PLATFORM_ID "Windows")
set(CMAKE_CXX_COMPILER_ID "MSVC")
set(CMAKE_CXX_COMPILER "${CMAKE_GENERATOR_CXX}")
+elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
+ set(CMAKE_CXX_COMPILER_XCODE_TYPE sourcecode.cpp.cpp)
else()
if(NOT CMAKE_CXX_COMPILER)
set(CMAKE_CXX_COMPILER_INIT NOTFOUND)