[Bf-blender-cvs] [bd65ced04ae] tmp_lib_update_32: Build: enable WebP by default again, but auto disable for old libs

Brecht Van Lommel noreply at git.blender.org
Tue Apr 19 20:10:31 CEST 2022


Commit: bd65ced04ae7d3451705c1bff15624d02307e351
Author: Brecht Van Lommel
Date:   Tue Apr 19 20:01:17 2022 +0200
Branches: tmp_lib_update_32
https://developer.blender.org/rBbd65ced04ae7d3451705c1bff15624d02307e351

Build: enable WebP by default again, but auto disable for old libs

===================================================================

M	CMakeLists.txt
M	build_files/cmake/config/blender_full.cmake
M	build_files/cmake/config/blender_lite.cmake
M	build_files/cmake/config/blender_release.cmake
M	build_files/cmake/platform/platform_apple.cmake
M	build_files/cmake/platform/platform_old_libs_update.cmake
M	build_files/cmake/platform/platform_unix.cmake
M	build_files/cmake/platform/platform_win32.cmake

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f5a7563cdc..2cc9466c2ba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -284,7 +284,7 @@ option(WITH_IMAGE_TIFF          "Enable LibTIFF Support" ON)
 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_WEBP          "Enable WebP Image Support" OFF)
+option(WITH_IMAGE_WEBP          "Enable WebP Image Support" ON)
 
 # Audio/Video format support
 option(WITH_CODEC_AVI           "Enable Blenders own AVI file support (raw/jpeg)" ON)
diff --git a/build_files/cmake/config/blender_full.cmake b/build_files/cmake/config/blender_full.cmake
index 9faa0118ae2..e09577ac802 100644
--- a/build_files/cmake/config/blender_full.cmake
+++ b/build_files/cmake/config/blender_full.cmake
@@ -30,6 +30,7 @@ set(WITH_IMAGE_HDR           ON  CACHE BOOL "" FORCE)
 set(WITH_IMAGE_OPENEXR       ON  CACHE BOOL "" FORCE)
 set(WITH_IMAGE_OPENJPEG      ON  CACHE BOOL "" FORCE)
 set(WITH_IMAGE_TIFF          ON  CACHE BOOL "" FORCE)
