Xcode: Convert forced CMAKE_<LANG>_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.
This commit is contained in:
Brad King 2014-03-10 16:57:59 -04:00
parent 6852fb8034
commit 8c9bfac384
3 changed files with 3 additions and 0 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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