Cycles: Add a cmake config to easily compile Cycles Standalone.

On Linux/Mac OS X, simply type "make cycles" inside the Blender source directory, to get a standalone build of the engine.

Reviewed by: Brecht
Differential Revision: https://developer.blender.org/D228
This commit is contained in:
Thomas Dinges
2014-01-20 20:41:54 +01:00
parent fc3be511f0
commit 21264f89ac
4 changed files with 41 additions and 6 deletions

View File

@@ -2255,10 +2255,16 @@ endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Libraries # Libraries
add_subdirectory(source) if(WITH_BLENDER OR WITH_PLAYER)
add_subdirectory(intern) add_subdirectory(source)
add_subdirectory(extern) add_subdirectory(intern)
add_subdirectory(extern)
elseif(WITH_CYCLES_STANDALONE)
add_subdirectory(intern/cycles)
if(WITH_CYCLES_STANDALONE_GUI)
add_subdirectory(extern/glew)
endif()
endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Blender Application # Blender Application

View File

@@ -56,6 +56,10 @@ ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_lite BUILD_DIR:=$(BUILD_DIR)_lite
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake" BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake"
endif endif
ifneq "$(findstring cycles, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_cycles
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake"
endif
ifneq "$(findstring headless, $(MAKECMDGOALS))" "" ifneq "$(findstring headless, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_bpy BUILD_DIR:=$(BUILD_DIR)_bpy
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake" BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake"
@@ -126,6 +130,7 @@ all:
debug: all debug: all
lite: all lite: all
cycles: all
headless: all headless: all
bpy: all bpy: all
@@ -144,6 +149,7 @@ help:
@echo " * debug - build a debug binary" @echo " * debug - build a debug binary"
@echo " * lite - disable non essential features for a smaller binary and faster build" @echo " * lite - disable non essential features for a smaller binary and faster build"
@echo " * headless - build without an interface (renderfarm or server automation)" @echo " * headless - build without an interface (renderfarm or server automation)"
@echo " * cycles - build Cycles standalone only, without Blender"
@echo " * bpy - build as a python module which can be loaded from python directly" @echo " * bpy - build as a python module which can be loaded from python directly"
@echo "" @echo ""
@echo " * config - run cmake configuration tool to set build options" @echo " * config - run cmake configuration tool to set build options"

View File

@@ -0,0 +1,14 @@
# only compile Cycles standalone, without Blender
#
# Example usage:
# cmake -C../blender/build_files/cmake/config/cycles_standalone.cmake ../blender
#
# disable Blender
set(WITH_BLENDER OFF CACHE BOOL "" FORCE)
set(WITH_PLAYER OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_BLENDER OFF CACHE BOOL "" FORCE)
# build Cycles
set(WITH_CYCLES_STANDALONE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_STANDALONE_GUI ON CACHE BOOL "" FORCE)

View File

@@ -1,6 +1,11 @@
set(CYCLES_INSTALL_PATH "scripts/addons/cycles") # Standalone or with Blender
set(WITH_CYCLES_BLENDER ON) if(NOT WITH_BLENDER AND WITH_CYCLES_STANDALONE)
set(CYCLES_INSTALL_PATH "")
else()
set(WITH_CYCLES_BLENDER ON)
set(CYCLES_INSTALL_PATH "scripts/addons/cycles")
endif()
# External Libraries # External Libraries
@@ -101,3 +106,7 @@ add_subdirectory(render)
add_subdirectory(subd) add_subdirectory(subd)
add_subdirectory(util) add_subdirectory(util)
if(NOT WITH_BLENDER AND WITH_CYCLES_STANDALONE)
delayed_do_install(${CMAKE_BINARY_DIR}/bin)
endif()