Merge branch 'master' into blender2.8
[blender.git] / CMakeLists.txt
index 212587d6d080bf1bc6e94b37b208bb49e8424d50..0d9d06b398972d02b28a80855c63de22177d8acb 100644 (file)
@@ -244,6 +244,8 @@ endif()
 option(WITH_PLAYER        "Build Player" OFF)
 option(WITH_OPENCOLORIO   "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
 
 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)
 
 # Compositor
 option(WITH_COMPOSITOR         "Enable the tile based nodal compositor" ON)
 
@@ -386,10 +388,14 @@ if(UNIX AND NOT APPLE)
 endif()
 
 option(WITH_PYTHON_INSTALL       "Copy system python into the blender install folder" ON)
 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_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)
 
        if(UNIX AND NOT APPLE)
                option(WITH_PYTHON_INSTALL_REQUESTS "Copy system requests into the blender install folder" ON)
@@ -470,28 +476,16 @@ endif()
 
 # OpenGL
 
 
 # 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_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(
 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_GLEW_ES
        WITH_GL_EGL
-       WITH_GL_PROFILE_COMPAT
-       WITH_GL_PROFILE_CORE
        WITH_GL_PROFILE_ES20
 )
 
        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)
 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)
@@ -517,11 +511,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(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)
 else()
        set(_c11_init OFF)
-       set(_cxx11_init OFF)
 endif()
 endif()
+set(_cxx11_init ON)
 
 option(WITH_C11 "Build with C11 standard enabled, for development use only!" ${_c11_init})
 mark_as_advanced(WITH_C11)
 
 option(WITH_C11 "Build with C11 standard enabled, for development use only!" ${_c11_init})
 mark_as_advanced(WITH_C11)
@@ -534,10 +527,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
        mark_as_advanced(WITH_LINKER_GOLD)
 endif()
 
        mark_as_advanced(WITH_LINKER_GOLD)
 endif()
 
-# Dependency graph
-option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
-mark_as_advanced(WITH_LEGACY_DEPSGRAPH)
-
 if(WIN32)
        # Use hardcoded paths or find_package to find externals
        option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
 if(WIN32)
        # Use hardcoded paths or find_package to find externals
        option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
@@ -600,6 +589,12 @@ if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
        message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
 endif()
 
        message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
 endif()
 
+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_OPENAL)
                message(FATAL_ERROR "WITH_OPENAL requires WITH_AUDASPACE")
 if(NOT WITH_AUDASPACE)
        if(WITH_OPENAL)
                message(FATAL_ERROR "WITH_OPENAL requires WITH_AUDASPACE")
@@ -648,15 +643,10 @@ if(NOT WITH_BOOST)
        endmacro()
 
        set_and_warn(WITH_CYCLES         OFF)
        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_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()
        WITH_OPENVDB OR WITH_OPENCOLORIO)
        # Keep enabled
 else()
@@ -725,30 +715,9 @@ TEST_SHARED_PTR_SUPPORT()
 TEST_UNORDERED_MAP_SUPPORT()
 
 if(WITH_AUDASPACE)
 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()
 
        endif()
 endif()
 
@@ -1001,19 +970,11 @@ endif()
 find_package(OpenGL)
 blender_include_dirs_sys("${OPENGL_INCLUDE_DIR}")
 
 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_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
        if(WITH_SYSTEM_GLES)
                if(NOT OPENGLES_LIBRARY)
                        message(FATAL_ERROR
@@ -1073,6 +1034,9 @@ elseif(WITH_GL_PROFILE_ES20)
 
        endif()
 
 
        endif()
 
+else()
+       list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
+
 endif()
 
 if(WITH_GL_EGL)
 endif()
 
 if(WITH_GL_EGL)
@@ -1120,16 +1084,10 @@ if(WITH_GL_EGL)
 
 endif()
 
 
 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)
 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)
 endif()
 
 if(WITH_GL_EGL)
@@ -1166,10 +1124,6 @@ endif()
 #-----------------------------------------------------------------------------
 # Configure GLEW
 
 #-----------------------------------------------------------------------------
 # Configure GLEW
 
-if(WITH_GLEW_MX)
-       list(APPEND GL_DEFINITIONS -DWITH_GLEW_MX)
-endif()
-
 if(WITH_SYSTEM_GLEW)
        find_package(GLEW)
 
 if(WITH_SYSTEM_GLEW)
        find_package(GLEW)
 
@@ -1179,11 +1133,7 @@ if(WITH_SYSTEM_GLEW)
                message(FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW.")
        endif()
 
                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")
 else()
        if(WITH_GLEW_ES)
                set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew-es/include")
@@ -1191,12 +1141,11 @@ else()
                list(APPEND GL_DEFINITIONS -DGLEW_STATIC -DWITH_GLEW_ES)
 
                # These definitions remove APIs from glew.h, making GLEW smaller, and catching unguarded API usage
                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)
                        # 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(WITH_GL_PROFILE_ES20)
@@ -1233,9 +1182,7 @@ else()
 
 endif()
 
 
 endif()
 
-if(NOT WITH_GLU)
-       list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
-endif()
+list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
 
 #-----------------------------------------------------------------------------
 # Configure Bullet
 
 #-----------------------------------------------------------------------------
 # Configure Bullet
@@ -1541,10 +1488,15 @@ if(WITH_PYTHON)
                )
        endif()
 
                )
        endif()
 
-       if(WIN32 OR APPLE)
+       if(WIN32)
                # pass, we have this in an archive to extract
                # 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(WIN32 OR APPLE)
@@ -1781,10 +1733,7 @@ if(FIRST_RUN)
 
        info_cfg_text("OpenGL:")
        info_cfg_option(WITH_GLEW_ES)
 
        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_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)
        info_cfg_option(WITH_GL_PROFILE_ES20)
        if(WIN32)
                info_cfg_option(WITH_GL_ANGLE)