patch from Peter Stern to fix CMake building on OSX (without manual editing of config...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 2 Feb 2012 11:08:48 +0000 (11:08 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 2 Feb 2012 11:08:48 +0000 (11:08 +0000)
CMakeLists.txt

index fb6b946b0c6620248dfb39c221c91cb5eb1aceb5..fb66c1cc7b5d642c86cc4620cefeb4285da19a9f 100644 (file)
@@ -249,6 +249,12 @@ if(APPLE)
                "Choose the minimum OSX version required: 10.4 or 10.5"
                FORCE)
        endif()
+       if(${CMAKE_GENERATOR} MATCHES "Xcode" AND (${XCODE_VERSION} VERSION_GREATER 3))
+               # Xcode 4 defaults to the Apple LLVM Compiler.
+               # Override the default compiler selection because Blender only compiles with gcc
+               set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
+               message(STATUS "Setting compiler to: " ${CMAKE_XCODE_ATTRIBUTE_GCC_VERSION})
+       endif()
        option(WITH_COCOA         "Use Cocoa framework instead of deprecated Carbon" ON)
        option(USE_QTKIT          "Use QtKit instead of Carbon quicktime (needed for having partial quicktime for 64bit)" OFF)
        option(WITH_LIBS10.5  "Use 10.5 libs (needed for 64bit builds)" OFF)