Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Sun, 10 Jun 2018 06:21:38 +0000 (08:21 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 10 Jun 2018 06:21:50 +0000 (08:21 +0200)
1  2 
CMakeLists.txt
build_files/cmake/Modules/FindGLEW.cmake
build_files/cmake/Modules/FindSndFile.cmake
build_files/cmake/config/blender_headless.cmake
build_files/cmake/macros.cmake
build_files/cmake/platform/platform_win32.cmake

diff --combined CMakeLists.txt
index 69d0abe1e2536270d42975e0a685849fef5fa241,3cfeaaa1be121afe4b7b64473945646e50f45074..5f1b9b1643cb59b4ad3eb1292a0c341a9151c8f3
@@@ -156,6 -156,7 +156,6 @@@ option_defaults_init
        _init_OPENCOLORIO
        _init_SDL
        _init_FFTW3
 -      _init_GAMEENGINE
        _init_OPENSUBDIV
  )
  
@@@ -196,7 -197,7 +196,7 @@@ mark_as_advanced(WITH_BLENDER
  option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
  
  option(WITH_PYTHON        "Enable Embedded Python API  (only disable for development)" ON)
- option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON) 
+ option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON)
  mark_as_advanced(WITH_PYTHON)  # dont want people disabling this unless they really know what they are doing.
  mark_as_advanced(WITH_PYTHON_SECURITY)  # some distributions see this as a security issue, rather than have them patch it, make a build option.
  
