svn merge ^/trunk/blender -r43420:43436
[blender.git] / CMakeLists.txt
index 64ed3e641dff2f5fe99e39f17114d3af1275c320..e7becd06d5388a8d27246b15190fb4b88f45c110 100644 (file)
@@ -208,6 +208,9 @@ option(WITH_LZMA          "Enable best LZMA compression, (used for pointcache)"
 # Camera/motion tracking
 option(WITH_LIBMV         "Enable libmv structure from motion library" ON)
 
+# Mesh boolean lib
+option(WITH_CARVE         "Enable Carve library to handle mesh boolean operations" ON)
+
 # Misc
 option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
 option(WITH_RAYOPTIMIZATION    "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
@@ -300,9 +303,13 @@ if(WITH_PYTHON_MODULE)
        set(WITH_HEADLESS ON)
 endif()
 
-# auto enable openimageio and boost for cycles
+# auto enable openimageio for cycles
 if(WITH_CYCLES)
        set(WITH_OPENIMAGEIO ON)
+endif()
+
+# auto enable boost for cycles and carve
+if(WITH_CYCLES OR WITH_CARVE)
        set(WITH_BOOST ON)
 endif()
 
@@ -1085,16 +1092,28 @@ elseif(APPLE)
        endif()
 
        if(WITH_PYTHON)
-               # we use precompiled libraries for py 3.2 and up by default
+               if(NOT WITH_PYTHON_MODULE)
+                       # we use precompiled libraries for py 3.2 and up by default
 
-               # normally cached but not since we include them with blender
-               set(PYTHON_VERSION 3.2)
-               set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
-               # set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
-               set(PYTHON_LIBRARY python${PYTHON_VERSION})
-               set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
-               # set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
+                       # normally cached but not since we include them with blender
+                       set(PYTHON_VERSION 3.2)
+                       set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}")
+                       # set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
+                       set(PYTHON_LIBRARY python${PYTHON_VERSION})
+                       set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
+                       # set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
+               else()
+                       # module must be compiled against Python framework
 
+                       # normally cached but not since we include them with blender
+                       set(PYTHON_VERSION 3.2)
+                       set(PYTHON_INCLUDE_DIR "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}m")
+                       set(PYTHON_BINARY "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}")
+                       #set(PYTHON_LIBRARY python${PYTHON_VERSION})
+                       set(PYTHON_LIBPATH "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config-3.2m")
+                       #set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python")  # won't  build with this enabled
+               endif()
+               
                # uncached vars
                set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
                set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
@@ -1189,7 +1208,11 @@ elseif(APPLE)
                set(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
                set(WITH_INPUT_NDOF OFF)  # unsupported
        endif()
-
+       
+       if(WITH_PYTHON_MODULE)
+               set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/python")# force cmake to link right framework
+       endif()
+       
        if(WITH_OPENCOLLADA)
                set(OPENCOLLADA ${LIBDIR}/opencollada)