[Bf-blender-cvs] [21264f8] master: Cycles: Add a cmake config to easily compile Cycles Standalone.

Thomas Dinges noreply at git.blender.org
Mon Jan 20 20:44:49 CET 2014


Commit: 21264f89ac7183bf188bf077c39852a843877aa9
Author: Thomas Dinges
Date:   Mon Jan 20 20:41:54 2014 +0100
https://developer.blender.org/rB21264f89ac7183bf188bf077c39852a843877aa9

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

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

M	CMakeLists.txt
M	GNUmakefile
A	build_files/cmake/config/cycles_standalone.cmake
M	intern/cycles/CMakeLists.txt

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7aa50e6..a432809 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 32e3903..8ae2efb 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 0000000..45f9c10
--- /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 7d4254f..3b1c66a 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()
+




More information about the Bf-blender-cvs mailing list