---
milena/ChangeLog | 4 +++
milena/mln/io/dicom/all.hh | 48 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/io/dicom/all.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index e1d15ff..5a9da7d 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,9 @@
2009-06-02 Roland Levillain <roland(a)lrde.epita.fr>
+ * mln/io/dicom/all.hh: New file.
+
+2009-06-02 Roland Levillain <roland(a)lrde.epita.fr>
+
Add support for Magick++ in the build system.
* mln/io/all.hh [HAVE_MAGICKXX]: Include mln/io/magick/all.hh.
diff --git a/milena/mln/io/dicom/all.hh b/milena/mln/io/dicom/all.hh
new file mode 100644
index 0000000..6facbcb
--- /dev/null
+++ b/milena/mln/io/dicom/all.hh
@@ -0,0 +1,48 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_IO_DICOM_ALL_HH
+# define MLN_IO_DICOM_ALL_HH
+
+/// \file mln/io/dicom/all.hh
+/// \brief Inclusion of all DICOM I/O routines.
+
+
+namespace mln
+{
+
+ namespace io
+ {
+ /// Namespace of DICOM input/output handling.
+ namespace dicom {}
+ }
+
+}
+
+# include <mln/io/dicom/load.hh>
+
+#endif // ! MLN_IO_DICOM_ALL_HH
--
1.6.1.2
* configure.ac: Find GDCM using OLN_WITH_LIB.
---
ChangeLog | 6 ++++++
configure.ac | 7 +++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index bdf50ef..8fba8f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
2009-06-03 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Add tentative support for GDCM in the configuration system.
+
+ * configure.ac: Find GDCM using OLN_WITH_LIB.
+
+2009-06-03 Roland Levillain <roland(a)lrde.epita.fr>
Add support for Magick++ in the configuration system.
diff --git a/configure.ac b/configure.ac
index d82540d..ce0af7f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,6 +145,13 @@ OLN_WITH_LIB([Magick++], [Magick++.h], [Magick++], [magickxx], [MAGICKXX])
# TIFF library.
OLN_WITH_LIB([TIFF], [tiff.h], [tiff])
+# Grassroots DiCoM (GDCM).
+# FIXME: Linking against the sole libgdcmCommon.{a,so,dylib} is
+# probably not enough in many cases (there are other libraries in the
+# GDCM package). Write a decent test first (in
+# milena/tests/io/dicom/), and improve the configuration.
+OLN_WITH_LIB([GDCM], [gdcm-2.0/gdcmReader.h], [gdcmCommon], [gdcm], [GDCM])
+
## ---------------------------- ##
## (Bundled) trimesh2 library. ##
--
1.6.1.2
* m4/oln-with-lib.m4: New.
---
ChangeLog | 6 ++++
m4/oln-with-lib.m4 | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 84 insertions(+), 0 deletions(-)
create mode 100644 m4/oln-with-lib.m4
diff --git a/ChangeLog b/ChangeLog
index 1b0d496..46cd626 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2009-06-03 Roland Levillain <roland(a)lrde.epita.fr>
+ Add an Automake macro OLN_WITH_LIB to factor common code.
+
+ * m4/oln-with-lib.m4: New.
+
+2009-06-02 Roland Levillain <roland(a)lrde.epita.fr>
+
Disable support for FreeImagePlus in Olena.
* configure.ac: Here.
diff --git a/m4/oln-with-lib.m4 b/m4/oln-with-lib.m4
new file mode 100644
index 0000000..16997c9
--- /dev/null
+++ b/m4/oln-with-lib.m4
@@ -0,0 +1,78 @@
+# -*- Autoconf -*-
+
+# OLN_WITH_LIB(PACKAGE, HEADER, LIBRARY, [SHELL_NAME], [CPP_NAME])
+# ----------------------------------------------------------------
+# Checks whether library PACKAGE is available from C++ programs.
+# HEADER and LIBRARY are respectively a header and the library name
+# (object) that are checked to assess the usability of the library.
+# SHELL_NAME is a name used in shell variables (preferably in lower
+# case), while CPP_NAME is used in the name of C++ preprocessor macros
+# and flags (preferably in upper case).
+#
+# If they are not given, SHELL_NAME defaults to m4_tolower([LIBRARY])
+# and CPP_NAME defaults to m4_toupper([LIBRARY]).
+#
+# This macro sets the shell variable oln_have_`SHELL_NAME' to `yes' if
+# the library is found and if it is working (and to `no' otherwise),
+# and defines a CPP macro and an Automake conditional both named
+# HAVE_`CPP_NAME'. It also sets `CPP_NAME'_CXXFLAGS and
+# `CPP_NAME'_LDFLAGS.
+#
+# Examples of use:
+#
+# OLN_WITH_LIB([FreeImagePlus], [FreeImagePlus.h], [freeimageplus])
+# OLN_WITH_LIB([CFITSIO], [fitsio.h], [cfitsio])
+# OLN_WITH_LIB([Zlib], [zlib.h], [z], [zlib], [ZLIB])
+#
+AC_DEFUN([OLN_WITH_LIB],
+[dnl Do some sanity checking of the arguments.
+m4_if([$1], , [AC_FATAL([$0: missing argument 1])])dnl
+m4_if([$2], , [AC_FATAL([$0: missing argument 2])])dnl
+m4_if([$3], , [AC_FATAL([$0: missing argument 3])])dnl
+_OLN_WITH_LIB([$1], [$2], [$3],dnl
+dnl Process optional arguments.
+m4_default([$4], m4_tolower([$3])),dnl
+m4_default([$5], m4_toupper([$3])))dnl
+])# OLN_WITH_LIB
+
+
+# _OLN_WITH_LIB(PACKAGE, HEADER, LIBRARY, SHELL_NAME, CPP_NAME)
+# -------------------------------------------------------------
+# Actual implementation of OLN_WITH_LIB.
+AC_DEFUN([_OLN_WITH_LIB],
+[dnl
+ AC_REQUIRE([AC_PROG_CXX])
+ AC_LANG_PUSH([C++])
+ AC_ARG_WITH([$4],
+ [AC_HELP_STRING([--with-$4@<:@=DIR@:>@],
+ [use $1 (DIR = prefix for $1 installation)])])
+ $5_CXXFLAGS=''
+ $5_LDFLAGS=''
+ if test "x$with_$4" != xno; then
+ if test -n "$with_$4"; then
+ $5_CXXFLAGS="-I${with_$4}/include"
+ $5_LDFLAGS="-L${with_$4}/lib"
+ fi
+ oln_save_CXXFLAGS=$CXXFLAGS
+ oln_save_LDFLAGS=$LDFLAGS
+ CXXFLAGS="$CXXFLAGS $$5_CXXFLAGS"
+ LDFLAGS="$LDFLAGS $$5_LDFLAGS"
+ oln_have_$4=no
+ AC_CHECK_HEADER([$2],
+ [AC_CHECK_LIB([$3],
+ [main],
+ [oln_have_$4=yes
+ $5_LDFLAGS="$$5_LDFLAGS -l$3"
+ AC_DEFINE([HAVE_$5], 1, [Define to 1 if we can use $1])
+ ]
+ )]
+ )
+ CXXFLAGS=$oln_save_CXXFLAGS
+ LDFLAGS=$oln_save_LDFLAGS
+ TOOLS_LDFLAGS="$TOOLS_LDFLAGS $$5_LDFLAGS"
+ fi
+ AC_SUBST([$5_CXXFLAGS])
+ AC_SUBST([$5_LDFLAGS])
+ AM_CONDITIONAL([HAVE_$5], [test x$oln_have_$4 = xyes])
+ AC_LANG_POP([C++])
+])# _OLN_WITH_LIB
--
1.6.1.2