The current approach to determine the CompilerId via
an XCTest bundle on iOS requires a valid code sign identity.

This is a regression compared to CMake 3.0. This patch changes
the detection to be performed on a static library and also
unifies detection across iOS and OSX.

This has been tested on OSX 10.10 with Xcode 6.1.1.

Signed-off-by: Gregor Jasny <[email protected]>
---
 Modules/CMakeDetermineCompilerId.cmake | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/Modules/CMakeDetermineCompilerId.cmake 
b/Modules/CMakeDetermineCompilerId.cmake
index 0ea9ce1..85934a3 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -264,9 +264,7 @@ Id flags: ${testflags}
     set(id_product_type "com.apple.product-type.tool")
     if(CMAKE_OSX_SYSROOT)
       set(id_sdkroot "SDKROOT = \"${CMAKE_OSX_SYSROOT}\";")
-      if(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ii][Pp][Hh][Oo][Nn][Ee]")
-        set(id_product_type "com.apple.product-type.bundle.unit-test")
-      endif()
+      set(id_product_type "com.apple.product-type.library.static")
     else()
       set(id_sdkroot "")
     endif()
@@ -303,11 +301,11 @@ Id flags: ${testflags}
     endif()
 
     # Match the link line from xcodebuild output of the form
-    #  Ld ...
+    #  CompileC ...
     #      ...
-    #      /path/to/cc ...CompilerId${lang}/...
+    #      /path/to/cc ...-o CMake${lang}CompilerId.o
     # to extract the compiler front-end for the language.
-    if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "\nLd[^\n]*(\n[ 
\t]+[^\n]*)*\n[ \t]+([^ 
\t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerId${lang}/(\\./)?(CompilerId${lang}.xctest/)?CompilerId${lang}[
 \t\n\\\"]")
+    if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "\nCompileC[^\n]*(\n[ 
\t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[ \t][^ 
\t\r\n]*CMake${lang}CompilerId.o[ \t\n\\\"]")
       set(_comp "${CMAKE_MATCH_2}")
       if(EXISTS "${_comp}")
         set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE)
-- 
1.9.3 (Apple Git-50)

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to