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.
This commit is contained in:
Campbell Barton 2021-10-20 12:10:09 +11:00
parent b280699078
commit fd7510984a
4 changed files with 27 additions and 9 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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()