[Bf-blender-cvs] [fd7510984a6] master: CMake: add WITH_BLENDER_THUMBNAILER option

Campbell Barton noreply at git.blender.org
Wed Oct 20 03:16:28 CEST 2021


Commit: fd7510984a6d472969436721031ae309ec4981a0
Author: Campbell Barton
Date:   Wed Oct 20 12:10:09 2021 +1100
Branches: master
https://developer.blender.org/rBfd7510984a6d472969436721031ae309ec4981a0

CMake: add WITH_BLENDER_THUMBNAILER option

Make building the thumbnail extraction executable optional,
disable on macOS as this was not linking, further, macOS doesn't use
this for thumbnail extraction so it could be left disabled.

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

M	CMakeLists.txt
M	build_files/cmake/config/blender_lite.cmake
M	source/blender/CMakeLists.txt
M	source/creator/CMakeLists.txt

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 16842f3134b..544e22f342b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,6 +156,16 @@ get_blender_version()
 option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
 mark_as_advanced(WITH_BLENDER)
 
+if(APPLE)
+  # Currently this causes a build error linking, disable.
+  set(WITH_BLENDER_THUMBNAILER OFF)
+elseif(WIN32)
+  # Building the thumbnail extraction DLL could be made optional.
+  set(WITH_BLENDER_THUMBNAILER ON)
+else()
+  option(WITH_BLENDER_THUMBNAILER "Build \"blender-thumbnailer\" thumbnail extraction utility" ON)
+endif()
+
 option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
 
 option(WITH_PYTHON        "Enable Embedded Python API  (only disable for development)" ON)
diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake
index 0cd886e67d7..89bd46ecd7d 100644
--- a/build_files/cmake/config/blender_lite.cmake
+++ b/build_files/cmake/config/blender_lite.cmake
@@ -9,6 +9,7 @@ set(WITH_INSTALL_PORTABLE    ON  CACHE BOOL "" FORCE)
 
 set(WITH_ALEMBIC             OFF CACHE BOOL "" FORCE)
 set(WITH_AUDASPACE           OFF CACHE BOOL "" FORCE)
+set(WITH_BLENDER_THUMBNAILER OFF CACHE BOOL "" FORCE)
 set(WITH_BOOST               OFF CACHE BOOL "" FORCE)
 set(WITH_BUILDINFO           OFF CACHE BOOL "" FORCE)
 set(WITH_BULLET              OFF CACHE BOOL "" FORCE)
diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt
index 0a494677d96..c6112344208 100644
--- a/source/blender/CMakeLists.txt
+++ b/source/blender/CMakeLists.txt
@@ -131,7 +131,10 @@ add_subdirectory(io)
 add_subdirectory(functions)
 add_subdirectory(makesdna)
 add_subdirectory(makesrna)
-add_subdirectory(blendthumb)
+
+if(WITH_BLENDER_THUMBNAILER)
+  add_subdirectory(blendthumb)
+endif()
 
 if(WITH_COMPOSITOR)
   add_subdirectory(compositor)
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 45bfc3d6bdb..1d5d1491c7a 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -515,10 +515,12 @@ if(UNIX AND NOT APPLE)
       DESTINATION "."
     )
 
-    install(
-      TARGETS blender-thumbnailer
-      DESTINATION "."
-    )
+    if(WITH_BLENDER_THUMBNAILER)
+      install(
+        TARGETS blender-thumbnailer
+        DESTINATION "."
+      )
+    endif()
 
     if(EXISTS ${LIBDIR}/mesa)
       install(DIRECTORY ${LIBDIR}/mesa/lib DESTINATION ".")
@@ -558,10 +560,12 @@ if(UNIX AND NOT APPLE)
       FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/symbolic/apps/blender-symbolic.svg
       DESTINATION share/icons/hicolor/symbolic/apps
     )
-    install(
-      TARGETS blender-thumbnailer
-      DESTINATION bin
-    )
+    if(WITH_BLENDER_THUMBNAILER)
+      install(
+        TARGETS blender-thumbnailer
+        DESTINATION bin
+      )
+    endif()
     set(BLENDER_TEXT_FILES_DESTINATION share/doc/blender)
   endif()



More information about the Bf-blender-cvs mailing list