Advanced CMake option to build the player without blender: WITH_BLENDER
authorCampbell Barton <ideasman42@gmail.com>
Wed, 13 Jul 2011 08:15:06 +0000 (08:15 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 13 Jul 2011 08:15:06 +0000 (08:15 +0000)
CMakeLists.txt
intern/ghost/CMakeLists.txt
source/blender/editors/CMakeLists.txt
source/blender/editors/datafiles/CMakeLists.txt

index dc42a4a..28b68c1 100644 (file)
@@ -90,6 +90,9 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE )
 get_blender_version()
 
 # Blender internal features
+option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
+mark_as_advanced(WITH_BLENDER)
+
 option(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON)
 
 option(WITH_PYTHON        "Enable Embedded Python API  (only disable for development)" ON)
@@ -210,6 +213,10 @@ endif()
 #-----------------------------------------------------------------------------
 # Check for conflicting/unsupported configurations
 
+if(NOT WITH_BLENDER AND NOT WITH_PLAYER)
+       message(FATAL_ERROR "At least one of WITH_BLENDER or WITH_PLAYER must be enabled, nothing to do!")
+endif()
+
 if(NOT WITH_GAMEENGINE AND WITH_PLAYER)
        message(FATAL_ERROR "WITH_PLAYER requires WITH_GAMEENGINE")
 endif()
@@ -1223,7 +1230,9 @@ add_subdirectory(extern)
 
 #-----------------------------------------------------------------------------
 # Blender Application
-add_subdirectory(source/creator)
+if(WITH_BLENDER)
+       add_subdirectory(source/creator)
+endif()
 
 
 #-----------------------------------------------------------------------------
index f887d02..41c70b7 100644 (file)
@@ -74,7 +74,6 @@ set(SRC
        intern/GHOST_EventKey.h
        intern/GHOST_EventManager.h
        intern/GHOST_EventNDOF.h
-       intern/GHOST_EventPrinter.h
        intern/GHOST_EventString.h
        intern/GHOST_EventTrackpad.h
        intern/GHOST_EventWheel.h
index 651cb66..abda4f1 100644 (file)
 #
 # ***** END GPL LICENSE BLOCK *****
 
-add_subdirectory(animation)
-add_subdirectory(armature)
-add_subdirectory(curve)
+if(WITH_BLENDER)
+       add_subdirectory(animation)
+       add_subdirectory(armature)
+       add_subdirectory(curve)
+       add_subdirectory(gpencil)
+       add_subdirectory(interface)
+       add_subdirectory(mesh)
+       add_subdirectory(metaball)
+       add_subdirectory(object)
+       add_subdirectory(physics)
+       add_subdirectory(render)
+       add_subdirectory(screen)
+       add_subdirectory(sculpt_paint)
+       add_subdirectory(sound)
+       add_subdirectory(space_action)
+       add_subdirectory(space_api)
+       add_subdirectory(space_buttons)
+       add_subdirectory(space_console)
+       add_subdirectory(space_file)
+       add_subdirectory(space_graph)
+       add_subdirectory(space_image)
+       add_subdirectory(space_info)
+       add_subdirectory(space_logic)
+       add_subdirectory(space_nla)
+       add_subdirectory(space_node)
+       add_subdirectory(space_outliner)
+       add_subdirectory(space_script)
+       add_subdirectory(space_sequencer)
+       add_subdirectory(space_sound)
+       add_subdirectory(space_text)
+       add_subdirectory(space_time)
+       add_subdirectory(space_userpref)
+       add_subdirectory(space_view3d)
+       add_subdirectory(transform)
+       add_subdirectory(util)
+       add_subdirectory(uvedit)
+endif()
+
 add_subdirectory(datafiles)
-add_subdirectory(gpencil)
-add_subdirectory(interface)
-add_subdirectory(mesh)
-add_subdirectory(metaball)
-add_subdirectory(object)
-add_subdirectory(physics)
-add_subdirectory(render)
-add_subdirectory(screen)
-add_subdirectory(sculpt_paint)
-add_subdirectory(sound)
-add_subdirectory(space_action)
-add_subdirectory(space_api)
-add_subdirectory(space_buttons)
-add_subdirectory(space_console)
-add_subdirectory(space_file)
-add_subdirectory(space_graph)
-add_subdirectory(space_image)
-add_subdirectory(space_info)
-add_subdirectory(space_logic)
-add_subdirectory(space_nla)
-add_subdirectory(space_node)
-add_subdirectory(space_outliner)
-add_subdirectory(space_script)
-add_subdirectory(space_sequencer)
-add_subdirectory(space_sound)
-add_subdirectory(space_text)
-add_subdirectory(space_time)
-add_subdirectory(space_userpref)
-add_subdirectory(space_view3d)
-add_subdirectory(transform)
-add_subdirectory(util)
-add_subdirectory(uvedit)
index ae86905..080673d 100644 (file)
@@ -27,50 +27,58 @@ set(INC_SYS
 
 )
 
+# blender and player
 set(SRC
        Bfont.c
        bfont.ttf.c
-       bmonofont.ttf.c
-       startup.blend.c
-       preview.blend.c
 )
 
-if(NOT WITH_HEADLESS)
+if(WITH_BLENDER)
+       # blender only
        list(APPEND SRC
-               splash.png.c
-               blenderbuttons.c
-
-               # brushes
-               add.png.c
-               blob.png.c
-               blur.png.c
-               clay.png.c
-               clone.png.c
-               crease.png.c
-               darken.png.c
-               draw.png.c
-               fill.png.c
-               flatten.png.c
-               grab.png.c
-               inflate.png.c
-               layer.png.c
-               lighten.png.c
-               mix.png.c
-               multiply.png.c
-               nudge.png.c
-               pinch.png.c
-               prvicons.c
-               scrape.png.c
-               smear.png.c
-               smooth.png.c
-               snake_hook.png.c
-               soften.png.c
-               subtract.png.c
-               texdraw.png.c
-               thumb.png.c
-               twist.png.c
-               vertexdraw.png.c
+               startup.blend.c
+               preview.blend.c
+               bmonofont.ttf.c
        )
+
+       if(NOT WITH_HEADLESS)
+               # blender UI only
+               list(APPEND SRC
+                       splash.png.c
+                       blenderbuttons.c
+
+                       # brushes
+                       add.png.c
+                       blob.png.c
+                       blur.png.c
+                       clay.png.c
+                       clone.png.c
+                       crease.png.c
+                       darken.png.c
+                       draw.png.c
+                       fill.png.c
+                       flatten.png.c
+                       grab.png.c
+                       inflate.png.c
+                       layer.png.c
+                       lighten.png.c
+                       mix.png.c
+                       multiply.png.c
+                       nudge.png.c
+                       pinch.png.c
+                       prvicons.c
+                       scrape.png.c
+                       smear.png.c
+                       smooth.png.c
+                       snake_hook.png.c
+                       soften.png.c
+                       subtract.png.c
+                       texdraw.png.c
+                       thumb.png.c
+                       twist.png.c
+                       vertexdraw.png.c
+               )
+       endif()
 endif()
 
 blender_add_lib(bf_editor_datafiles "${SRC}" "${INC}" "${INC_SYS}")