Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2014-01-20 23:41:54 +0400
committerThomas Dinges <blender@dingto.org>2014-01-20 23:44:39 +0400
commit21264f89ac7183bf188bf077c39852a843877aa9 (patch)
tree78fcc4d2d29dc3226792d2a3c9880c84b2ae1d5b
parentfc3be511f07a8107da5f9b0c8778d16295ced7cb (diff)
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
-rw-r--r--CMakeLists.txt14
-rw-r--r--GNUmakefile6
-rw-r--r--build_files/cmake/config/cycles_standalone.cmake14
-rw-r--r--intern/cycles/CMakeLists.txt13
4 files changed, 41 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7aa50e6c963..a432809ce32 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2255,10 +2255,16 @@ endif()
#-----------------------------------------------------------------------------
# Libraries
-add_subdirectory(source)
-add_subdirectory(intern)
-add_subdirectory(extern)
-
+if(WITH_BLENDER OR WITH_PLAYER)
+ add_subdirectory(source)
+ 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
diff --git a/GNUmakefile b/GNUmakefile
index 32e39033441..8ae2efbe53c 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -56,6 +56,10 @@ ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_lite
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake"
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))" ""
BUILD_DIR:=$(BUILD_DIR)_bpy
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake"
@@ -126,6 +130,7 @@ all:
debug: all
lite: all
+cycles: all
headless: all
bpy: all
@@ -144,6 +149,7 @@ help:
@echo " * debug - build a debug binary"
@echo " * lite - disable non essential features for a smaller binary and faster build"
@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 ""
@echo " * config - run cmake configuration tool to set build options"
diff --git a/build_files/cmake/config/cycles_standalone.cmake b/build_files/cmake/config/cycles_standalone.cmake
new file mode 100644
index 00000000000..45f9c100f93
--- /dev/null
+++ b/build_files/cmake/config/cycles_standalone.cmake
@@ -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)
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index 7d4254fa5d4..3b1c66ad712 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -1,6 +1,11 @@
-set(CYCLES_INSTALL_PATH "scripts/addons/cycles")
-set(WITH_CYCLES_BLENDER ON)
+# Standalone or with Blender
+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
@@ -101,3 +106,7 @@ add_subdirectory(render)
add_subdirectory(subd)
add_subdirectory(util)
+if(NOT WITH_BLENDER AND WITH_CYCLES_STANDALONE)
+ delayed_do_install(${CMAKE_BINARY_DIR}/bin)
+endif()
+