CMake options to disable Decimate and Boolean Modifiers: WITH_MOD_BOOLEAN, WITH_MOD_D...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 23 Oct 2010 15:40:13 +0000 (15:40 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 23 Oct 2010 15:40:13 +0000 (15:40 +0000)
CMakeLists.txt
intern/CMakeLists.txt
source/blender/blenkernel/CMakeLists.txt
source/blender/editors/physics/CMakeLists.txt
source/blender/makesrna/intern/CMakeLists.txt
source/blender/modifiers/CMakeLists.txt
source/blender/modifiers/Makefile
source/blender/modifiers/SConscript
source/blender/modifiers/intern/MOD_boolean.c
source/blender/modifiers/intern/MOD_decimate.c
source/creator/CMakeLists.txt

index c2768c7301fa2d3fcfe14303a04df6e6950c50ac..1aaec87f7c32851933b0da68dc0c0999c9243712 100644 (file)
@@ -68,7 +68,6 @@ GET_BLENDER_VERSION()
 OPTION(WITH_INTERNATIONAL "Enable I18N   (International fonts and text)" ON)
 OPTION(WITH_PYTHON        "Enable Embedded Python API" ON)
 OPTION(WITH_BUILDINFO     "Include extra build details" ON)
-OPTION(WITH_FLUID        "Enable Elbeem (Fluid Simulation)" ON)
 OPTION(WITH_IK_ITASC      "Enable ITASC IK solver" ON)
 OPTION(WITH_FFTW3         "Enable FFTW3 support (Used for smoke and audio effects)" OFF)
 OPTION(WITH_BULLET        "Enable Bullet (Physics Engine)" ON)
@@ -81,6 +80,11 @@ ELSE()
        OPTION(WITH_OPENMP        "Enable OpenMP (has to be supported by the compiler)" OFF)
 ENDIF()
 
+# Modifiers
+OPTION(WITH_MOD_FLUID          "Enable Elbeem Modifier (Fluid Simulation)" ON)
+OPTION(WITH_MOD_DECIMATE               "Enable Decimate Modifier" ON)
+OPTION(WITH_MOD_BOOLEAN                "Enable Boolean Modifier" ON)
+
 # Image format support
 OPTION(WITH_IMAGE_OPENEXR       "Enable OpenEXR Support (http://www.openexr.com)" ON)
 OPTION(WITH_IMAGE_OPENJPEG      "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF)
index acc13fb0e338f6b97da1a3df678e24cd3947e92c..a497d8f2078c3c3f51638788308f3ce0219eb467 100644 (file)
@@ -29,20 +29,25 @@ ADD_SUBDIRECTORY(string)
 ADD_SUBDIRECTORY(ghost)
 ADD_SUBDIRECTORY(guardedalloc)
 ADD_SUBDIRECTORY(moto)
-ADD_SUBDIRECTORY(container)
 ADD_SUBDIRECTORY(memutil)
-ADD_SUBDIRECTORY(decimation)
 ADD_SUBDIRECTORY(iksolver)
-ADD_SUBDIRECTORY(boolop)
 ADD_SUBDIRECTORY(opennl)
 ADD_SUBDIRECTORY(smoke)
 
-IF(WITH_FLUID)
+IF(WITH_MOD_FLUID)
        ADD_SUBDIRECTORY(elbeem)
-ENDIF(WITH_FLUID)
+ENDIF(WITH_MOD_FLUID)
+
+IF(WITH_MOD_DECIMATE)
+       ADD_SUBDIRECTORY(container)
+       ADD_SUBDIRECTORY(decimation)
+ENDIF(WITH_MOD_DECIMATE)
+
+IF(WITH_MOD_BOOLEAN)
+       ADD_SUBDIRECTORY(boolop)
+       ADD_SUBDIRECTORY(bsp)
+ENDIF(WITH_MOD_BOOLEAN)
 
 IF(WITH_IK_ITASC)
        ADD_SUBDIRECTORY(itasc)
 ENDIF(WITH_IK_ITASC)
-
-ADD_SUBDIRECTORY(bsp)
index a63f0031eedec64e3eee35e17e27ed5fd405b154..5252003c5b3ea54da9aabb9ff7dd8568d4205199 100644 (file)
@@ -196,9 +196,9 @@ IF(WITH_OPENMP)
        ADD_DEFINITIONS(-DPARALLEL=1)
 ENDIF(WITH_OPENMP)
 
-IF(NOT WITH_FLUID)
+IF(NOT WITH_MOD_FLUID)
        ADD_DEFINITIONS(-DDISABLE_ELBEEM)
-ENDIF(NOT WITH_FLUID)
+ENDIF(NOT WITH_MOD_FLUID)
 
 IF(WITH_JACK)
        ADD_DEFINITIONS(-DWITH_JACK)
index 5d36038b76a7c5b4192254f9b551bee155946589..481f6d8df44542af306814dc9842f6529187a048 100644 (file)
@@ -43,9 +43,9 @@ IF(WIN32)
        LIST(APPEND INC ${PTHREADS_INC})
 ENDIF(WIN32)
 
-IF(NOT WITH_FLUID)
+IF(NOT WITH_MOD_FLUID)
        ADD_DEFINITIONS(-DDISABLE_ELBEEM)
-ENDIF(NOT WITH_FLUID)
+ENDIF(NOT WITH_MOD_FLUID)
 
 IF(WITH_OPENMP)
                ADD_DEFINITIONS(-DPARALLEL=1)
index a48603e623c54a985a6382154302eb95a99d82c0..97e16bba057dd29e44820279fe43afd8b4c6485f 100644 (file)
@@ -112,9 +112,9 @@ IF(WITH_LCMS)
        ADD_DEFINITIONS(-DWITH_LCMS)
 ENDIF(WITH_LCMS)
 
-IF(NOT WITH_FLUID)
+IF(NOT WITH_MOD_FLUID)
        ADD_DEFINITIONS(-DDISABLE_ELBEEM)
-ENDIF(NOT WITH_FLUID)
+ENDIF(NOT WITH_MOD_FLUID)
 
 IF(WITH_FFTW3)
        ADD_DEFINITIONS(-DFFTW3=1)
index 99e8c05b1ae33b3d4f68a44ccee68971a9389622..40f0ad127cdbe962da3a45ce40f1313a2ef30c87 100644 (file)
@@ -31,10 +31,8 @@ SET(INC
        ../blenkernel
        ../blenkernel/intern
        ../render/extern/include
-    ../../../intern/guardedalloc
-       ../../../intern/decimation/extern
+       ../../../intern/guardedalloc
        ../../../intern/elbeem/extern
-       ../../../intern/bsp/extern
        ${ZLIB_INC}
 )
 
@@ -43,7 +41,6 @@ SET(SRC
        intern/MOD_array.c
        intern/MOD_bevel.c
        intern/MOD_boolean.c
-       intern/MOD_boolean_util.c
        intern/MOD_build.c
        intern/MOD_cast.c
        intern/MOD_cloth.c
@@ -79,9 +76,19 @@ SET(SRC
        intern/MOD_wave.c
 )
 
-IF(NOT WITH_FLUID)
+IF(WITH_MOD_BOOLEAN)
+       ADD_DEFINITIONS(-DWITH_MOD_BOOLEAN)
+       LIST(APPEND SRC intern/MOD_boolean_util.c)
+       LIST(APPEND INC ../../../intern/bsp/extern)
+ENDIF(WITH_MOD_BOOLEAN)
+
+IF(WITH_MOD_DECIMATE)
+       ADD_DEFINITIONS(-DWITH_MOD_DECIMATE)
+       LIST(APPEND INC ../../../intern/decimation/extern)
+ENDIF(WITH_MOD_BOOLEAN)
+
+IF(NOT WITH_MOD_FLUID)
        ADD_DEFINITIONS(-DDISABLE_ELBEEM)
-ENDIF(NOT WITH_FLUID)
+ENDIF(NOT WITH_MOD_FLUID)
 
 BLENDERLIB(bf_modifiers "${SRC}" "${INC}")
-
index ddcddb90186009503ad24355f4487233e1d98927..2115e8ac888fa1f56f7d35a526c148cd69c2b5a4 100644 (file)
@@ -30,5 +30,5 @@
 
 SOURCEDIR = source/blender/modifiers
 DIRS = intern
-
+CFLAGS += -DWITH_MOD_BOOLEAN -DWITH_MOD_BOOLEAN
 include nan_subdirs.mk
index 7aa198f51f05e87ef9efbb0e73b6d3adcab719c9..8d420fcb3b7b94a0925d6ce7bccabfec9a1f000a 100644 (file)
@@ -12,6 +12,10 @@ incs += ' ' + env['BF_ZLIB_INC']
 
 defs = []
 
+# could be made optional
+defs += ['WITH_MOD_BOOLEAN']
+defs += ['WITH_MOD_DECIMATE']
+
 if env['BF_NO_ELBEEM']:
     defs.append('DISABLE_ELBEEM')
 
index b2f7c685248533472a29c1f19fcbfbc66d61690e..07300065659d9f539f2778ed70498117b8ccca83 100644 (file)
@@ -82,7 +82,7 @@ static void updateDepgraph(ModifierData *md, DagForest *forest,
        }
 }
 
-
+#ifdef WITH_MOD_BOOLEAN
 static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
                                                DerivedMesh *derivedData,
                                                int UNUSED(useRenderParams),
@@ -107,6 +107,15 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        
        return derivedData;
 }
+#else // WITH_MOD_BOOLEAN
+static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob),
+                                               DerivedMesh *derivedData,
+                                               int UNUSED(useRenderParams),
+                                               int UNUSED(isFinalCalc))
+{
+       return derivedData;
+}
+#endif // WITH_MOD_BOOLEAN
 
 static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(md))
 {
index 8df0c0be3eb89a5b1ebef0c6dd5c02b117b01524..d7e0ff4702bc511b1052c08c26de3d06f3b40882 100644 (file)
@@ -42,8 +42,9 @@
 
 #include "MEM_guardedalloc.h"
 
+#ifdef WITH_MOD_DECIMATE
 #include "LOD_decimation.h"
-
+#endif
 
 static void initData(ModifierData *md)
 {
@@ -60,6 +61,7 @@ static void copyData(ModifierData *md, ModifierData *target)
        tdmd->percent = dmd->percent;
 }
 
+#ifdef WITH_MOD_DECIMATE
 static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
                                                DerivedMesh *derivedData,
                                                int UNUSED(useRenderParams),
@@ -176,7 +178,15 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
 exit:
                return result;
 }
-
+#else // WITH_MOD_DECIMATE
+static DerivedMesh *applyModifier(ModifierData *UNUSED(md), Object *UNUSED(ob),
+                                               DerivedMesh *derivedData,
+                                               int UNUSED(useRenderParams),
+                                               int UNUSED(isFinalCalc))
+{
+       return derivedData;
+}
+#endif // WITH_MOD_DECIMATE
 
 ModifierTypeInfo modifierType_Decimate = {
        /* name */              "Decimate",
index 27640cbc185f033330103573f2215454f55b97f2..6d43e13718f83c520eba9967beaea8e0602e9aba 100644 (file)
@@ -454,9 +454,9 @@ FILE(READ ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt BLENDER_LINK_LIBS)
 
 SET(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_render)
 
-IF(WITH_FLUID)
+IF(WITH_MOD_FLUID)
        LIST(APPEND BLENDER_LINK_LIBS bf_intern_elbeem)
-ENDIF(WITH_FLUID)
+ENDIF(WITH_MOD_FLUID)
 
 
 #IF(UNIX)