added cmake configureation presets, so on *nix systems you can do...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 16 Aug 2011 09:36:15 +0000 (09:36 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 16 Aug 2011 09:36:15 +0000 (09:36 +0000)
 # minal blender with debug info
 make debug lite

 # blender with no ui
 make headless

 # blender as a python module
 make bpy

GNUmakefile
build_files/cmake/config/blender_headless.cmake [new file with mode: 0644]
build_files/cmake/config/blender_lite.cmake [new file with mode: 0644]
build_files/cmake/config/bpy_module.cmake [new file with mode: 0644]

index b6741d7e5f0654a381f2bd074ef97611d92e6e5b..efdb9e05e28d61a7d32f14ef1ac794e3878790f2 100644 (file)
@@ -35,16 +35,26 @@ OS_NCASE:=$(shell uname -s | tr '[A-Z]' '[a-z]')
 # Source and Build DIR's
 BLENDER_DIR:=$(shell pwd -P)
 BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build/$(OS_NCASE)
-
+BUILD_TYPE:=Release
+BUILD_CMAKE_ARGS:=""
 
 # support 'make debug'
 ifneq "$(findstring debug, $(MAKECMDGOALS))" ""
        BUILD_DIR:=$(BUILD_DIR)_debug
        BUILD_TYPE:=Debug
-else
-       BUILD_TYPE:=Release
 endif
-
+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 headless, $(MAKECMDGOALS))" ""
+       BUILD_DIR:=$(BUILD_DIR)_bpy
+       BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake
+endif
+ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
+       BUILD_DIR:=$(BUILD_DIR)_bpy
+       BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake
+endif
 
 # Get the number of cores for threaded build
 NPROCS:=1
@@ -68,7 +78,7 @@ all:
        @echo Configuring Blender ...
 
        if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \
-               cmake -H$(BLENDER_DIR) -B$(BUILD_DIR) -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE) ; \
+               cmake $(BUILD_CMAKE_ARGS) -H$(BLENDER_DIR) -B$(BUILD_DIR) -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE); \
        fi
 
        @echo
@@ -80,7 +90,9 @@ all:
        @echo
 
 debug: all
-       # pass
+lite: all
+headless: all
+bpy: all
 
 # package types
 package_debian:
