Merge branch 'master' into blender2.8
[blender.git] / CMakeLists.txt
index fa1405994c3835385c5da0e16bfde5e054698183..eea7876e17bc1473e89dd2c1d4f0d61d8e99ef2f 100644 (file)
@@ -379,7 +379,9 @@ 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 OR (WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE))
+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")
        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")
@@ -403,6 +405,7 @@ option(WITH_CYCLES                                  "Enable Cycles Render Engine" ON)
 option(WITH_CYCLES_STANDALONE          "Build Cycles standalone application" OFF)
 option(WITH_CYCLES_STANDALONE_GUI      "Build Cycles standalone with GUI" OFF)
 option(WITH_CYCLES_OSL                         "Build Cycles with OSL support" ${_init_CYCLES_OSL})
 option(WITH_CYCLES_STANDALONE          "Build Cycles standalone application" OFF)
 option(WITH_CYCLES_STANDALONE_GUI      "Build Cycles standalone with GUI" OFF)
 option(WITH_CYCLES_OSL                         "Build Cycles with OSL support" ${_init_CYCLES_OSL})
+option(WITH_CYCLES_EMBREE                      "Build Cycles with Embree support" OFF)
 option(WITH_CYCLES_OPENSUBDIV          "Build Cycles with OpenSubdiv support" ${_init_CYCLES_OPENSUBDIV})
 option(WITH_CYCLES_CUDA_BINARIES       "Build Cycles CUDA binaries" OFF)
 option(WITH_CYCLES_CUBIN_COMPILER      "Build cubins with nvrtc based compiler instead of nvcc" OFF)
 option(WITH_CYCLES_OPENSUBDIV          "Build Cycles with OpenSubdiv support" ${_init_CYCLES_OPENSUBDIV})
 option(WITH_CYCLES_CUDA_BINARIES       "Build Cycles CUDA binaries" OFF)
 option(WITH_CYCLES_CUBIN_COMPILER      "Build cubins with nvrtc based compiler instead of nvcc" OFF)
@@ -565,6 +568,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_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
 endif()
 
 # avoid using again
@@ -1452,6 +1458,7 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
                "/wd4305"  # truncation from 'type1' to 'type2'
                "/wd4800"  # forcing value to bool 'true' or 'false'
                "/wd4828"  # The file contains a character that is illegal
                "/wd4305"  # truncation from 'type1' to 'type2'
                "/wd4800"  # forcing value to bool 'true' or 'false'
                "/wd4828"  # The file contains a character that is illegal
+               "/wd4996"  # identifier was declared deprecated
                # errors:
                "/we4013"  # 'function' undefined; assuming extern returning int
                "/we4133"  # incompatible pointer types
                # errors:
                "/we4013"  # 'function' undefined; assuming extern returning int
                "/we4133"  # incompatible pointer types
@@ -1477,14 +1484,14 @@ if(WITH_PYTHON)
                )
        endif()
 
                )
        endif()
 
-       if(WIN32)
-               # pass, we have this in an archive to extract
+       if(WIN32 OR APPLE)
+               # 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")
        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)
+                       mark_as_advanced(PYTHON_NUMPY_INCLUDE_DIRS)
                endif()
        endif()
 
                endif()
        endif()
 
@@ -1515,12 +1522,8 @@ if(
        (CMAKE_C_COMPILER_ID MATCHES "Clang" AND (NOT MSVC)) OR
        (CMAKE_C_COMPILER_ID MATCHES "Intel")
 )
        (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
 endif()
 
 # Include warnings first, so its possible to disable them with user defined flags