From 2eba5e2a06f544368198ab1d29770c95f4dcdfd1 Mon Sep 17 00:00:00 2001 From: Sergey Lapin Date: Sat, 30 Aug 2025 21:10:46 +0300 Subject: [PATCH] Proper blender use --- CMakeLists.txt | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f3cad0..69d854b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,19 @@ find_program (MAKE_EXECUTABLE make DOC make REQUIRED) find_package (PkgConfig) pkg_check_modules(GFX_LIBS REQUIRED wayland-client wayland-protocols x11) +set(CPU ${CMAKE_SYSTEM_PROCESSOR}) + +set(BLENDER_DIST ${CMAKE_SOURCE_DIR}/prebuilts/Blender-3.6-unknown-linux-${CPU}.tar.xz) + +add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/blender-bin/bin/blender + COMMAND [ -f ${BLENDER_DIST} ] || ./build-blender.sh + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/blender-bin + COMMAND tar xf ${BLENDER_DIST} -C ${CMAKE_BINARY_DIR}/blender-bin + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/blender-bin/bin + COMMAND ln -sf ../Blender-3.6-unknown-linux-${CPU}/blender ${CMAKE_BINARY_DIR}/blender-bin/bin/blender +) + +add_custom_target(blender DEPENDS ${CMAKE_BINARY_DIR}/blender-bin/bin/blender) ExternalProject_Add(zlib-nominizip SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zlib @@ -279,13 +292,13 @@ ExternalProject_Add(flecs-static ExternalProject_Add(world2 SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ogre-projects/world2 - CMAKE_ARGS ${CUSTOM_OPTS} - DEPENDS ogre ogre-procedural ogre-pagedgeometry flecs SDL + CMAKE_ARGS ${CUSTOM_OPTS} -DBLENDER=${CMAKE_CURRENT_BINARY_DIR}/blender-bin/bin/blender + DEPENDS ogre ogre-procedural ogre-pagedgeometry flecs SDL blender ) ExternalProject_Add(world2-static SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ogre-projects/world2 - CMAKE_ARGS ${CUSTOM_OPTS_STATIC} - DEPENDS ogre-static ogre-procedural-static ogre-pagedgeometry-static flecs-static SDL-static + CMAKE_ARGS ${CUSTOM_OPTS_STATIC} -DBLENDER=${CMAKE_CURRENT_BINARY_DIR}/blender-bin/bin/blender + DEPENDS ogre-static ogre-procedural-static ogre-pagedgeometry-static flecs-static SDL-static blender )