Merge remote-tracking branch 'origin/master' into blender2.8
authorRay Molenkamp <github@lazydodo.com>
Mon, 22 Oct 2018 16:19:06 +0000 (10:19 -0600)
committerRay Molenkamp <github@lazydodo.com>
Mon, 22 Oct 2018 16:19:06 +0000 (10:19 -0600)
1  2 
CMakeLists.txt
build_files/cmake/macros.cmake
build_files/cmake/platform/platform_win32.cmake
build_files/windows/parse_arguments.cmd
source/creator/CMakeLists.txt

diff --combined CMakeLists.txt
index 4b9e8317e26a4031bf9924e48852fb3e59060e20,fc7f3acbbb49db8ea450315b7cba439123c6fc7c..84c47e20b2b494176f43ad3e0ae0c9b49cfd83f1
@@@ -165,6 -165,7 +165,6 @@@ option_defaults_init
        _init_OPENCOLORIO
        _init_SDL
        _init_FFTW3
 -      _init_GAMEENGINE
        _init_OPENSUBDIV
  )
  
@@@ -234,6 -235,13 +234,6 @@@ 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})
  
  # Compositor
@@@ -241,9 -249,6 +241,9 @@@ option(WITH_COMPOSITOR         "Enable 
  
  option(WITH_OPENSUBDIV    "Enable OpenSubdiv for surface subdivision" _init_OPENSUBDIV)
  
 +option(WITH_OPENSUBDIV_MODIFIER    "Use OpenSubdiv for CPU side of Subsurf/Multires modifiers" OFF)
 +mark_as_advanced(WITH_OPENSUBDIV_MODIFIER)
 +
  option(WITH_OPENVDB       "Enable features relying on OpenVDB" OFF)
  option(WITH_OPENVDB_BLOSC "Enable blosc compression for OpenVDB, only enable if OpenVDB was built with blosc support" OFF)
  option(WITH_OPENVDB_3_ABI_COMPATIBLE "Assume OpenVDB library has been compiled with version 3 ABI compatibility" OFF)
@@@ -317,6 -322,7 +317,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)
@@@ -379,16 -385,10 +379,16 @@@ 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(WIN32 OR APPLE)
 +      # Windows and macOS have this bundled with Python libraries.
 +elseif(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)
@@@ -471,18 -471,28 +471,18 @@@ endif(
  
  # OpenGL
  
 -option(WITH_GLEW_MX             "Support multiple GLEW contexts (experimental)"                                                                     OFF )
 +option(WITH_OPENGL              "When off limits visibility of the opengl headers to just bf_gpu and gawain (temporary option for development purposes)" ON)
  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_OPENGL
        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)
@@@ -567,6 -577,9 +567,9 @@@ if(WIN32
  
        option(WINDOWS_USE_VISUAL_STUDIO_FOLDERS "Organize the visual studio project according to source folders." ON)
        mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_FOLDERS)
+       option(WINDOWS_PYTHON_DEBUG "Include the files needed for debugging python scripts with visual studio 2017+." OFF)
+       mark_as_advanced(WINDOWS_PYTHON_DEBUG)
  endif()
  
  # avoid using again
@@@ -602,13 -615,17 +605,13 @@@ 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")
 -endif()
 -
  if(NOT WITH_AUDASPACE)
        if(WITH_OPENAL)
                message(WARNING "WITH_OPENAL requires WITH_AUDASPACE which is disabled")
                message(WARNING "WITH_JACK requires WITH_AUDASPACE which is disabled")
                set(WITH_JACK OFF)
        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()
@@@ -652,10 -676,15 +655,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()
@@@ -718,9 -747,30 +721,9 @@@ if(WITH_BUILDINFO
  endif()
  
  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()
  
@@@ -984,15 -1034,19 +987,15 @@@ 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)
 +if(WITH_OPENGL)
 +      add_definitions(-DWITH_OPENGL)
  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)
@@@ -1142,6 -1199,10 +1145,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)
  
  endif()
  
 -if(NOT WITH_GLU)
 -      list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
 -endif()
 +list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
  
  #-----------------------------------------------------------------------------
  # Configure Bullet
