3D View: use full opacity by default
[blender.git] / CMakeLists.txt
index d38c7d14eb98c2e449edd376bcd08e8e24298642..8d8f78a3e7a7dba8c46ee2aa30adfad34c43ee4c 100644 (file)
@@ -47,6 +47,13 @@ endif()
 
 cmake_minimum_required(VERSION 3.5)
 
+# Prever LEGACY OpenGL to eb compatible with all the existing releases and
+# platforms which don't hare GLVND yet. Only do it if preference was not set
+# externally.
+if(NOT DEFINED OpenGL_GL_PREFERENCE)
+       set(OpenGL_GL_PREFERENCE "LEGACY")
+endif()
+
 if(NOT EXECUTABLE_OUTPUT_PATH)
        set(FIRST_RUN TRUE)
 else()
@@ -184,7 +191,6 @@ elseif(WIN32)
        set(_init_JACK                           OFF)
 elseif(APPLE)
        set(_init_JACK                           OFF)
-       set(_init_OPENSUBDIV                     OFF)
 endif()
 
 
@@ -237,10 +243,7 @@ option(WITH_OPENCOLORIO   "Enable OpenColorIO color management" ${_init_OPENCOLO
 # Compositor
 option(WITH_COMPOSITOR         "Enable the tile based nodal compositor" ON)
 
-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_OPENSUBDIV    "Enable OpenSubdiv for surface subdivision" ${_init_OPENSUBDIV})
 
 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)
@@ -408,7 +411,7 @@ 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_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
 mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
-set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 CACHE STRING "CUDA architectures to build binaries for")
+set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_72 sm_75 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)
@@ -1054,8 +1057,11 @@ if(WITH_GL_PROFILE_ES20)
        endif()
 
 else()
-       list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_gl_LIBRARY}")
-
+       if(OpenGL_GL_PREFERENCE STREQUAL "LEGACY" AND OPENGL_gl_LIBRARY)
+               list(APPEND BLENDER_GL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glx_LIBRARY})
+       else()
+               list(APPEND BLENDER_GL_LIBRARIES ${OPENGL_opengl_LIBRARY} ${OPENGL_glx_LIBRARY})
+       endif()
 endif()
 
 if(WITH_GL_EGL)
@@ -1462,6 +1468,11 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
                "/we4431"  # missing type specifier - int assumed
        )
 
+       if(MSVC_VERSION GREATER_EQUAL 1911)
+               # see https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5038?view=vs-2017
+               set(_WARNINGS "${_WARNINGS} /w35038") #order of initialisation in c++ constructors
+       endif()
+
        string(REPLACE ";" " " _WARNINGS "${_WARNINGS}")
        set(C_WARNINGS "${_WARNINGS}")
        set(CXX_WARNINGS "${_WARNINGS}")