OSX/cmake: don't try get xcode path from xcode before 4.3, developer dir was not...
authorJens Verwiebe <info@jensverwiebe.de>
Sat, 14 Sep 2013 12:11:26 +0000 (12:11 +0000)
committerJens Verwiebe <info@jensverwiebe.de>
Sat, 14 Sep 2013 12:11:26 +0000 (12:11 +0000)
CMakeLists.txt

index 6fd21a48f37443296d3177ee460cc4a8feb26706..5d30d29cf273b53a481b315f97693020aa1ade02 100644 (file)
@@ -326,9 +326,11 @@ if(APPLE)
        execute_process(COMMAND xcode-select --print-path  OUTPUT_VARIABLE XCODE_CHECK OUTPUT_STRIP_TRAILING_WHITESPACE)
        string(REPLACE "/Contents/Developer" "" XCODE_BUNDLE ${XCODE_CHECK}) # truncate to bundlepath in any case
        message(STATUS "Xcode-bundle : " ${XCODE_BUNDLE})
-       string(SUBSTRING "${XCODE_CHECK}" 14 6 DP_NAME) # reduce to XCode name without dp extension
-       if(${DP_NAME} MATCHES Xcode5)
-               set(XCODE_VERSION 5)
+       if(${XCODE_VERSION} VERSION_GREATER 4.2) # earlier xcode has no bundled developer dir, no sense in getting xcode path from
+               string(SUBSTRING "${XCODE_CHECK}" 14 6 DP_NAME) # reduce to XCode name without dp extension
+               if(${DP_NAME} MATCHES Xcode5)
+                       set(XCODE_VERSION 5)
+               endif()
        endif()
        
        if(${CMAKE_GENERATOR} MATCHES "Xcode")