Merge branch 'master' into blender2.8
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 23 Jul 2018 12:23:21 +0000 (14:23 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 23 Jul 2018 12:23:21 +0000 (14:23 +0200)
1  2 
CMakeLists.txt

diff --combined CMakeLists.txt
index 2961aafe908fcf3f4667bfccb37e0a2eea2df732,4de98860a6121893996472d4af8f94332e833e83..0d79ab2ed90f704e6fd67f397d2f4f233663e6bb
@@@ -156,6 -156,7 +156,6 @@@ option_defaults_init
        _init_OPENCOLORIO
        _init_SDL
        _init_FFTW3
 -      _init_GAMEENGINE
        _init_OPENSUBDIV
  )
  
@@@ -225,6 -226,13 +225,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
@@@ -308,6 -316,7 +308,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)
@@@ -370,14 -379,10 +370,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)
@@@ -458,18 -463,28 +458,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)
@@@ -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)
@@@ -609,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)
                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()
@@@ -665,10 -686,15 +665,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()
@@@ -737,9 -763,30 +737,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()
  
@@@ -1008,15 -1055,19 +1008,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)
@@@ -1166,6 -1220,10 +1166,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
@@@ -1536,15 -1601,10 +1536,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)
  endif()
  
  if(WITH_CXX11)
-       if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+       if(
+               CMAKE_COMPILER_IS_GNUCC OR
+               CMAKE_C_COMPILER_ID MATCHES "Clang" OR
+               CMAKE_C_COMPILER_ID MATCHES "Intel"
+       )
                # TODO(sergey): Do we want c++11 or gnu-c++11 here?
                set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
        elseif(MSVC)
@@@ -1634,7 -1698,7 +1638,7 @@@ if(WITH_GTESTS
        include(GTestTesting)
  endif()
  
 -if(WITH_BLENDER OR WITH_PLAYER)
 +if(WITH_BLENDER)
        add_subdirectory(intern)
        add_subdirectory(extern)
  
@@@ -1659,6 -1723,13 +1663,6 @@@ if(WITH_BLENDER
  endif()
  
  
 -#-----------------------------------------------------------------------------
 -# Blender Player
 -if(WITH_PLAYER)
 -      add_subdirectory(source/blenderplayer)
 -endif()
 -
 -
  #-----------------------------------------------------------------------------
  # Testing
  add_subdirectory(tests)
@@@ -1673,6 -1744,9 +1677,6 @@@ include(build_files/cmake/packaging.cma
  if(WITH_BLENDER)
        openmp_delayload(blender)
  endif()
 -if(WITH_PLAYER)
 -      openmp_delayload(blenderplayer)
 -endif()
  
  #-----------------------------------------------------------------------------
  # Print Final Configuration
@@@ -1706,6 -1780,8 +1710,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)