From 8c9bfac3848bc2c53c034b03cf89a3aaa8f3a248 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 10 Mar 2014 16:57:59 -0400 Subject: [PATCH] Xcode: Convert forced CMAKE__COMPILER to full path if possible During cross-compiling the toolchain file may use CMakeForceCompiler to force a compiler setting. When using the Xcode generator try to convert it to a full path by searching the PATH as is done for the Makefile generators. --- Modules/CMakeDetermineCCompiler.cmake | 1 + Modules/CMakeDetermineCXXCompiler.cmake | 1 + Modules/CMakeDetermineFortranCompiler.cmake | 1 + 3 files changed, 3 insertions(+) diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 4f7ae2432..aa4cdc940 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -42,6 +42,7 @@ endif() if(${CMAKE_GENERATOR} MATCHES "Visual Studio") elseif("${CMAKE_GENERATOR}" MATCHES "Xcode") set(CMAKE_C_COMPILER_XCODE_TYPE sourcecode.c.c) + _cmake_find_compiler_path(C) else() if(NOT CMAKE_C_COMPILER) set(CMAKE_C_COMPILER_INIT NOTFOUND) diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index d60cff3e0..ef8445e5a 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -41,6 +41,7 @@ endif() if(${CMAKE_GENERATOR} MATCHES "Visual Studio") elseif("${CMAKE_GENERATOR}" MATCHES "Xcode") set(CMAKE_CXX_COMPILER_XCODE_TYPE sourcecode.cpp.cpp) + _cmake_find_compiler_path(CXX) else() if(NOT CMAKE_CXX_COMPILER) set(CMAKE_CXX_COMPILER_INIT NOTFOUND) diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index f4aaa0a9d..d38bf2548 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -28,6 +28,7 @@ endif() if(${CMAKE_GENERATOR} MATCHES "Visual Studio") elseif("${CMAKE_GENERATOR}" MATCHES "Xcode") set(CMAKE_Fortran_COMPILER_XCODE_TYPE sourcecode.fortran.f90) + _cmake_find_compiler_path(Fortran) else() if(NOT CMAKE_Fortran_COMPILER) # prefer the environment variable CC