* configure.ac: Add option `--enable-apps'.
(ENABLE_APPS): New conditional.
Always configure milena/apps/Makefile and
milena/apps/statues/Makefile.
Populate APPS_CXXFLAGS with default flags.
* milena/Makefile.am (SUBDIRS) [ENABLE_APPS]: Add apps.
---
ChangeLog | 11 +++++++++++
configure.ac | 23 ++++++++++++++++-------
milena/Makefile.am | 6 ++++--
3 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3f7ea4c..ff0d142 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2009-05-11 Roland Levillain <roland(a)lrde.epita.fr>
+ Make Milena applications (milena/apps/) optional.
+
+ * configure.ac: Add option `--enable-apps'.
+ (ENABLE_APPS): New conditional.
+ Always configure milena/apps/Makefile and
+ milena/apps/statues/Makefile.
+ Populate APPS_CXXFLAGS with default flags.
+ * milena/Makefile.am (SUBDIRS) [ENABLE_APPS]: Add apps.
+
+2009-05-11 Roland Levillain <roland(a)lrde.epita.fr>
+
Improve configure.ac w.r.t. Trimesh.
* m4/trimesh.m4: Remove, and move relevant lines...
diff --git a/configure.ac b/configure.ac
index 6b46bc8..5cb3f06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -298,14 +298,16 @@ AC_CONFIG_FILES([
## Applications. ##
## -------------- ##
-# FIXME: Don't build applications depending on Trimesh if Trimesh is not built.
+AC_ARG_ENABLE([apps],
+ [AS_HELP_STRING([--enable-apps],
+ [enable application])])
+AM_CONDITIONAL([ENABLE_APPS], [test "x$enable_apps" = "xyes"])
+
# Ask for the creation of applications' Makefiles.
-# FIXME: Should it be achieved through oln.m4 macros, as we did in Olena 0.11?
-# FIXME: ENABLE IT
-#AC_CONFIG_FILES([
-# milena/apps/Makefile
-# milena/apps/statues/Makefile
-#])
+AC_CONFIG_FILES([
+ milena/apps/Makefile
+ milena/apps/statues/Makefile
+])
# Configure tests.
# FIXME: Consider using `sed' instead of `configure' to create these
@@ -324,4 +326,11 @@
AC_CONFIG_FILES([milena/apps/statues/test-mesh-complex-max-curv-segm],
AC_CONFIG_FILES([milena/apps/statues/test-mesh-complex-skel],
[chmod +x milena/apps/statues/test-mesh-complex-skel])
+# Flags for apps.
+AC_ARG_VAR([APPS_CXXFLAGS])
+# We want fast binaries for apps.
+if test "$GXX" = yes && test -z "$APPS_CXXFLAGS"; then
+ APPS_CXXFLAGS="-O3 -DNDEBUG -ggdb -Wall -W"
+fi
+
AC_OUTPUT
diff --git a/milena/Makefile.am b/milena/Makefile.am
index 8ff2f4f..e267598 100644
--- a/milena/Makefile.am
+++ b/milena/Makefile.am
@@ -1,11 +1,13 @@
## Process this file through Automake to create Makefile.in.
-##FIXME
SUBDIRS = \
doc \
mesh \
tests
-# apps
+
+if ENABLE_APPS
+ SUBDIRS += apps
+endif ENABLE_APPS
.PHONY: doc tutorial tools
--
1.6.1.2