[Cmake-commits] CMake branch, next, updated. v3.1.0-1864-ga0b93d7

Stephen Kelly steveire at gmail.com
Tue Jan 13 17:17:10 EST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  a0b93d7dd06b94731be61a639bcedaecf5fe7192 (commit)
       via  f85156c9061bde41d50db94fd4f5ba8c520563a2 (commit)
      from  813257d9aa8fa07d261f77e9349c8f2f11fd3efc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a0b93d7dd06b94731be61a639bcedaecf5fe7192
commit a0b93d7dd06b94731be61a639bcedaecf5fe7192
Merge: 813257d f85156c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jan 13 17:17:09 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jan 13 17:17:09 2015 -0500

    Merge topic 'Apple-compiler-selection' into next
    
    f85156c9 New approach.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f85156c9061bde41d50db94fd4f5ba8c520563a2
commit f85156c9061bde41d50db94fd4f5ba8c520563a2
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Jan 13 23:10:46 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Jan 13 23:16:07 2015 +0100

    New approach.

diff --git a/Modules/CMakeDetermineCompiler.cmake b/Modules/CMakeDetermineCompiler.cmake
index 7b21dcf..e3b4434 100644
--- a/Modules/CMakeDetermineCompiler.cmake
+++ b/Modules/CMakeDetermineCompiler.cmake
@@ -71,18 +71,31 @@ macro(_cmake_find_compiler lang)
   unset(_languages)
 
   # Look for a make tool provided by Xcode
-  if(CMAKE_HOST_APPLE
-      AND (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND"
-        OR CMAKE_${lang}_COMPILER MATCHES "^/usr/bin"))
-    foreach(comp ${CMAKE_${lang}_COMPILER_LIST})
-      execute_process(COMMAND xcrun --find ${comp}
+  if(CMAKE_HOST_APPLE)
+    macro(_query_xrun compiler_name result_var_keyword result_var)
+      if(NOT result_var_keyword STREQUAL "RESULT_VAR")
+        message(FATAL_ERROR "Bad arguments to macro")
+      endif()
+      execute_process(COMMAND xcrun --find ${compiler_name}
         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()
+      set(${result_var} ${_xcrun_out})
+    endmacro()
+
+    set(xcrun_result)
+    if (CMAKE_${lang}_COMPILER MATCHES "^/usr/bin/(.+)$")
+      _query_xrun(${CMAKE_MATCH_1} RESULT_VAR xcrun_result)
+    elseif (CMAKE_${lang}_COMPILER STREQUAL "CMAKE_${lang}_COMPILER-NOTFOUND")
+      foreach(comp ${CMAKE_${lang}_COMPILER_LIST})
+        _query_xrun(${comp} RESULT_VAR xcrun_result)
+        if(xcrun_result)
+          break()
+        endif()
+      endforeach()
+    endif()
+    if (xcrun_result)
+      set_property(CACHE CMAKE_${lang}_COMPILER PROPERTY VALUE "${xcrun_result}")
+    endif()
   endif()
 endmacro()
 

-----------------------------------------------------------------------

Summary of changes:
 Modules/CMakeDetermineCompiler.cmake |   33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list