[Bf-blender-cvs] [2b4c68b] master: CMake Build: option to compile without opennl/superlu.
Campbell Barton
noreply at git.blender.org
Mon Nov 25 05:37:26 CET 2013
Commit: 2b4c68b902b261127f7deabf922048c41be6fb55
Author: Campbell Barton
Date: Mon Nov 25 15:33:41 2013 +1100
http://developer.blender.org/rB2b4c68b902b261127f7deabf922048c41be6fb55
CMake Build: option to compile without opennl/superlu.
===================================================================
M CMakeLists.txt
M SConstruct
M build_files/cmake/config/blender_lite.cmake
M intern/CMakeLists.txt
M source/blender/bmesh/CMakeLists.txt
M source/blender/bmesh/operators/bmo_smooth_laplacian.c
M source/blender/editors/armature/CMakeLists.txt
M source/blender/editors/armature/armature_skinning.c
M source/blender/editors/armature/meshlaplacian.c
M source/blender/editors/uvedit/CMakeLists.txt
M source/blender/editors/uvedit/uvedit_parametrizer.c
M source/blender/modifiers/CMakeLists.txt
M source/blender/modifiers/intern/MOD_laplaciandeform.c
M source/blender/modifiers/intern/MOD_laplaciansmooth.c
M source/creator/CMakeLists.txt
===================================================================
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a7f6b87..4cd4dee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -254,6 +254,7 @@ option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
# Misc
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ON)
option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
+option(WITH_OPENNL "Enable use of Open Numerical Library" ON)
if(UNIX AND NOT APPLE)
option(WITH_INSTALL_PORTABLE "Install redistributeable runtime, otherwise install into CMAKE_INSTALL_PREFIX" ON)
option(WITH_STATIC_LIBS "Try to link with static libraries, as much as possible, to make blender more portable across distributions" OFF)
@@ -2306,6 +2307,9 @@ if(FIRST_RUN)
info_cfg_option(WITH_MOD_FLUID)
info_cfg_option(WITH_MOD_OCEANSIM)
+ info_cfg_text("Other:")
+ info_cfg_option(WITH_OPENNL)
+
# debug
message(STATUS "HAVE_STDBOOL_H = ${HAVE_STDBOOL_H}")
diff --git a/SConstruct b/SConstruct
index 8c27424..edf9cda 100644
--- a/SConstruct
+++ b/SConstruct
@@ -487,6 +487,7 @@ else:
# TODO, make optional (as with CMake)
env['CPPFLAGS'].append('-DWITH_AUDASPACE')
env['CPPFLAGS'].append('-DWITH_AVI')
+env['CPPFLAGS'].append('-DWITH_OPENNL')
env['CPPFLAGS'].append('-DWITH_BOOL_COMPAT')
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc') and env['MSVC_VERSION'] == '11.0':
env['CPPFLAGS'].append('-D_ALLOW_KEYWORD_MACROS')
diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake
index e9ff31f..ca9aadd 100644
--- a/build_files/cmake/config/blender_lite.cmake
+++ b/build_files/cmake/config/blender_lite.cmake
@@ -45,6 +45,7 @@ set(WITH_OPENAL OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLORIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENMP OFF CACHE BOOL "" FORCE)
+set(WITH_OPENNL OFF CACHE BOOL "" FORCE)
set(WITH_PYTHON_INSTALL OFF CACHE BOOL "" FORCE)
set(WITH_RAYOPTIMIZATION OFF CACHE BOOL "" FORCE)
set(WITH_SDL OFF CACHE BOOL "" FORCE)
diff --git a/intern/CMakeLists.txt b/intern/CMakeLists.txt
index c45e66c..b7aff03 100644
--- a/intern/CMakeLists.txt
+++ b/intern/CMakeLists.txt
@@ -29,7 +29,6 @@ add_subdirectory(ghost)
add_subdirectory(guardedalloc)
add_subdirectory(memutil)
add_subdirectory(opencolorio)
-add_subdirectory(opennl)
add_subdirectory(mikktspace)
add_subdirectory(raskter)
@@ -81,6 +80,10 @@ if(WITH_COMPOSITOR)
add_subdirectory(opencl)
endif()
+if(WITH_OPENNL)
+ add_subdirectory(opennl)
+endif()
+
# only windows needs utf16 converter
if(WIN32)
add_subdirectory(utfconv)
diff --git a/source/blender/bmesh/CMakeLists.txt b/source/blender/bmesh/CMakeLists.txt
index b80a10b..afb8b07 100644
--- a/source/blender/bmesh/CMakeLists.txt
+++ b/source/blender/bmesh/CMakeLists.txt
@@ -31,7 +31,6 @@ set(INC
../makesdna
../../../intern/guardedalloc
../../../extern/rangetree
- ../../../intern/opennl/extern
)
set(INC_SYS
@@ -160,6 +159,13 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
+if(WITH_OPENNL)
+ add_definitions(-DWITH_OPENNL)
+ list(APPEND INC_SYS
+ ../../../intern/opennl/extern
+ )
+endif()
+
if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
diff --git a/source/blender/bmesh/operators/bmo_smooth_laplacian.c b/source/blender/bmesh/operators/bmo_smooth_laplacian.c
index 3f04e23..16e70e8 100644
--- a/source/blender/bmesh/operators/bmo_smooth_laplacian.c
+++ b/source/blender/bmesh/operators/bmo_smooth_laplacian.c
@@ -34,10 +34,12 @@
#include "bmesh.h"
-#include "ONL_opennl.h"
-
#include "intern/bmesh_operators_private.h" /* own include */
+#ifdef WITH_OPENNL
+
+#include "ONL_opennl.h"
+
// #define SMOOTH_LAPLACIAN_AREA_FACTOR 4.0f /* UNUSED */
// #define SMOOTH_LAPLACIAN_EDGE_FACTOR 2.0f /* UNUSED */
#define SMOOTH_LAPLACIAN_MAX_EDGE_PERCENTAGE 1.8f
@@ -572,3 +574,13 @@ void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op)
delete_laplacian_system(sys);
}
+
+#else /* WITH_OPENNL */
+
+#ifdef __GNUC__
+# pragma GCC diagnostic ignored "-Wunused-parameter"
+#endif
+
+void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op) {}
+
+#endif /* WITH_OPENNL */
diff --git a/source/blender/editors/armature/CMakeLists.txt b/source/blender/editors/armature/CMakeLists.txt
index 1a0841f..ca2dc1b 100644
--- a/source/blender/editors/armature/CMakeLists.txt
+++ b/source/blender/editors/armature/CMakeLists.txt
@@ -27,7 +27,6 @@ set(INC
../../makesrna
../../windowmanager
../../../../intern/guardedalloc
- ../../../../intern/opennl/extern
)
set(INC_SYS
@@ -67,4 +66,11 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
+if(WITH_OPENNL)
+ add_definitions(-DWITH_OPENNL)
+ list(APPEND INC_SYS
+ ../../../../intern/opennl/extern
+ )
+endif()
+
blender_add_lib(bf_editor_armature "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/armature/armature_skinning.c b/source/blender/editors/armature/armature_skinning.c
index 5f15d15..7ec0acf 100644
--- a/source/blender/editors/armature/armature_skinning.c
+++ b/source/blender/editors/armature/armature_skinning.c
@@ -386,9 +386,13 @@ static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob,
/* compute the weights based on gathered vertices and bones */
if (heat) {
const char *error = NULL;
+
+#ifdef WITH_OPENNL
heat_bone_weighting(ob, mesh, verts, numbones, dgrouplist, dgroupflip,
root, tip, selected, &error);
-
+#else
+ error = "Built without OpenNL";
+#endif
if (error) {
BKE_report(reports, RPT_WARNING, error);
}
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 16d7f9c..3b285e1 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -46,13 +46,14 @@
#include "BLI_polardecomp.h"
#endif
-#include "ONL_opennl.h"
-
#include "ED_mesh.h"
#include "ED_armature.h"
#include "meshlaplacian.h"
+#ifdef WITH_OPENNL
+
+#include "ONL_opennl.h"
/* ************* XXX *************** */
static void waitcursor(int UNUSED(val)) {}
@@ -2006,3 +2007,13 @@ void mesh_deform_bind(Scene *scene, MeshDeformModifierData *mmd, float *vertexco
waitcursor(0);
}
+#else /* WITH_OPENNL */
+
+#ifdef __GNUC__
+# pragma GCC diagnostic ignored "-Wunused-parameter"
+#endif
+
+void mesh_deform_bind(Scene *scene, MeshDeformModifierData *mmd, float *vertexcos, int totvert, float cagemat[4][4]) {}
+void *modifier_mdef_compact_influences_link_kludge = modifier_mdef_compact_influences;
+
+#endif /* WITH_OPENNL */
diff --git a/source/blender/editors/uvedit/CMakeLists.txt b/source/blender/editors/uvedit/CMakeLists.txt
index 62d4b01..45edbde 100644
--- a/source/blender/editors/uvedit/CMakeLists.txt
+++ b/source/blender/editors/uvedit/CMakeLists.txt
@@ -28,7 +28,6 @@ set(INC
../../makesrna
../../windowmanager
../../../../intern/guardedalloc
- ../../../../intern/opennl/extern
)
set(INC_SYS
@@ -51,4 +50,11 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
+if(WITH_OPENNL)
+ add_definitions(-DWITH_OPENNL)
+ list(APPEND INC_SYS
+ ../../../../intern/opennl/extern
+ )
+endif()
+
blender_add_lib(bf_editor_uvedit "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 2d33a2d..e5c3510 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -35,8 +35,6 @@
#include "BLI_boxpack2d.h"
#include "BLI_convexhull2d.h"
-#include "ONL_opennl.h"
-
#include "uvedit_intern.h"
#include "uvedit_parametrizer.h"
@@ -47,6 +45,10 @@
#include "BLI_sys_types.h" /* for intptr_t support */
+#ifdef WITH_OPENNL
+
+#include "ONL_opennl.h"
+
/* Utils */
#if 0
@@ -4715,3 +4717,36 @@ void param_flush_restore(ParamHandle *handle)
}
}
+#else /* WITH_OPENNL */
+
+#ifdef __GNUC__
+# pragma GCC diagnostic ignored "-Wunused-parameter"
+#endif
+
+/* stubs */
+void param_face_add(ParamHandle *handle, ParamKey key, int nverts,
+ ParamKey *vkeys, float **co, float **uv,
+ ParamBool *pin, ParamBool *select, float normal[3]) {}
+void param_edge_set_seam(ParamHandle *handle,
+ ParamKey *vkeys) {}
+void param_aspect_ratio(ParamHandle *handle, float aspx, float aspy) {}
+ParamHandle *param_construct_begin(void) { return NULL; }
+void param_construct_end(ParamHandle *handle, ParamBool fill, ParamBool impl) {}
+void param_delete(ParamHandle *handle) {}
+
+void param_stretch_begin(ParamHandle *handle) {}
+void param_stretch_blend(ParamHandle *handle, float blend) {}
+void param_stretch_iter(ParamHandle *handle) {}
+void param_stretch_end(ParamHandle *handle) {}
+
+void param_pack(ParamHandle *handle, float margin, bool do_rotate) {}
+void param_average(ParamHandle *handle) {}
+
+void param_flush(ParamHandle *handle) {}
+void param_flush_restore(ParamHandle *handle) {}
+
+void param_lscm_begin(ParamHandle *handle, ParamBool live, ParamBool abf) {}
+void param_lscm_solve(ParamHandle *handle) {}
+void param_lscm_end(ParamHandle *handle) {}
+
+#endif /* WITH_OPENNL */
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index 450501c..4eb15c0 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -36,7 +36,6 @@ set(INC
../render/extern/include
../../../intern/elbeem/extern
../../../intern/guardedalloc
- ../../../intern/opennl/extern
)
set(INC_SYS
@@ -146,4 +145,11 @@ if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
+if(WITH_OPENNL)
+ add_definitions(-DWITH_OPENNL)
+ list(APPEND INC_SYS
+ ../../../intern/opennl/extern
+ )
+endif()
+
blender_add_lib(bf_modifiers "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/modifiers/intern/MOD_laplaciandeform.c b/source/blender/modifiers/intern/MOD_laplaciandeform.c
index 3b909a4..a8a6f1a 100644
--- a/source/blender/modifiers/inte
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list