fix for mask feather intersection checks not working right for non-filled, feathered...
[blender.git] / CMakeLists.txt
index 094bec5df9e3c2cc7a1243e3b290a3c75199630b..338135f498758cc4ebeb491aaab0ca8297c42d31 100644 (file)
@@ -126,12 +126,13 @@ option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid d
 option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development)" OFF)
 option(WITH_BUILDINFO     "Include extra build details (only disable for development & faster builds)" ON)
 option(WITH_IK_ITASC      "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
+option(WITH_IK_SOLVER     "Enable Legacy IK solver (only disable for development)" ON)
 option(WITH_FFTW3         "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
 option(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
 option(WITH_GAMEENGINE    "Enable Game Engine" ON)
 option(WITH_PLAYER        "Build Player" OFF)
-option(WITH_OPENCOLORIO   "Enable OpenColorIO color management" ON)
 option(WITH_COMPOSITOR    "Enable the tile based nodal compositor" ON)
+option(WITH_COMPOSITOR_LEGACY "Enable legacy compositor" ON)
 
 # GHOST Windowing Library Options
 option(WITH_GHOST_DEBUG   "Enable debugging output for the GHOST library" OFF)
@@ -149,7 +150,7 @@ mark_as_advanced(WITH_AUDASPACE)
 
 
 # (unix defaults to OpenMP On)
-if(UNIX AND NOT APPLE)
+if((UNIX AND NOT APPLE) OR (MINGW))
        set(PLATFORM_DEFAULT ON)
 else()
        set(PLATFORM_DEFAULT OFF)
@@ -227,9 +228,6 @@ 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)
@@ -251,7 +249,7 @@ option(WITH_CYCLES                                  "Enable cycles Render Engine" ON)
 option(WITH_CYCLES_TEST                                "Build cycles test application" OFF)
 option(WITH_CYCLES_OSL                         "Build Cycles with OSL support" OFF)
 option(WITH_CYCLES_CUDA_BINARIES       "Build cycles CUDA binaries" OFF)
-set(CYCLES_CUDA_BINARIES_ARCH sm_13 sm_20 sm_21 CACHE STRING "CUDA architectures to build binaries for")
+set(CYCLES_CUDA_BINARIES_ARCH sm_13 sm_20 sm_21 sm_30 CACHE STRING "CUDA architectures to build binaries for")
 mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
 unset(PLATFORM_DEFAULT)
 
@@ -275,7 +273,9 @@ if(APPLE)
        endif()
        
        execute_process(COMMAND uname -r OUTPUT_VARIABLE MAC_SYS) # check for actual system-version
-       if (${MAC_SYS} MATCHES 11)
+       if (${MAC_SYS} MATCHES 12)
+               set(OSX_SYSTEM 10.8)
+       elseif (${MAC_SYS} MATCHES 11)
                set(OSX_SYSTEM 10.7)
        elseif(${MAC_SYS} MATCHES 10)
                set(OSX_SYSTEM 10.6)
@@ -365,8 +365,8 @@ if(WITH_CYCLES)
        set(WITH_OPENIMAGEIO ON)
 endif()
 
-# auto enable boost for cycles and carve
-if(WITH_CYCLES OR WITH_CARVE OR WITH_OPENCOLORIO)
+# auto enable boost for cycles and booleans
+if(WITH_CYCLES OR WITH_MOD_BOOLEAN)
        set(WITH_BOOST ON)
 endif()
 
@@ -672,24 +672,6 @@ if(UNIX AND NOT APPLE)
                endif()
        endif()
 
-       if(WITH_OPENCOLORIO)
-               # use lib dir if available and nothing else specified
-               if(LIBDIR AND NOT OPENCOLORIO_ROOT_DIR)
-                       set(OPENCOLORIO_ROOT_DIR ${LIBDIR}/ocio)
-               endif()
-
-               find_package(OpenColorIO)
-
-               set(OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARIES})
-               set(OPENCOLORIO_LIBPATH)  # TODO, remove and reference the absolute path everywhere
-               set(OPENCOLORIO_DEFINITIONS)
-
-               if(NOT OPENCOLORIO_FOUND)
-                       set(WITH_OPENCOLORIO OFF)
-                       message(STATUS "OpenColorIO not found")
-               endif()
-       endif()
-
        # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
        set(PLATFORM_LINKLIBS "-lutil -lc -lm -lpthread -lstdc++")
 
@@ -875,7 +857,7 @@ elseif(WIN32)
                if(WITH_MOD_CLOTH_ELTOPO)
                        set(LAPACK ${LIBDIR}/lapack)
                        # set(LAPACK_INCLUDE_DIR ${LAPACK}/include)
-                       set_lib_path(LAPACK_LIBPATH ${LAPACK}/lib)      
+                       set(LAPACK_LIBPATH ${LAPACK}/lib)       
                        set(LAPACK_LIBRARIES
                                ${LIBDIR}/lapack/lib/libf2c.lib
                                ${LIBDIR}/lapack/lib/clapack_nowrap.lib
@@ -915,6 +897,7 @@ elseif(WIN32)
                endif()
 
                if(WITH_OPENCOLLADA)
+                       set(OPENCOLLADA ${LIBDIR}/opencollada)
 
                        set(OPENCOLLADA_INCLUDE_DIRS
                                ${LIBDIR}/opencollada/include/COLLADAStreamWriter/include
@@ -923,23 +906,22 @@ elseif(WIN32)
                                ${LIBDIR}/opencollada/include/COLLADASaxFrameworkLoader/include
                                ${LIBDIR}/opencollada/include/GeneratedSaxParser/include
                        )
-                       
-                       set_lib_path(OPENCOLLADA_LIBPATH "opencollada/lib")
+                       set_lib_path(OPENCOLLADA_LIBPATH "opencollada")
 
                        set(OPENCOLLADA_LIBRARIES
-                               ${OPENCOLLADA_LIBPATH}/OpenCOLLADASaxFrameworkLoader.lib
-                               ${OPENCOLLADA_LIBPATH}/OpenCOLLADAFramework.lib
-                               ${OPENCOLLADA_LIBPATH}/OpenCOLLADABaseUtils.lib
-                               ${OPENCOLLADA_LIBPATH}/OpenCOLLADAStreamWriter.lib
-                               ${OPENCOLLADA_LIBPATH}/MathMLSolver.lib
-                               ${OPENCOLLADA_LIBPATH}/GeneratedSaxParser.lib
-                               ${OPENCOLLADA_LIBPATH}/xml2.lib
-                               ${OPENCOLLADA_LIBPATH}/buffer.lib
-                               ${OPENCOLLADA_LIBPATH}/ftoa.lib
-                               ${OPENCOLLADA_LIBPATH}/UTF.lib
+                               ${OPENCOLLADA_LIBPATH}/lib/OpenCOLLADASaxFrameworkLoader.lib
+                               ${OPENCOLLADA_LIBPATH}/lib/OpenCOLLADAFramework.lib
+                               ${OPENCOLLADA_LIBPATH}/lib/OpenCOLLADABaseUtils.lib
+                               ${OPENCOLLADA_LIBPATH}/lib/OpenCOLLADAStreamWriter.lib
+                               ${OPENCOLLADA_LIBPATH}/lib/MathMLSolver.lib
+                               ${OPENCOLLADA_LIBPATH}/lib/GeneratedSaxParser.lib
+                               ${OPENCOLLADA_LIBPATH}/lib/xml2.lib
+                               ${OPENCOLLADA_LIBPATH}/lib/buffer.lib
+                               ${OPENCOLLADA_LIBPATH}/lib/ftoa.lib
+                               ${OPENCOLLADA_LIBPATH}/lib/UTF.lib
                        )
                        set(PCRE_LIBRARIES
-                               ${OPENCOLLADA_LIBPATH}/pcre.lib
+                               ${OPENCOLLADA_LIBPATH}/lib/pcre.lib
                        )
                        
                        unset(OPENCOLLADA_LIBPATH)
@@ -962,7 +944,8 @@ elseif(WIN32)
 
                if(WITH_IMAGE_OPENEXR)
                        set_lib_path(OPENEXR "openexr")
-                       set_lib_path(OPENEXR_LIBPATH "openexr/lib")
+                       set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
+                       set(OPENEXR_LIBPATH ${OPENEXR}/lib)
                        set(OPENEXR_LIBRARIES
                                ${OPENEXR_LIBPATH}/Iex.lib
                                ${OPENEXR_LIBPATH}/Half.lib
@@ -970,15 +953,12 @@ elseif(WIN32)
                                ${OPENEXR_LIBPATH}/Imath.lib
                                ${OPENEXR_LIBPATH}/IlmThread.lib
                        )
-                       set_lib_path(OPENEXR_INCUDE "openexr/include")
                        set(OPENEXR_INCLUDE_DIRS
-                               ${OPENEXR_INCUDE}
-                               ${OPENEXR_INCUDE}/IlmImf
-                               ${OPENEXR_INCUDE}/Iex
-                               ${OPENEXR_INCUDE}/Imath
+                               ${OPENEXR_INCLUDE_DIR}
+                               ${OPENEXR_INCLUDE_DIR}/IlmImf
+                               ${OPENEXR_INCLUDE_DIR}/Iex
+                               ${OPENEXR_INCLUDE_DIR}/Imath
                        )
-                       unset(OPENEXR_INCUDE)
-                       unset(OPENEXR_LIBPATH)
                endif()
 
                if(WITH_IMAGE_TIFF)
@@ -997,9 +977,11 @@ elseif(WIN32)
                if(WITH_PYTHON)
                        # normally cached but not since we include them with blender
                        set(PYTHON_VERSION 3.2) # CACHE STRING)
-                       set_lib_path(PYTHON_INCLUDE_DIR "python/include/python${PYTHON_VERSION}")
-                       set_lib_path(PYTHON_LIBRARY "python/lib/python32.lib") #CACHE FILEPATH)
-                       
+                       set_lib_path(PYTHON "python")
+                       set(PYTHON_LIBRARY ${PYTHON}/lib/python32.lib) #CACHE FILEPATH
+                       #Shared includes for both vc2008 and vc2010
+                       set(PYTHON_INCLUDE_DIR ${LIBDIR}/python/include/python${PYTHON_VERSION})
+
                        # uncached vars
                        set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
                        set(PYTHON_LIBRARIES  "${PYTHON_LIBRARY}")
@@ -1009,9 +991,11 @@ elseif(WIN32)
                        set(BOOST ${LIBDIR}/boost)
                        set(BOOST_INCLUDE_DIR ${BOOST}/include)
                        if(MSVC10)
-                               set(BOOST_POSTFIX "vc100-mt-s-1_47.lib")
-                               set(BOOST_DEBUG_POSTFIX "vc100-mt-sgd-1_47.lib")
+                               set(BOOST_LIBPATH ${BOOST}/vc2010/lib)
+                               set(BOOST_POSTFIX "vc100-mt-s-1_49.lib")
+                               set(BOOST_DEBUG_POSTFIX "vc100-mt-sgd-1_49.lib")
                        else()
+                               set(BOOST_LIBPATH ${BOOST}/lib)
                                set(BOOST_POSTFIX "vc90-mt-s-1_49.lib")
                                set(BOOST_DEBUG_POSTFIX "vc90-mt-sgd-1_49.lib")                                 
                        endif()
@@ -1020,11 +1004,6 @@ elseif(WIN32)
                                optimized libboost_regex-${BOOST_POSTFIX} optimized libboost_system-${BOOST_POSTFIX} optimized libboost_thread-${BOOST_POSTFIX}
                                debug libboost_date_time-${BOOST_DEBUG_POSTFIX} debug libboost_filesystem-${BOOST_DEBUG_POSTFIX}
                                debug libboost_regex-${BOOST_DEBUG_POSTFIX} debug libboost_system-${BOOST_DEBUG_POSTFIX} debug libboost_thread-${BOOST_DEBUG_POSTFIX})
-                       if(MSVC10)
-                               set(BOOST_LIBPATH ${BOOST}/lib/vc_10)
-                       else()
-                               set(BOOST_LIBPATH ${BOOST}/lib)
-                       endif()
                        set(BOOST_DEFINITIONS "-DBOOST_ALL_NO_LIB")
                endif()
                        
@@ -1032,18 +1011,10 @@ elseif(WIN32)
                        set(OPENIMAGEIO ${LIBDIR}/openimageio)
                        set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
                        set(OPENIMAGEIO_LIBRARIES OpenImageIO)
-                       set_lib_path(OPENIMAGEIO_LIBPATH "openimageio/lib")
+                       set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
                        set(OPENIMAGEIO_DEFINITIONS)
                endif()
 
-               if(WITH_OPENCOLORIO)
-                       set(OPENCOLORIO ${LIBDIR}/opencolorio)
-                       set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
-                       set(OPENCOLORIO_LIBRARIES OpenColorIO)
-                       set_lib_path(OPENCOLORIO_LIBPATH "opencolorio/lib")
-                       set(OPENCOLORIO_DEFINITIONS)
-               endif()
-
                set(PLATFORM_LINKFLAGS "/SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib")
 
                # MSVC only, Mingw doesnt need
@@ -1213,14 +1184,6 @@ elseif(WIN32)
                        set(OPENIMAGEIO_DEFINITIONS)
                endif()
                
-               if(WITH_OPENCOLORIO)
-                       set(OPENCOLORIO ${LIBDIR}/opencolorio)
-                       set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
-                       set(OPENCOLORIO_LIBRARIES OpenColorIO)
-                       set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
-                       set(OPENCOLORIO_DEFINITIONS)
-               endif()
-
                set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
 
                ## DISABLE - causes linking errors 
@@ -1467,14 +1430,6 @@ elseif(APPLE)
                set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
        endif()
 
-       if(WITH_OPENCOLORIO)
-               set(OPENCOLORIO ${LIBDIR}/opencolorio)
-               set(OPENCOLORIO_INCLUDE_DIRS ${OPENCOLORIO}/include)
-               set(OPENCOLORIO_LIBRARIES OpenColorIO)
-               set(OPENCOLORIO_LIBPATH ${OPENCOLORIO}/lib)
-               set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
-       endif()
-
        set(EXETYPE MACOSX_BUNDLE)
 
        set(CMAKE_C_FLAGS_DEBUG "-fno-strict-aliasing -g")
@@ -1531,6 +1486,16 @@ endif()
 if(MSVC)
        # for some reason this fails on msvc
        add_definitions(-D__LITTLE_ENDIAN__)
+       
+# OSX-Note: as we do crosscompiling with specific set architecture,
+# endianess-detection and autosetting is counterproductive
+# so we just set endianess according CMAKE_OSX_ARCHITECTURES
+
+elseif(CMAKE_OSX_ARCHITECTURES MATCHES i386 OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64)
+       add_definitions(-D__LITTLE_ENDIAN__)
+elseif(CMAKE_OSX_ARCHITECTURES MATCHES ppc OR CMAKE_OSX_ARCHITECTURES MATCHES ppc64)           
+       add_definitions(-D__BIG_ENDIAN__)
+       
 else()
        include(TestBigEndian)
        test_big_endian(_SYSTEM_BIG_ENDIAN)
@@ -1697,9 +1662,6 @@ endif()
 
 # MSVC2010 fails to links C++ libs right
 if(MSVC10)
-       if(WITH_IMAGE_OPENEXR)
-               message(WARNING "MSVC 2010 does not support OpenEXR, disabling WITH_IMAGE_OPENEXR. To enable support use Use MSVC 2008")
-       endif()
        if(WITH_OPENCOLLADA)
                message(WARNING "MSVC 2010 does not support OpenCollada, disabling WITH_OPENCOLLADA. To enable support use Use MSVC 2008")
        endif()
@@ -1835,13 +1797,13 @@ if(FIRST_RUN)
        info_cfg_option(WITH_GAMEENGINE)
        info_cfg_option(WITH_PLAYER)
        info_cfg_option(WITH_BULLET)
+       info_cfg_option(WITH_IK_SOLVER)
        info_cfg_option(WITH_IK_ITASC)
        info_cfg_option(WITH_OPENCOLLADA)
        info_cfg_option(WITH_FFTW3)
        info_cfg_option(WITH_INTERNATIONAL)
        info_cfg_option(WITH_INPUT_NDOF)
        info_cfg_option(WITH_CYCLES)
-       info_cfg_option(WITH_OPENCOLORIO)
 
        info_cfg_text("Compiler Options:")
        info_cfg_option(WITH_BUILDINFO)