Fix (unreported) crash when duplicating a FileBrowser window in preview draw mode.
[blender.git] / CMakeLists.txt
index b3a0dfa96ebbf53b0643d6ef78a9f8d333ac54a1..c0a0b4bd27f0132ea177614b85bf378c53cf37cd 100644 (file)
@@ -45,7 +45,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
        endif()
 endif()
 
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.5)
 
 if(NOT EXECUTABLE_OUTPUT_PATH)
        set(FIRST_RUN TRUE)
@@ -195,7 +195,7 @@ endif()
 # Options
 
 # First platform specific non-cached vars
-if(UNIX AND NOT APPLE)
+if(UNIX AND NOT (APPLE OR HAIKU))
        set(WITH_X11 ON)
 endif()
 
@@ -285,6 +285,7 @@ endif()
 if(WITH_X11)
        option(WITH_X11_XINPUT    "Enable X11 Xinput (tablet support and unicode input)"  ON)
        option(WITH_X11_XF86VMODE "Enable X11 video mode switching"                       ON)
+       option(WITH_X11_XFIXES    "Enable X11 XWayland cursor warping workaround"         ON)
        option(WITH_X11_ALPHA     "Enable X11 transparent background"                     ON)
 endif()
 
@@ -309,7 +310,6 @@ endif()
 # Modifiers
 option(WITH_MOD_FLUID           "Enable Elbeem Modifier (Fluid Simulation)" ON)
 option(WITH_MOD_SMOKE           "Enable Smoke Modifier (Smoke Simulation)" ON)
-option(WITH_MOD_BOOLEAN         "Enable Boolean Modifier" ON)
 option(WITH_MOD_REMESH          "Enable Remesh Modifier" ON)
 # option(WITH_MOD_CLOTH_ELTOPO    "Enable Experimental cloth solver" OFF)  # this is now only available in a branch
 # mark_as_advanced(WITH_MOD_CLOTH_ELTOPO)
@@ -408,12 +408,14 @@ 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_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)
 set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 CACHE STRING "CUDA architectures to build binaries for")
 mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
 unset(PLATFORM_DEFAULT)
 option(WITH_CYCLES_LOGGING     "Build Cycles with logging support" ON)
 option(WITH_CYCLES_DEBUG       "Build Cycles with extra debug capabilities" OFF)
 option(WITH_CYCLES_NATIVE_ONLY "Build Cycles with native kernel only (which fits current CPU, use for development only)" OFF)
+mark_as_advanced(WITH_CYCLES_CUBIN_COMPILER)
 mark_as_advanced(WITH_CYCLES_LOGGING)
 mark_as_advanced(WITH_CYCLES_DEBUG)
 mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
@@ -541,6 +543,9 @@ if(WIN32)
 
        set(WINDOWS_CODESIGN_PFX_PASSWORD CACHE STRING  "password for pfx file used for codesigning.")
        mark_as_advanced(WINDOWS_CODESIGN_PFX_PASSWORD)
+
+       option(WINDOWS_USE_VISUAL_STUDIO_FOLDERS "Organize the visual studio project according to source folders." ON)
+       mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_FOLDERS)
 endif()
 
 # avoid using again
@@ -639,13 +644,12 @@ if(NOT WITH_BOOST)
        set_and_warn(WITH_INTERNATIONAL  OFF)
        set_and_warn(WITH_OPENVDB        OFF)
        set_and_warn(WITH_OPENCOLORIO    OFF)
-       set_and_warn(WITH_MOD_BOOLEAN    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
-       WITH_OPENVDB OR WITH_OPENCOLORIO OR WITH_MOD_BOOLEAN)
+       WITH_OPENVDB OR WITH_OPENCOLORIO)
        # Keep enabled
 else()
        # New dependency graph needs either Boost or C++11 for function bindings.
@@ -687,6 +691,7 @@ if(WITH_GHOST_SDL OR WITH_HEADLESS)
        set(WITH_X11           OFF)
        set(WITH_X11_XINPUT    OFF)
        set(WITH_X11_XF86VMODE OFF)
+       set(WITH_X11_XFIXES    OFF)
        set(WITH_X11_ALPHA     OFF)
        set(WITH_GHOST_XDND    OFF)
        set(WITH_INPUT_IME     OFF)
@@ -758,7 +763,7 @@ if(WITH_INTERNATIONAL)
 endif()
 
 if(WITH_PYTHON)
-       # While we have this as an '#error' in bpy_util.h,
+       # While we have this as an '#error' in 'bpy_capi_utils.h',
        # upgrading Python tends to cause confusion for users who build.
        # Give the error message early to make this more obvious.
        #
@@ -838,6 +843,14 @@ if(WITH_X11)
                endif()
        endif()
 
+       if(WITH_X11_XFIXES)
+               if(X11_Xfixes_LIB)
+                       list(APPEND PLATFORM_LINKLIBS ${X11_Xfixes_LIB})
+               else()
+                       set(WITH_X11_XFIXES OFF)
+               endif()
+       endif()
+
        if(WITH_X11_ALPHA)
                find_library(X11_Xrender_LIB Xrender  ${X11_LIB_SEARCH_PATH})
                mark_as_advanced(X11_Xrender_LIB)
@@ -1412,10 +1425,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
 
 elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
 
-       if(APPLE AND WITH_OPENMP) # we need the Intel omp lib linked here to not fail all tests due presence of -fopenmp !
-               set(CMAKE_REQUIRED_FLAGS "-L${LIBDIR}/openmp/lib -liomp5") # these are only used for the checks
-       endif()
-
        # strange, clang complains these are not supported, but then uses them.
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
@@ -1646,10 +1655,10 @@ include(build_files/cmake/packaging.cmake)
 # Use dynamic loading for OpenMP
 if(WITH_BLENDER)
        openmp_delayload(blender)
-endif(WITH_BLENDER)
+endif()
 if(WITH_PLAYER)
        openmp_delayload(blenderplayer)
-endif(WITH_PLAYER)
+endif()
 
 #-----------------------------------------------------------------------------
 # Print Final Configuration
@@ -1707,6 +1716,7 @@ if(FIRST_RUN)
        info_cfg_option(WITH_INSTALL_PORTABLE)
        info_cfg_option(WITH_X11_ALPHA)
        info_cfg_option(WITH_X11_XF86VMODE)
+       info_cfg_option(WITH_X11_XFIXES)
        info_cfg_option(WITH_X11_XINPUT)
        info_cfg_option(WITH_MEM_JEMALLOC)
        info_cfg_option(WITH_MEM_VALGRIND)
@@ -1746,7 +1756,6 @@ if(FIRST_RUN)
        endif()
 
        info_cfg_text("Modifiers:")
-       info_cfg_option(WITH_MOD_BOOLEAN)
        info_cfg_option(WITH_MOD_REMESH)
        info_cfg_option(WITH_MOD_FLUID)
        info_cfg_option(WITH_MOD_OCEANSIM)