diff --git a/build_files/cmake/config/blender_headless.cmake b/build_files/cmake/config/blender_headless.cmake
new file mode 100644 (file)
index 0000000..bd69eed
--- /dev/null
@@ -0,0 +1,24 @@
+# headless configuration, useful in for servers or renderfarms
+# builds without a windowing system (X11/Windows/Cocoa).
+#
+# Example usage:
+#   cmake -C../blender/build_files/cmake/config/blender_headless.cmake  ../blender
+#
+
+set(WITH_HEADLESS            ON  CACHE FORCE BOOL) 
+set(WITH_GAMEENGINE          OFF CACHE FORCE BOOL)
+
+# disable audio, its possible some devs may want this but for now disable
+# so the python module doesnt hold the audio device and loads quickly.
+set(WITH_AUDASPACE           OFF CACHE FORCE BOOL)
+set(WITH_SAMPLERATE          OFF CACHE FORCE BOOL)
+set(WITH_FFTW3               OFF CACHE FORCE BOOL)
+set(WITH_JACK                OFF CACHE FORCE BOOL)
+set(WITH_SDL                 OFF CACHE FORCE BOOL)
+set(WITH_OPENAL              OFF CACHE FORCE BOOL)
+set(WITH_CODEC_FFMPEG        OFF CACHE FORCE BOOL)
+set(WITH_CODEC_SNDFILE       OFF CACHE FORCE BOOL)
+
+# other features which are not especially useful as a python module
+set(WITH_X11_XINPUT          OFF CACHE FORCE BOOL)
+set(WITH_INPUT_NDOF          OFF CACHE FORCE BOOL)
diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake
new file mode 100644 (file)
index 0000000..d2b791b
--- /dev/null
@@ -0,0 +1,43 @@
+# turn everything OFF CACHE FORCE BOOL) except for python which defaults to ON
+# and is needed for the UI
+#
+# Example usage:
+#   cmake -C../blender/build_files/cmake/config/blender_lite.cmake  ../blender
+#
+
+set(WITH_INSTALL_PORTABLE    ON  CACHE FORCE BOOL)
+
+set(WITH_BUILDINFO           OFF CACHE FORCE BOOL)
+set(WITH_BUILTIN_GLEW        OFF CACHE FORCE BOOL)
+set(WITH_BULLET              OFF CACHE FORCE BOOL)
+set(WITH_CODEC_FFMPEG        OFF CACHE FORCE BOOL)
+set(WITH_CODEC_SNDFILE       OFF CACHE FORCE BOOL)
+set(WITH_FFTW3               OFF CACHE FORCE BOOL)
+set(WITH_GAMEENGINE          OFF CACHE FORCE BOOL)
+set(WITH_IK_ITASC            OFF CACHE FORCE BOOL)
+set(WITH_IMAGE_CINEON        OFF CACHE FORCE BOOL)
+set(WITH_IMAGE_DDS           OFF CACHE FORCE BOOL)
+set(WITH_IMAGE_FRAMESERVER   OFF CACHE FORCE BOOL)
+set(WITH_IMAGE_HDR           OFF CACHE FORCE BOOL)
+set(WITH_IMAGE_OPENEXR       OFF CACHE FORCE BOOL)
+set(WITH_IMAGE_OPENJPEG      OFF CACHE FORCE BOOL)
+set(WITH_IMAGE_REDCODE       OFF CACHE FORCE BOOL)
+set(WITH_IMAGE_TIFF          OFF CACHE FORCE BOOL)
+set(WITH_INPUT_NDOF          OFF CACHE FORCE BOOL)
+set(WITH_INTERNATIONAL       OFF CACHE FORCE BOOL)
+set(WITH_JACK                OFF CACHE FORCE BOOL)
+set(WITH_LZMA                OFF CACHE FORCE BOOL)
+set(WITH_LZO                 OFF CACHE FORCE BOOL)
+set(WITH_MOD_BOOLEAN         OFF CACHE FORCE BOOL)
+set(WITH_MOD_DECIMATE        OFF CACHE FORCE BOOL)
+set(WITH_MOD_FLUID           OFF CACHE FORCE BOOL)
+set(WITH_MOD_SMOKE           OFF CACHE FORCE BOOL)
+set(WITH_AUDASPACE           OFF CACHE FORCE BOOL)
+set(WITH_OPENAL              OFF CACHE FORCE BOOL)
+set(WITH_OPENCOLLADA         OFF CACHE FORCE BOOL)
+set(WITH_OPENMP              OFF CACHE FORCE BOOL)
+set(WITH_PYTHON_INSTALL      OFF CACHE FORCE BOOL)
+set(WITH_RAYOPTIMIZATION     OFF CACHE FORCE BOOL)
+set(WITH_SAMPLERATE          OFF CACHE FORCE BOOL)
+set(WITH_SDL                 OFF CACHE FORCE BOOL)
+set(WITH_X11_XINPUT          OFF CACHE FORCE BOOL)
diff --git a/build_files/cmake/config/bpy_module.cmake b/build_files/cmake/config/bpy_module.cmake
new file mode 100644 (file)
index 0000000..5392705
--- /dev/null
@@ -0,0 +1,34 @@
+# defaults for building blender as a python module 'bpy'
+#
+# Example usage:
+#   cmake -C../blender/build_files/cmake/config/bpy_module.cmake  ../blender
+#
+
+set(WITH_PYTHON_MODULE       ON  CACHE FORCE BOOL)
+
+# install into the systems python dir
+set(WITH_INSTALL_PORTABLE    OFF CACHE FORCE BOOL)
+
+# no point int copying python into python
+set(WITH_PYTHON_INSTALL      OFF CACHE FORCE BOOL)
+
+# dont build the game engine
+set(WITH_GAMEENGINE          OFF CACHE FORCE BOOL)
+
+# disable audio, its possible some devs may want this but for now disable
+# so the python module doesnt hold the audio device and loads quickly.
+set(WITH_AUDASPACE           OFF CACHE FORCE BOOL)
+set(WITH_SAMPLERATE          OFF CACHE FORCE BOOL)
+set(WITH_FFTW3               OFF CACHE FORCE BOOL)
+set(WITH_JACK                OFF CACHE FORCE BOOL)
+set(WITH_SDL                 OFF CACHE FORCE BOOL)
+set(WITH_OPENAL              OFF CACHE FORCE BOOL)
+set(WITH_CODEC_FFMPEG        OFF CACHE FORCE BOOL)
+set(WITH_CODEC_SNDFILE       OFF CACHE FORCE BOOL)
+
+# other features which are not especially useful as a python module
+set(WITH_X11_XINPUT          OFF CACHE FORCE BOOL)
+set(WITH_INPUT_NDOF          OFF CACHE FORCE BOOL)
+set(WITH_OPENCOLLADA         OFF CACHE FORCE BOOL)
+set(WITH_INTERNATIONAL       OFF CACHE FORCE BOOL)
+set(WITH_BULLET              OFF CACHE FORCE BOOL)