aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Martin <s.martin49@gmail.com>2014-10-11 21:50:41 +0200
committerDaniel Veillard <veillard@redhat.com>2014-10-13 18:02:53 +0800
commitfa23ac1a796877621a21b8470f2c491d995a5151 (patch)
tree2fb00856e51639dd7970f771536fa5792574f7e4
parentaf62eb4fabda119f12c53da2e68cf0decb68b0d8 (diff)
downloadandroid_external_libxml2-fa23ac1a796877621a21b8470f2c491d995a5151.tar.gz
android_external_libxml2-fa23ac1a796877621a21b8470f2c491d995a5151.tar.bz2
android_external_libxml2-fa23ac1a796877621a21b8470f2c491d995a5151.zip
Provide cmake module
* add libxml2-config.cmake.in template * configure.ac: add libxml2-config.cmake.in to the configured file list * Makefile.am: install libxml2-config.cmake under ${libdir}/cmake/libxml2 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac2
-rw-r--r--libxml2-config.cmake.in50
3 files changed, 55 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 89748de6..70720f3d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1207,6 +1207,7 @@ EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \
check-xsddata-test-suite.py check-xinclude-test-suite.py \
example/Makefile.am example/gjobread.c example/gjobs.xml \
$(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \
+ libxml2-config.cmake.in \
trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
triop.h triodef.h libxml.h elfgcchack.h xzlib.h buf.h \
enc.h save.h testThreadsWin32.c genUnicode.py TODO_SCHEMAS \
@@ -1218,6 +1219,9 @@ EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libxml-2.0.pc
+cmakedir = $(libdir)/cmake/libxml2
+cmake_DATA = libxml2-config.cmake
+
#
# Install the tests program sources as examples
#
diff --git a/configure.ac b/configure.ac
index f1575671..eb867ab3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1656,7 +1656,7 @@ rm -f COPYING.LIB COPYING
ln -s $srcdir/Copyright COPYING
# keep on one line for cygwin c.f. #130896
-AC_CONFIG_FILES([libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py])
+AC_CONFIG_FILES([libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc libxml2-config.cmake python/setup.py])
AC_OUTPUT
chmod +x xml2-config python/setup.py
diff --git a/libxml2-config.cmake.in b/libxml2-config.cmake.in
new file mode 100644
index 00000000..ac293291
--- /dev/null
+++ b/libxml2-config.cmake.in
@@ -0,0 +1,50 @@
+# libxml2-config.cmake
+# --------------------
+#
+# Libxml2 cmake module.
+# THis module sets the following variables:
+#
+# ::
+#
+# LIBXML2_INCLUDE_DIRS - Directory where libxml2 headers are located.
+# LIBXML2_LIBRARIES - xml2 libraries to link against.
+# LIBXML2_VERSION_MAJOR - The major version of libxml2.
+# LIBXML2_VERSION_MINOR - The minor version of libxml2.
+# LIBXML2_VERSION_PATCH - The patch version of libxml2.
+# LIBXML2_VERSION_STRING - version number as a string (ex: "2.3.4")
+# LIBXML2_MODULES - whether libxml2 as dso support
+
+get_filename_component(_libxml2_rootdir ${CMAKE_CURRENT_LIST_DIR}/../../../ ABSOLUTE)
+
+set(LIBXML2_VERSION_MAJOR @LIBXML_MAJOR_VERSION@)
+set(LIBXML2_VERSION_MINOR @LIBXML_MINOR_VERSION@)
+set(LIBXML2_VERSION_MICRO @LIBXML_MICRO_VERSION@)
+set(LIBXML2_VERSION_STRING "@VERSION@")
+set(LIBXML2_INSTALL_PREFIX ${_libxml2_rootdir})
+set(LIBXML2_INCLUDE_DIRS ${_libxml2_rootdir}/include)
+set(LIBXML2_LIBRARY_DIR ${_libxml2_rootdir}/lib)
+set(LIBXML2_LIBRARIES -L${LIBXML2_LIBRARY_DIR} -lxml2)
+
+if(@WITH_THREADS@)
+ find_package(Threads REQUIRED)
+ list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+endif()
+
+if(@WITH_LZMA@)
+ find_package(LibLZMA REQUIRED)
+ list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES})
+ list(APPEND LIBXML2_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIRS})
+endif()
+
+if(@WITH_ZLIB@)
+ find_package(ZLIB REQUIRED)
+ list(APPEND LIBXML2_LIBRARIES ${ZLIB_LIBRARIES})
+ list(APPEND LIBXML2_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
+endif()
+
+list(APPEND LIBXML2_LIBRARIES @ICU_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@)
+
+# whether libxml2 has dso support
+set(LIBXML2_MODULES @WITH_MODULES@)
+
+mark_as_advanced( LIBXML2_INCLUDE_DIRS LIBXML2_LIBRARIES )