@@@ -1441,7 -1509,6 +1444,7 @@@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSV
                # warning level:
                "/W3"
                "/w34062"  # switch statement contains 'default' but no 'case' labels
 +              "/w34189"  # local variable is initialized but not referenced
                # disable:
                "/wd4018"  # signed/unsigned mismatch
                "/wd4146"  # unary minus operator applied to unsigned type, result still unsigned
@@@ -1481,14 -1548,9 +1484,14 @@@ if(WITH_PYTHON
        endif()
  
        if(WIN32 OR APPLE)
 -              # pass, we have this in an archive to extract
 -      elseif(WITH_PYTHON_INSTALL AND WITH_PYTHON_INSTALL_NUMPY)
 -              find_python_package(numpy)
 +              # Windows and macOS have this bundled with Python libraries.
 +      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)
        (CMAKE_C_COMPILER_ID MATCHES "Clang" AND (NOT MSVC)) OR
        (CMAKE_C_COMPILER_ID MATCHES "Intel")
  )
 -      # Use C99 + GNU extensions, works with GCC, Clang, ICC
 -      if(WITH_C11)
 -              set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
 -      else()
 -              set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
 -      endif()
 +      # Use C11 + GNU extensions, works with GCC, Clang, ICC
 +      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
  endif()
  
  # Include warnings first, so its possible to disable them with user defined flags