@@@ -225,10 -226,15 +225,10 @@@ option(WITH_FFTW3         "Enable FFTW
  option(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
  option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
  mark_as_advanced(WITH_SYSTEM_BULLET)
 -option(WITH_GAMEENGINE    "Enable Game Engine" ${_init_GAMEENGINE})
 -if(APPLE)
 -      set(WITH_GAMEENGINE_DECKLINK OFF)
 -else()
 -      option(WITH_GAMEENGINE_DECKLINK "Support BlackMagicDesign DeckLink cards in the Game Engine" ON)
 -endif()
 -option(WITH_PLAYER        "Build Player" OFF)
  option(WITH_OPENCOLORIO   "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
  
 +option(WITH_CLAY_ENGINE    "Enable Clay engine" ON)
 +
  # Compositor
  option(WITH_COMPOSITOR         "Enable the tile based nodal compositor" ON)
  
@@@ -310,6 -316,7 +310,6 @@@ option(WITH_IMAGE_TIFF          "Enabl
  option(WITH_IMAGE_DDS           "Enable DDS Image Support" ON)
  option(WITH_IMAGE_CINEON        "Enable CINEON and DPX Image Support" ON)
  option(WITH_IMAGE_HDR           "Enable HDR Image Support" ON)
 -option(WITH_IMAGE_FRAMESERVER   "Enable image FrameServer Support for rendering" ON)
  
  # Audio/Video format support
  option(WITH_CODEC_AVI           "Enable Blenders own AVI file support (raw/jpeg)" ON)
@@@ -372,14 -379,10 +372,14 @@@ if(UNIX AND NOT APPLE
  endif()
  
  option(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
 -if(WITH_PYTHON_INSTALL)
 -      option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder"  ON)
 +if(WITH_PYTHON_INSTALL OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
        set(PYTHON_NUMPY_PATH            "" CACHE PATH "Path to python site-packages or dist-packages containing 'numpy' module")
        mark_as_advanced(PYTHON_NUMPY_PATH)
 +      set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
 +      mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
 +endif()
 +if(WITH_PYTHON_INSTALL)
 +      option(WITH_PYTHON_INSTALL_NUMPY "Copy system numpy into the blender install folder"  ON)
  
        if(UNIX AND NOT APPLE)
                option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON)
@@@ -460,16 -463,28 +460,16 @@@ endif(
  
  # OpenGL
  
 -option(WITH_GLEW_MX             "Support multiple GLEW contexts (experimental)"                                                                     OFF )
  option(WITH_GLEW_ES             "Switches to experimental copy of GLEW that has support for OpenGL ES. (temporary option for development purposes)" OFF)
  option(WITH_GL_EGL              "Use the EGL OpenGL system library instead of the platform specific OpenGL system library (CGL, glX, or WGL)"       OFF)
 -option(WITH_GL_PROFILE_COMPAT   "Support using the OpenGL 'compatibility' profile. (deprecated)"                                                    ON )
 -option(WITH_GL_PROFILE_CORE     "Support using the OpenGL 3.2+ 'core' profile."                                                                     OFF)
  option(WITH_GL_PROFILE_ES20     "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)"                                  OFF)
  
  mark_as_advanced(
 -      WITH_GLEW_MX
        WITH_GLEW_ES
        WITH_GL_EGL
 -      WITH_GL_PROFILE_COMPAT
 -      WITH_GL_PROFILE_CORE
        WITH_GL_PROFILE_ES20
  )
  
 -if(WITH_GL_PROFILE_COMPAT)
 -      set(WITH_GLU ON)
 -else()
 -      set(WITH_GLU OFF)
 -endif()
 -
  if(WIN32)
        option(WITH_GL_ANGLE "Link with the ANGLE library, an OpenGL ES 2.0 implementation based on Direct3D, instead of the system OpenGL library." OFF)
        mark_as_advanced(WITH_GL_ANGLE)
@@@ -495,10 -510,11 +495,10 @@@ if(APPLE
        set(WITH_CXX11 ON)
  elseif(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "6.0") AND (NOT WITH_CXX11))
        set(_c11_init ON)
 -      set(_cxx11_init ON)
  else()
        set(_c11_init OFF)
 -      set(_cxx11_init OFF)
  endif()
 +set(_cxx11_init ON)
  
  option(WITH_C11 "Build with C11 standard enabled, for development use only!" ${_c11_init})
  mark_as_advanced(WITH_C11)
@@@ -545,10 -561,11 +545,11 @@@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_C
                        find_library(COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
                else()
                        find_library( COMPILER_ASAN_LIBRARY NAMES clang_rt.asan-x86_64
-                               PATHS   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
-                                               [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
-                                               )
-               endif() 
+                               PATHS
+                               [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
+                               [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
+                       )
+               endif()
                mark_as_advanced(COMPILER_ASAN_LIBRARY)
        endif()
  endif()
@@@ -608,17 -625,15 +609,17 @@@ endif(
  #-----------------------------------------------------------------------------
  # Check for conflicting/unsupported configurations
  
 -if(NOT WITH_BLENDER AND NOT WITH_PLAYER AND NOT WITH_CYCLES_STANDALONE)
 +if(NOT WITH_BLENDER AND NOT WITH_CYCLES_STANDALONE)
        message(FATAL_ERROR
 -              "At least one of WITH_BLENDER or WITH_PLAYER or "
 -              "WITH_CYCLES_STANDALONE must be enabled, nothing to do!"
 +              "At least one of WITH_BLENDER or WITH_CYCLES_STANDALONE "
 +              "must be enabled, nothing to do!"
        )
  endif()
  
 -if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
 -      message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
 +if(NOT WITH_CXX11)
 +      if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
 +              message(FATAL_ERROR "WITH_AUDASPACE requires WITH_CXX11")
 +      endif()
  endif()
  
  if(NOT WITH_AUDASPACE)
        if(WITH_JACK)
                message(FATAL_ERROR "WITH_JACK requires WITH_AUDASPACE")
        endif()
 -      if(WITH_GAMEENGINE)
 -              message(FATAL_ERROR "WITH_GAMEENGINE requires WITH_AUDASPACE")
 -      endif()
  endif()
  
  if(NOT WITH_SDL AND WITH_GHOST_SDL)
  endif()
  
  # python module, needs some different options
 -if(WITH_PYTHON_MODULE AND WITH_PLAYER)
 -      message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PLAYER to be OFF")
 -endif()
 -
  if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
        message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
  endif()
@@@ -662,10 -684,15 +663,10 @@@ if(NOT WITH_BOOST
        endmacro()
  
        set_and_warn(WITH_CYCLES         OFF)
 -      set_and_warn(WITH_AUDASPACE      OFF)
        set_and_warn(WITH_INTERNATIONAL  OFF)
        set_and_warn(WITH_OPENVDB        OFF)
        set_and_warn(WITH_OPENCOLORIO    OFF)
 -
 -      set_and_warn(WITH_OPENAL         OFF)  # depends on AUDASPACE
 -      set_and_warn(WITH_GAMEENGINE     OFF)  # depends on AUDASPACE
 -      set_and_warn(WITH_PLAYER         OFF)  # depends on GAMEENGINE
 -elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_AUDASPACE OR WITH_INTERNATIONAL OR
 +elseif(WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
         WITH_OPENVDB OR WITH_OPENCOLORIO)
        # Keep enabled
  else()
@@@ -734,9 -761,30 +735,9 @@@ TEST_SHARED_PTR_SUPPORT(
  TEST_UNORDERED_MAP_SUPPORT()
  
  if(WITH_AUDASPACE)
 -      if(WITH_SYSTEM_AUDASPACE)
 -              set(AUDASPACE_DEFINITIONS
 -                      -DWITH_AUDASPACE
 -                      -DWITH_SYSTEM_AUDASPACE
 -                      "-DAUD_DEVICE_H=<AUD_Device.h>"
 -                      "-DAUD_SPECIAL_H=<AUD_Special.h>"
 -                      "-DAUD_SOUND_H=<AUD_Sound.h>"
 -                      "-DAUD_HANDLE_H=<AUD_Handle.h>"
 -                      "-DAUD_SEQUENCE_H=<AUD_Sequence.h>"
 -                      "-DAUD_TYPES_H=<AUD_Types.h>"
 -                      "-DAUD_PYTHON_H=<python/PyAPI.h>"
 -              )
 -      else()
 -              set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
 -              set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/intern/audaspace/intern")
 -              set(AUDASPACE_DEFINITIONS
 -                      -DWITH_AUDASPACE
 -                      "-DAUD_DEVICE_H=<AUD_C-API.h>"
 -                      "-DAUD_SPECIAL_H=<AUD_C-API.h>"
 -                      "-DAUD_SOUND_H=<AUD_C-API.h>"
 -                      "-DAUD_HANDLE_H=<AUD_C-API.h>"
 -                      "-DAUD_SEQUENCE_H=<AUD_C-API.h>"
 -                      "-DAUD_TYPES_H=<AUD_Space.h>"
 -              )
 +      if(NOT WITH_SYSTEM_AUDASPACE)
 +              set(AUDASPACE_C_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings/C" "${CMAKE_BINARY_DIR}/extern/audaspace")
 +              set(AUDASPACE_PY_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/audaspace/bindings")
        endif()
  endif()
  
@@@ -1004,11 -1052,19 +1005,11 @@@ endif(
  find_package(OpenGL)
  blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
  
 -if(WITH_GLU)
 -      list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_glu_LIBRARY}")
 -      list(APPEND GL_DEFINITIONS -DWITH_GLU)
 -endif()
 -
  if(WITH_SYSTEM_GLES)
        find_package_wrapper(OpenGLES)
  endif()
  
 -if(WITH_GL_PROFILE_COMPAT OR WITH_GL_PROFILE_CORE)
 -      list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
 -
 -elseif(WITH_GL_PROFILE_ES20)
 +if(WITH_GL_PROFILE_ES20)
        if(WITH_SYSTEM_GLES)
                if(NOT OPENGLES_LIBRARY)
                        message(FATAL_ERROR
  
        endif()
  
 +else()
 +      list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
 +
  endif()
  
  if(WITH_GL_EGL)
  
  endif()
  
 -if(WITH_GL_PROFILE_COMPAT)
 -      list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_COMPAT)
 -endif()
 -
 -if(WITH_GL_PROFILE_CORE)
 -      list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
 -endif()
 -
  if(WITH_GL_PROFILE_ES20)
        list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_ES20)
 +else()
 +      list(APPEND GL_DEFINITIONS -DWITH_GL_PROFILE_CORE)
  endif()
  
  if(WITH_GL_EGL)
@@@ -1158,6 -1217,10 +1159,6 @@@ endif(
  #-----------------------------------------------------------------------------
  # Configure GLEW
  
 -if(WITH_GLEW_MX)
 -      list(APPEND GL_DEFINITIONS -DWITH_GLEW_MX)
 -endif()
 -
  if(WITH_SYSTEM_GLEW)
        find_package(GLEW)
  
                message(FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW.")
        endif()
  
 -      if(WITH_GLEW_MX)
 -              set(BLENDER_GLEW_LIBRARIES ${GLEW_MX_LIBRARY})
 -      else()
 -              set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
 -      endif()
 +      set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
  else()
        if(WITH_GLEW_ES)
                set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew-es/include")
                list(APPEND GL_DEFINITIONS -DGLEW_STATIC -DWITH_GLEW_ES)
  
                # These definitions remove APIs from glew.h, making GLEW smaller, and catching unguarded API usage
 -              if(NOT WITH_GL_PROFILE_ES20)
 +              if(WITH_GL_PROFILE_ES20)
 +                      list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
 +              else()
                        # No ES functions are needed
                        list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
 -              elseif(NOT (WITH_GL_PROFILE_CORE OR WITH_GL_PROFILE_COMPAT))
 -                      # ES is enabled, but the other functions are all disabled
 -                      list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
                endif()
  
                if(WITH_GL_PROFILE_ES20)
  
                list(APPEND GL_DEFINITIONS -DGLEW_STATIC)
  
-               # This won't affect the non-experimental glew library, 
+               # This won't affect the non-experimental glew library,
                # but is used for conditional compilation elsewhere.
                list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
  
  
  endif()
  
 -if(NOT WITH_GLU)
 -      list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
 -endif()
 +list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
  
  #-----------------------------------------------------------------------------
  # Configure Bullet
@@@ -1496,7 -1566,7 +1497,7 @@@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSV
                "/wd4267"  # conversion from 'size_t' to 'type', possible loss of data
                "/wd4305"  # truncation from 'type1' to 'type2'
                "/wd4800"  # forcing value to bool 'true' or 'false'
-               "/wd4828"  # The file contains a character that is illegal 
+               "/wd4828"  # The file contains a character that is illegal
                # errors:
                "/we4013"  # 'function' undefined; assuming extern returning int
                "/we4133"  # incompatible pointer types
@@@ -1522,15 -1592,10 +1523,15 @@@ if(WITH_PYTHON
                )
        endif()
  
 -      if(WIN32 OR APPLE)
 +      if(WIN32)
                # pass, we have this in an archive to extract
 -      elseif(WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY)
 -              find_python_package(numpy)
 +      elseif((WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY) OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
 +              if(("${PYTHON_NUMPY_PATH}" STREQUAL "") OR (${PYTHON_NUMPY_PATH} MATCHES NOTFOUND))
 +                      find_python_package(numpy)
 +                      unset(PYTHON_NUMPY_INCLUDE_DIRS CACHE)
 +                      set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON_NUMPY_PATH}/numpy/core/include CACHE PATH "Path to the include directory of the numpy module")
 +                      mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
 +              endif()
        endif()
  
        if(WIN32 OR APPLE)
@@@ -1620,7 -1685,7 +1621,7 @@@ if(WITH_GTESTS
        include(GTestTesting)
  endif()
  
 -if(WITH_BLENDER OR WITH_PLAYER)
 +if(WITH_BLENDER)
        add_subdirectory(intern)
        add_subdirectory(extern)
  
@@@ -1645,6 -1710,13 +1646,6 @@@ if(WITH_BLENDER
  endif()
  
  
 -#-----------------------------------------------------------------------------
 -# Blender Player
 -if(WITH_PLAYER)
 -      add_subdirectory(source/blenderplayer)
 -endif()
 -
 -
  #-----------------------------------------------------------------------------
  # Testing
  add_subdirectory(tests)
@@@ -1659,6 -1731,9 +1660,6 @@@ include(build_files/cmake/packaging.cma
  if(WITH_BLENDER)
        openmp_delayload(blender)
  endif()
 -if(WITH_PLAYER)
 -      openmp_delayload(blenderplayer)
 -endif()
  
  #-----------------------------------------------------------------------------
  # Print Final Configuration
@@@ -1692,6 -1767,8 +1693,6 @@@ if(FIRST_RUN
        message(STATUS "C++ Compiler: \"${CMAKE_CXX_COMPILER_ID}\"")
  
        info_cfg_text("Build Options:")
 -      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_text("OpenGL:")
        info_cfg_option(WITH_GLEW_ES)
 -      info_cfg_option(WITH_GLU)
        info_cfg_option(WITH_GL_EGL)
 -      info_cfg_option(WITH_GL_PROFILE_COMPAT)
 -      info_cfg_option(WITH_GL_PROFILE_CORE)
        info_cfg_option(WITH_GL_PROFILE_ES20)
        if(WIN32)
                info_cfg_option(WITH_GL_ANGLE)
index 3057237f3c66c01de02966d3007e45c34ea3e061,0504e75787bdb6077b243565b1a5045f68cf6b7f..b36a3272e3dbf25679f324dbb1d558aa820eb4a1
@@@ -9,6 -9,7 +9,6 @@@
  #
  # also defined,
  #  GLEW_LIBRARY, where to find the Glew library.
 -#  GLEW_MX_LIBRARY, where to find the GlewMX library.
  
  #=============================================================================
  # Copyright 2014 Blender Foundation.
@@@ -49,7 -50,17 +49,7 @@@ FIND_LIBRARY(GLEW_LIBRAR
      lib64 lib
    )
  
- # handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if 
 -
 -FIND_LIBRARY(GLEW_MX_LIBRARY
 -  NAMES
 -    GLEWmx
 -  HINTS
 -    ${_glew_SEARCH_DIRS}
 -  PATH_SUFFIXES
 -    lib64 lib
 -  )
 -
+ # handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
  # all listed variables are TRUE
  INCLUDE(FindPackageHandleStandardArgs)
  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glew DEFAULT_MSG
@@@ -62,6 -73,7 +62,6 @@@ ENDIF(GLEW_FOUND
  MARK_AS_ADVANCED(
    GLEW_INCLUDE_DIR
    GLEW_LIBRARY
 -  GLEW_MX_LIBRARY
  )
  
  UNSET(_glew_SEARCH_DIRS)
index c210c523c581900b4ef37a3b74bacf79252d2dcd,3b4ab38e84283b4ca85517dc92f00f84e0a0b642..ef6fb73598f7ca406208b5aa36e0cee0b8ead154
@@@ -1,15 -1,15 +1,15 @@@
  # - Find SndFile library
  # Find the native SndFile includes and library
  # This module defines
 -#  SNDFILE_INCLUDE_DIRS, where to find sndfile.h, Set when
 -#                        SNDFILE_INCLUDE_DIR is found.
 -#  SNDFILE_LIBRARIES, libraries to link against to use SndFile.
 -#  SNDFILE_ROOT_DIR, The base directory to search for SndFile.
 +#  LIBSNDFILE_INCLUDE_DIRS, where to find sndfile.h, Set when
 +#                        LIBSNDFILE_INCLUDE_DIR is found.
 +#  LIBSNDFILE_LIBRARIES, libraries to link against to use SndFile.
 +#  LIBSNDFILE_ROOT_DIR, The base directory to search for SndFile.
  #                    This can also be an environment variable.
 -#  SNDFILE_FOUND, If false, do not try to use SndFile.
 +#  LIBSNDFILE_FOUND, If false, do not try to use SndFile.
  #
  # also defined, but not for general use are
 -#  SNDFILE_LIBRARY, where to find the SndFile library.
 +#  LIBSNDFILE_LIBRARY, where to find the SndFile library.
  
  #=============================================================================
  # Copyright 2011 Blender Foundation.
  # See the License for more information.
  #=============================================================================
  
 -# If SNDFILE_ROOT_DIR was defined in the environment, use it.
 -IF(NOT SNDFILE_ROOT_DIR AND NOT $ENV{SNDFILE_ROOT_DIR} STREQUAL "")
 -  SET(SNDFILE_ROOT_DIR $ENV{SNDFILE_ROOT_DIR})
 +# If LIBSNDFILE_ROOT_DIR was defined in the environment, use it.
 +IF(NOT LIBSNDFILE_ROOT_DIR AND NOT $ENV{LIBSNDFILE_ROOT_DIR} STREQUAL "")
 +      SET(LIBSNDFILE_ROOT_DIR $ENV{LIBSNDFILE_ROOT_DIR})
  ENDIF()
  
  SET(_sndfile_SEARCH_DIRS
 -  ${SNDFILE_ROOT_DIR}
 +      ${LIBSNDFILE_ROOT_DIR}
    /usr/local
    /sw # Fink
    /opt/local # DarwinPorts
  )
  
 -FIND_PATH(SNDFILE_INCLUDE_DIR sndfile.h
 +FIND_PATH(LIBSNDFILE_INCLUDE_DIR sndfile.h
    HINTS
      ${_sndfile_SEARCH_DIRS}
    PATH_SUFFIXES
      include
  )
  
 -FIND_LIBRARY(SNDFILE_LIBRARY
 +FIND_LIBRARY(LIBSNDFILE_LIBRARY
    NAMES
      sndfile
    HINTS
      lib64 lib
    )
  
- # handle the QUIETLY and REQUIRED arguments and set LIBSNDFILE_FOUND to TRUE if 
 -# handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
++# handle the QUIETLY and REQUIRED arguments and set LIBSNDFILE_FOUND to TRUE if
  # all listed variables are TRUE
  INCLUDE(FindPackageHandleStandardArgs)
  FIND_PACKAGE_HANDLE_STANDARD_ARGS(SndFile DEFAULT_MSG
 -    SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
 +      LIBSNDFILE_LIBRARY LIBSNDFILE_INCLUDE_DIR)
  
 -IF(SNDFILE_FOUND)
 -  SET(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
 -  SET(SNDFILE_INCLUDE_DIRS ${SNDFILE_INCLUDE_DIR})
 -ENDIF(SNDFILE_FOUND)
 +IF(LIBSNDFILE_FOUND)
 +      SET(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBRARY})
 +      SET(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR})
 +ENDIF(LIBSNDFILE_FOUND)
  
  MARK_AS_ADVANCED(
 -  SNDFILE_INCLUDE_DIR
 -  SNDFILE_LIBRARY
 +      LIBSNDFILE_INCLUDE_DIR
 +      LIBSNDFILE_LIBRARY
  )
index 8f2ad03279c2b4c3fe32407bca02ac587ea2ddab,4399eb9e5c425a1f6595eadf310144aededdda90..73b4327264351ca36a415bb19a154024b452f884
@@@ -5,7 -5,8 +5,7 @@@
  #   cmake -C../blender/build_files/cmake/config/blender_headless.cmake  ../blender
  #
  
- set(WITH_HEADLESS            ON  CACHE BOOL "" FORCE) 
+ set(WITH_HEADLESS            ON  CACHE BOOL "" FORCE)
 -set(WITH_GAMEENGINE          OFF CACHE BOOL "" FORCE)
  
  # disable audio, its possible some devs may want this but for now disable
  # so the python module doesnt hold the audio device and loads quickly.
index 6157730af8edba9c0e2fa9ecf5cf446d8ac26b7c,38e738522c687530e1fae76d6e3e1efee14b11a6..8cf90d0d22c662ae4686e16b94eae1e6e7edce57
@@@ -51,7 -51,7 +51,7 @@@ endmacro(
  function(list_assert_duplicates
        list_id
        )
-       
        # message(STATUS "list data: ${list_id}")
  
        list(LENGTH list_id _len_before)
@@@ -242,7 -242,7 +242,7 @@@ function(blender_add_lib__imp
        # listed is helpful for IDE's (QtCreator/MSVC)
        blender_source_group("${sources}")
  
-       #if enabled, set the FOLDER property for visual studio projects 
+       #if enabled, set the FOLDER property for visual studio projects
        if(WINDOWS_USE_VISUAL_STUDIO_FOLDERS)
                get_filename_component(FolderDir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
                string(REPLACE ${CMAKE_SOURCE_DIR} "" FolderDir ${FolderDir})
@@@ -326,7 -326,7 +326,7 @@@ function(SETUP_LIBDIRS
                        link_directories(${JACK_LIBPATH})
                endif()
                if(WITH_CODEC_SNDFILE)
 -                      link_directories(${SNDFILE_LIBPATH})
 +                      link_directories(${LIBSNDFILE_LIBPATH})
                endif()
                if(WITH_FFTW3)
                        link_directories(${FFTW3_LIBPATH})
@@@ -412,7 -412,7 +412,7 @@@ function(setup_liblink
                target_link_libraries(${target} ${JACK_LIBRARIES})
        endif()
        if(WITH_CODEC_SNDFILE)
 -              target_link_libraries(${target} ${SNDFILE_LIBRARIES})
 +              target_link_libraries(${target} ${LIBSNDFILE_LIBRARIES})
        endif()
        if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
                target_link_libraries(${target} ${SDL_LIBRARY})
@@@ -560,12 -560,6 +560,12 @@@ function(SETUP_BLENDER_SORTED_LIBS
                endif()
        endif()
  
 +      if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
 +              list(APPEND BLENDER_LINK_LIBS
 +                      audaspace
 +                      audaspace-py)
 +      endif()
 +
        # Sort libraries
        set(BLENDER_SORTED_LIBS
                bf_windowmanager
                bf_editor_space_outliner
                bf_editor_space_script
                bf_editor_space_sequencer
 +              bf_editor_space_statusbar
                bf_editor_space_text
                bf_editor_space_time
 +              bf_editor_space_topbar
                bf_editor_space_userpref
                bf_editor_space_view3d
                bf_editor_space_clip
                bf_editor_curve
                bf_editor_gpencil
                bf_editor_interface
 +              bf_editor_manipulator_library
                bf_editor_mesh
                bf_editor_metaball
                bf_editor_object
                bf_editor_armature
                bf_editor_physics
                bf_editor_render
 +              bf_editor_scene
                bf_editor_screen
                bf_editor_sculpt_paint
                bf_editor_sound
                bf_python
                bf_python_ext
                bf_python_mathutils
 +              bf_python_gawain
                bf_python_bmesh
                bf_freestyle
                bf_ikplugin
                bf_alembic
                bf_bmesh
                bf_gpu
 +              bf_draw
                bf_blenloader
                bf_blenkernel
                bf_physics
                bf_nodes
                bf_rna
 +              bf_editor_manipulator_library  # rna -> manipulator bad-level calls
 +              bf_python
                bf_imbuf
                bf_blenlib
                bf_depsgraph
                bf_blenfont
                bf_blentranslation
                bf_intern_audaspace
 +              audaspace
 +              audaspace-py
                bf_intern_mikktspace
                bf_intern_dualcon
                bf_intern_cycles
                cycles_util
                cycles_subd
                bf_intern_opencolorio
 +              bf_intern_gawain
                bf_intern_eigen
                extern_rangetree
                extern_wcwidth
                list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
        endif()
  
 -      if(WITH_GAMEENGINE_DECKLINK)
 -              list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink)
 -      endif()
 -
        if(WIN32)
                list(APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect)
        endif()
@@@ -1528,7 -1515,6 +1528,7 @@@ function(find_python_packag
                  NAMES
                    ${package}
                  HINTS
 +                  "${PYTHON_LIBPATH}/"
                    "${PYTHON_LIBPATH}/python${PYTHON_VERSION}/"
                    "${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/"
                  PATH_SUFFIXES
index 0ee0845be33a6264952b0eb274962caa3d8024a5,df96333e9f1620cbe109f7ca2da4f9a1719032fe..468e82e8dacd39c6f012e63b7abc62548aeb0915
@@@ -130,8 -130,8 +130,8 @@@ include(InstallRequiredSystemLibraries
  
  remove_cc_flag("/MDd" "/MD")
  
- if(MSVC_CLANG) # Clangs version of cl doesn't support all flags 
-       if(NOT WITH_CXX11) # C++11 is on by default in clang-cl and can't be turned off, if c++11 is not enabled in blender repress some c++11 related warnings. 
+ if(MSVC_CLANG) # Clangs version of cl doesn't support all flags
+       if(NOT WITH_CXX11) # C++11 is on by default in clang-cl and can't be turned off, if c++11 is not enabled in blender repress some c++11 related warnings.
                set(CXX_WARN_FLAGS "-Wno-inconsistent-missing-override")
        endif()
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
@@@ -425,7 -425,7 +425,7 @@@ if(WITH_OPENIMAGEIO
        set(OIIO_OPTIMIZED optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO.lib optimized ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util.lib)
        set(OIIO_DEBUG debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_d.lib debug ${OPENIMAGEIO_LIBPATH}/OpenImageIO_Util_d.lib)
        set(OPENIMAGEIO_LIBRARIES ${OIIO_OPTIMIZED} ${OIIO_DEBUG})
-       
        set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
        set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
        set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
@@@ -474,7 -474,7 +474,7 @@@ if(WITH_OPENVDB
        set(OPENVDB_LIBPATH ${LIBDIR}/openvdb/lib)
        set(OPENVDB_INCLUDE_DIRS ${OPENVDB}/include ${TBB_INCLUDE_DIR})
        set(OPENVDB_LIBRARIES optimized ${OPENVDB_LIBPATH}/openvdb.lib debug ${OPENVDB_LIBPATH}/openvdb_d.lib ${TBB_LIBRARIES} ${BLOSC_LIBRARIES})
-       
  endif()
  
  if(WITH_ALEMBIC)
@@@ -551,7 -551,7 +551,7 @@@ set(WINTAB_INC ${LIBDIR}/wintab/include
  if(WITH_OPENAL)
        set(OPENAL ${LIBDIR}/openal)
        set(OPENALDIR ${LIBDIR}/openal)
 -      set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
 +      set(OPENAL_INCLUDE_DIR ${OPENAL}/include/AL)
        set(OPENAL_LIBPATH ${OPENAL}/lib)
        if(MSVC)
                set(OPENAL_LIBRARY ${OPENAL_LIBPATH}/openal32.lib)
  endif()
  
  if(WITH_CODEC_SNDFILE)
 -      set(SNDFILE ${LIBDIR}/sndfile)
 -      set(SNDFILE_INCLUDE_DIRS ${SNDFILE}/include)
 -      set(SNDFILE_LIBPATH ${SNDFILE}/lib) # TODO, deprecate
 -      set(SNDFILE_LIBRARIES ${SNDFILE_LIBPATH}/libsndfile-1.lib)
 -
 +      set(LIBSNDFILE ${LIBDIR}/sndfile)
 +      set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE}/include)
 +      set(LIBSNDFILE_LIBPATH ${LIBSNDFILE}/lib) # TODO, deprecate
 +      set(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBPATH}/libsndfile-1.lib)
  endif()
  
  if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)