Cycles: Add a cmake config to easily compile Cycles Standalone.
authorThomas Dinges <blender@dingto.org>
Mon, 20 Jan 2014 19:41:54 +0000 (20:41 +0100)
committerThomas Dinges <blender@dingto.org>
Mon, 20 Jan 2014 19:44:39 +0000 (20:44 +0100)
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

CMakeLists.txt
GNUmakefile
build_files/cmake/config/cycles_standalone.cmake [new file with mode: 0644]
intern/cycles/CMakeLists.txt

index 7aa50e6c963fe193ac7da1ee6f834345d11ec229..a432809ce328cb053678c666c7fd266f686a130b 100644 (file)
@@ -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
index 32e390334417940121519c62c043284ca3d7533c..8ae2efbe53c9566ccab544e04e275c8fba3b9eca 100644 (file)
@@ -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 (file)
index 0000000..45f9c10
--- /dev/null
@@ -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)
index 7d4254fa5d496ae1e34fa66ae07e8ac4c69e990b..3b1c66ad71238563039296f24d83fad196d0c1d9 100644 (file)
@@ -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()
+