+set(WITH_IMAGE_WEBP          ON  CACHE BOOL "" FORCE)
 set(WITH_INPUT_NDOF          ON  CACHE BOOL "" FORCE)
 set(WITH_INPUT_IME           ON  CACHE BOOL "" FORCE)
 set(WITH_INTERNATIONAL       ON  CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake
index 2d895f55c31..2f6057ee9c0 100644
--- a/build_files/cmake/config/blender_lite.cmake
+++ b/build_files/cmake/config/blender_lite.cmake
@@ -34,6 +34,7 @@ set(WITH_IMAGE_HDR           OFF CACHE BOOL "" FORCE)
 set(WITH_IMAGE_OPENEXR       OFF CACHE BOOL "" FORCE)
 set(WITH_IMAGE_OPENJPEG      OFF CACHE BOOL "" FORCE)
 set(WITH_IMAGE_TIFF          OFF CACHE BOOL "" FORCE)
+set(WITH_IMAGE_WEBP          OFF CACHE BOOL "" FORCE)
 set(WITH_INPUT_NDOF          OFF CACHE BOOL "" FORCE)
 set(WITH_INTERNATIONAL       OFF CACHE BOOL "" FORCE)
 set(WITH_JACK                OFF CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/config/blender_release.cmake b/build_files/cmake/config/blender_release.cmake
index 4e96975bd90..8ece5eec39e 100644
--- a/build_files/cmake/config/blender_release.cmake
+++ b/build_files/cmake/config/blender_release.cmake
@@ -31,6 +31,7 @@ set(WITH_IMAGE_HDR           ON  CACHE BOOL "" FORCE)
 set(WITH_IMAGE_OPENEXR       ON  CACHE BOOL "" FORCE)
 set(WITH_IMAGE_OPENJPEG      ON  CACHE BOOL "" FORCE)
 set(WITH_IMAGE_TIFF          ON  CACHE BOOL "" FORCE)
+set(WITH_IMAGE_WEBP          ON  CACHE BOOL "" FORCE)
 set(WITH_INPUT_NDOF          ON  CACHE BOOL "" FORCE)
 set(WITH_INPUT_IME           ON  CACHE BOOL "" FORCE)
 set(WITH_INTERNATIONAL       ON  CACHE BOOL "" FORCE)
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 0c999118c74..91d0b54e426 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -72,7 +72,6 @@ set(CMAKE_PREFIX_PATH ${LIB_SUBDIRS})
 
 if(EXISTS ${LIBDIR})
   include(platform_old_libs_update)
-
   without_system_libs_begin()
 endif()
 
diff --git a/build_files/cmake/platform/platform_old_libs_update.cmake b/build_files/cmake/platform/platform_old_libs_update.cmake
index c353797cf9d..014aa198caf 100644
--- a/build_files/cmake/platform/platform_old_libs_update.cmake
+++ b/build_files/cmake/platform/platform_old_libs_update.cmake
@@ -13,7 +13,8 @@ function(unset_cache_variables pattern)
 endfunction()
 
 # Detect update from 3.1 to 3.2 libs.
-if(DEFINED OPENEXR_VERSION AND
+if(UNIX AND
+   DEFINED OPENEXR_VERSION AND
    OPENEXR_VERSION VERSION_LESS "3.0.0" AND
    EXISTS ${LIBDIR}/imath)
   message(STATUS "Auto updating CMake configuration for Blender 3.2 libraries")
@@ -23,7 +24,14 @@ if(DEFINED OPENEXR_VERSION AND
   unset_cache_variables("^IMATH")
   unset_cache_variables("^PNG")
   unset_cache_variables("^USD")
+  unset_cache_variables("^WEBP")
+endif()
+
+# Automatically set WebP on/off depending if libraries are available.
+if(EXISTS ${LIBDIR}/webp)
   if(WITH_OPENIMAGEIO)
-    set(WITH_IMAGE_WEBP ON FORCE)
+    set(WITH_IMAGE_WEBP ON CACHE BOOL "" FORCE)
   endif()
+else()
+  set(WITH_IMAGE_WEBP OFF)
 endif()
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index ac9fa103c3a..6750c23d548 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -45,6 +45,9 @@ if(EXISTS ${LIBDIR})
   # which is a part of OpenCollada. They have different ABI, and we
   # do need to use the official one.
   set(CMAKE_PREFIX_PATH ${LIBDIR}/zlib ${LIB_SUBDIRS})
+
+  include(platform_old_libs_update)
+
   set(WITH_STATIC_LIBS ON)
   # OpenMP usually can't be statically linked into shared libraries,
   # due to not being compiled with position independent code.
@@ -57,8 +60,6 @@ if(EXISTS ${LIBDIR})
   set(Boost_NO_SYSTEM_PATHS ON)
   set(OPENEXR_ROOT_DIR ${LIBDIR}/openexr)
   set(CLANG_ROOT_DIR ${LIBDIR}/llvm)
-
-  include(platform_old_libs_update)
 endif()
 
 if(WITH_STATIC_LIBS)
diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake
index 2396f548602..c5d2049b292 100644
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@ -262,6 +262,8 @@ if(NOT EXISTS "${LIBDIR}/")
   message(FATAL_ERROR "\n\nWindows requires pre-compiled libs at: '${LIBDIR}'. Please run `make update` in the blender source folder to obtain them.")
 endif()
 
+include(platform_old_libs_update)
+
 if(CMAKE_GENERATOR MATCHES "^Visual Studio.+" AND # Only supported in the VS IDE
    MSVC_VERSION GREATER_EQUAL 1924            AND # Supported for 16.4+
    WITH_CLANG_TIDY                                # And Clang Tidy needs to be on



More information about the Bf-blender-cvs mailing list