@@@ -1567,7 -1633,7 +1570,7 @@@ if(WITH_GTESTS
        include(GTestTesting)
  endif()
  
 -if(WITH_BLENDER OR WITH_PLAYER)
 +if(WITH_BLENDER)
        add_subdirectory(intern)
        add_subdirectory(extern)
  
@@@ -1592,6 -1658,13 +1595,6 @@@ if(WITH_BLENDER
  endif()
  
  
 -#-----------------------------------------------------------------------------
 -# Blender Player
 -if(WITH_PLAYER)
 -      add_subdirectory(source/blenderplayer)
 -endif()
 -
 -
  #-----------------------------------------------------------------------------
  # Testing
  add_subdirectory(tests)
@@@ -1606,6 -1679,9 +1609,6 @@@ include(build_files/cmake/packaging.cma
  if(WITH_BLENDER)
        openmp_delayload(blender)
  endif()
 -if(WITH_PLAYER)
 -      openmp_delayload(blenderplayer)
 -endif()
  
  #-----------------------------------------------------------------------------
  # Print Final Configuration
@@@ -1639,6 -1715,8 +1642,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 3dc6f599c69e2039d426d08c52075b683c16979f,e2af3667f2a0c2cf6540a39e6e53f4741413aaca..9d679dc9b8f1c1263e6580b65e9190fa04542541
@@@ -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_transform
 -              bf_editor_util
                bf_editor_uvedit
                bf_editor_curve
 -              bf_editor_gpencil
                bf_editor_interface
 +              bf_editor_gizmo_library
                bf_editor_mesh
                bf_editor_metaball
                bf_editor_object
 +              bf_editor_gpencil
                bf_editor_lattice
                bf_editor_armature
                bf_editor_physics
                bf_editor_render
 +              bf_editor_scene
                bf_editor_screen
                bf_editor_sculpt_paint
                bf_editor_sound
                bf_editor_datafiles
                bf_editor_mask
                bf_editor_io
 +              bf_editor_util
  
                bf_render
                bf_python
                bf_python_ext
                bf_python_mathutils
 +              bf_python_gpu
                bf_python_bmesh
                bf_freestyle
                bf_ikplugin
                bf_modifiers
 +              bf_gpencil_modifiers
                bf_alembic
                bf_bmesh
                bf_gpu
 +              bf_draw
                bf_blenloader
                bf_blenkernel
 +              bf_shader_fx
 +              bf_gpencil_modifiers
                bf_physics
                bf_nodes
                bf_rna
 +              bf_editor_gizmo_library  # rna -> gizmo bad-level calls
 +              bf_python
                bf_imbuf
                bf_blenlib
                bf_depsgraph
                bf_intern_guardedalloc
                bf_intern_ctr
                bf_intern_utfconv
 -              ge_blen_routines
 -              ge_converter
 -              ge_phys_dummy
 -              ge_phys_bullet
                bf_intern_smoke
                extern_lzma
                extern_curve_fit_nd
 -              ge_logic_ketsji
 -              extern_recastnavigation
 -              ge_logic
 -              ge_rasterizer
 -              ge_oglrasterizer
 -              ge_logic_expressions
 -              ge_scenegraph
 -              ge_logic_network
 -              ge_logic_ngnetwork
 -              ge_logic_loopbacknetwork
                bf_intern_moto
                extern_openjpeg
 -              ge_videotex
                bf_dna
 +
                bf_blenfont
 +              bf_gpu  # duplicate for 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
  
                bf_intern_glew_mx
                bf_intern_clog
 +              bf_intern_opensubdiv
        )
  
        if(NOT WITH_SYSTEM_GLOG)
        endif()
  
        if(WITH_BULLET AND NOT WITH_SYSTEM_BULLET)
 -              list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
 -      endif()
 -
 -      if(WITH_GAMEENGINE_DECKLINK)
 -              list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink)
 +              list_insert_after(BLENDER_SORTED_LIBS "extern_openjpeg" "extern_bullet")
        endif()
  
        if(WIN32)
                list(APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect)
        endif()
  
 -      if(WITH_OPENSUBDIV OR WITH_CYCLES_OPENSUBDIV)
 -              list(APPEND BLENDER_SORTED_LIBS bf_intern_opensubdiv)
 -      endif()
 -
        if(WITH_OPENVDB)
                list(APPEND BLENDER_SORTED_LIBS bf_intern_openvdb)
        endif()
@@@ -1195,7 -1195,11 +1195,11 @@@ function(delayed_do_instal
                foreach(i RANGE ${n})
                        list(GET files ${i} f)
                        list(GET destinations ${i} d)
-                       install(FILES ${f} DESTINATION ${targetdir}/${d})
+                       if(NOT IS_ABSOLUTE ${d})
+                               install(FILES ${f} DESTINATION ${targetdir}/${d})
+                       else()
+                               install(FILES ${f} DESTINATION ${d})
+                       endif()
                endforeach()
        endif()
  endfunction()
@@@ -1378,7 -1382,6 +1382,7 @@@ function(find_python_packag
                  NAMES
                    ${package}
                  HINTS
 +                  "${PYTHON_LIBPATH}/"
                    "${PYTHON_LIBPATH}/python${PYTHON_VERSION}/"
                    "${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/"
                  PATH_SUFFIXES
index 0c1175df39b8bf91a747a6ad5e4094cf6b1cf5b3,440f514b02526feb5e8f5b4a3f716c98ed040e2b..b11dbfb8fba301912194d6c987b1f43fdb92d7d0
@@@ -567,10 -567,11 +567,10 @@@ if(WITH_OPENAL
  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)
@@@ -606,3 -607,40 +606,40 @@@ if(WITH_CYCLES_OSL
                set(WITH_CYCLES_OSL OFF)
        endif()
  endif()
+ if (WINDOWS_PYTHON_DEBUG)
+       # Include the system scripts in the blender_python_system_scripts project.
+       FILE(GLOB_RECURSE inFiles "${CMAKE_SOURCE_DIR}/release/scripts/*.*" )
+       ADD_CUSTOM_TARGET(blender_python_system_scripts SOURCES ${inFiles})
+       foreach(_source IN ITEMS ${inFiles})
+               get_filename_component(_source_path "${_source}" PATH)
+               string(REPLACE "${CMAKE_SOURCE_DIR}/release/scripts/" "" _source_path "${_source_path}")
+               string(REPLACE "/" "\\" _group_path "${_source_path}")
+               source_group("${_group_path}" FILES "${_source}")
+       endforeach()
+       # Include the user scripts from the profile folder in the blender_python_user_scripts project.
+       set(USER_SCRIPTS_ROOT "$ENV{appdata}/blender foundation/blender/${BLENDER_VERSION}")
+       file(TO_CMAKE_PATH ${USER_SCRIPTS_ROOT} USER_SCRIPTS_ROOT)
+       FILE(GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/scripts/*.*" )
+       ADD_CUSTOM_TARGET(blender_python_user_scripts SOURCES ${inFiles})
+       foreach(_source IN ITEMS ${inFiles})
+               get_filename_component(_source_path "${_source}" PATH)
+               string(REPLACE "${USER_SCRIPTS_ROOT}/scripts" "" _source_path "${_source_path}")
+               string(REPLACE "/" "\\" _group_path "${_source_path}")
+               source_group("${_group_path}" FILES "${_source}")
+       endforeach()
+       set_target_properties(blender_python_system_scripts PROPERTIES FOLDER "scripts")
+       set_target_properties(blender_python_user_scripts PROPERTIES FOLDER "scripts")
+       # Set the default debugging options for the project, only write this file once so the user
+       # is free to override them at their own perril.
+       set(USER_PROPS_FILE "${CMAKE_CURRENT_BINARY_DIR}/source/creator/blender.Cpp.user.props")
+       if(NOT EXISTS ${USER_PROPS_FILE})
+               # Layout below is messy, because otherwise the generated file will look messy.
+               file(WRITE ${USER_PROPS_FILE} "<?xml version=\"1.0\" encoding=\"utf-8\"?>
+ <Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">
+       <PropertyGroup>
+               <LocalDebuggerCommandArguments>-con --env-system-scripts \"${CMAKE_SOURCE_DIR}/release/scripts\" </LocalDebuggerCommandArguments>
+       </PropertyGroup>
+ </Project>")
+       endif()
+ endif()
index 0b57c77a6935476a7885a719a837649f2553be42,30bd2ebdcd2157fc55654c3d6cf5d77ef2b40d86..2c80a4d0b02705a9acd763f2104acb8d3152e0b1
@@@ -12,6 -12,9 +12,6 @@@ if NOT "%1" == "" 
        if "%1" == "debug" (
                set BUILD_TYPE=Debug
        REM Build Configurations
 -      ) else if "%1" == "noge" (
 -              set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_GAMEENGINE=OFF -DWITH_PLAYER=OFF
 -              set BUILD_NGE=_noge
        ) else if "%1" == "builddir" (
                set BUILD_DIR_OVERRRIDE="%BLENDER_DIR%..\%2"
                shift /1
@@@ -61,6 -64,8 +61,8 @@@
                shift /1
        ) else if "%1" == "nobuild" (
                set NOBUILD=1
+       ) else if "%1" == "pydebug" (
+               set WITH_PYDEBUG=1
        ) else if "%1" == "showhash" (
                SET BUILD_SHOW_HASHES=1
        REM Non-Build Commands
index 18a8ebeac377944cf966478cc862417c09da8ff1,fb02a7c871c5c129562343e52d115a30cd709794..7d382b0f58199289be2c735c44faecef29dcbf47
@@@ -76,6 -76,12 +76,6 @@@ if(WITH_HEADLESS
        add_definitions(-DWITH_HEADLESS)
  endif()
  
 -if(WITH_GAMEENGINE)
 -      blender_include_dirs(../gameengine/BlenderRoutines)
 -
 -      add_definitions(-DWITH_GAMEENGINE)
 -endif()
 -
  if(WITH_SDL)
        if(WITH_SDL_DYNLOAD)
                add_definitions(-DWITH_SDL_DYNLOAD)
@@@ -747,6 -753,19 +747,19 @@@ elseif(WIN32
                                DESTINATION ${BLENDER_VERSION}/python/bin
                                CONFIGURATIONS Debug
                        )
+                       if(WINDOWS_PYTHON_DEBUG)
+                               install(
+                                       FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.pdb
+                                       DESTINATION "."
+                                       CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
+                               )
+                               install(
+                                       FILES ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.pdb
+                                       DESTINATION "."
+                                       CONFIGURATIONS Debug
+                               )
+                       endif()
                endif()
  
                unset(_PYTHON_VERSION_NO_DOTS)
@@@ -925,6 -944,53 +938,6 @@@ elseif(APPLE
                unset(_py_inc_suffix)
        endif()
  
 -      # install blenderplayer bundle - copy of blender.app above. re-using macros et al
 -      # note we are using OSX Bundle as base and copying Blender dummy bundle on top of it
 -      if(WITH_GAMEENGINE AND WITH_PLAYER)
 -              set(OSX_APP_PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/release/darwin/blenderplayer.app)
 -              set(PLAYER_SOURCEINFO ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Info.plist)
 -              set(PLAYER_TARGETDIR_VER blenderplayer.app/Contents/Resources/${BLENDER_VERSION})
 -
 -
 -              # important to make a clean  install each time else old scripts get loaded.
 -              install(
 -                      CODE
 -                      "file(REMOVE_RECURSE ${PLAYER_TARGETDIR_VER})"
 -              )
 -
 -              # Give the bundle actual creation/modification date
 -              execute_process(COMMAND SetFile -d ${SETFILE_DATE} -m ${SETFILE_DATE}
 -                              ${EXECUTABLE_OUTPUT_PATH}/blenderplayer.app)
 -
 -              install(
 -                      FILES ${OSX_APP_PLAYER_SOURCEDIR}/Contents/PkgInfo
 -                      DESTINATION blenderplayer.app/Contents
 -              )
 -
 -              install_dir(
 -                      ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Resources
 -                      blenderplayer.app/Contents/
 -              )
 -
 -              if(WITH_OPENMP AND CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT ${CMAKE_C_COMPILER_VERSION} VERSION_LESS '3.4')
 -                      install(
 -                              FILES ${LIBDIR}/openmp/lib/libiomp5.dylib
 -                              DESTINATION blenderplayer.app/Contents/Resources/lib/
 -                      )
 -              endif()
 -
 -
 -              # python
 -              if(WITH_PYTHON AND NOT WITH_PYTHON_FRAMEWORK)
 -                      # Copy the python libs into the install directory
 -                      install_dir(
 -                              ${PYTHON_LIBPATH}
 -                              ${PLAYER_TARGETDIR_VER}/python/lib
 -                      )
 -              endif()
 -
 -      endif()
 -
  endif()
  
  # -----------------------------------------------------------------------------
@@@ -959,34 -1025,6 +972,34 @@@ unset(BLENDER_TEXT_FILES
  unset(BLENDER_TEXT_FILES_DESTINATION)
  
  
 +# -----------------------------------------------------------------------------
 +# Geometry Icons
 +
 +# Geometry icons.
 +get_property(_icon_names GLOBAL PROPERTY ICON_GEOM_NAMES)
 +set(_icon_files)
 +foreach(_f ${_icon_names})
 +      list(APPEND _icon_files
 +              "${CMAKE_SOURCE_DIR}/release/datafiles/icons/${_f}.dat"
 +      )
 +endforeach()
 +install(
 +      FILES ${_icon_files}
 +      DESTINATION ${TARGETDIR_VER}/datafiles/icons
 +)
 +
 +unset(_icon_names)
 +unset(_icon_files)
 +unset(_f)
 +
 +# -----------------------------------------------------------------------------
 +# Studio Lights
 +install(
 +      DIRECTORY
 +              ${CMAKE_SOURCE_DIR}/release/datafiles/studiolights
 +      DESTINATION ${TARGETDIR_VER}/datafiles
 +)
 +
  # -----------------------------------------------------------------------------
  # Setup link libs
  
@@@ -1006,4 -1044,9 +1019,9 @@@ if(WIN32 AND NOT WITH_PYTHON_MODULE
                COMPONENT Blender
                DESTINATION "."
        )
+       set_target_properties(
+               blender
+               PROPERTIES
+                       VS_USER_PROPS "blender.Cpp.user.props"
+       )
  endif()