Skip to contentSkip to conversation

package/libxml2: fix libxml2-config.cmake

PATCH New Samuel Martin 2 participants 4 messages Dec 30, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/libxml2: fix libxml2-config.cmake

This patch aligns the libxml2-config.cmake module to what the libxml-2.0.pc set.

This patch has already been sent upstream:
https://mail.gnome.org/archives/xml/2014-December/msg00015.html

---
 ...onfig.cmake.in-update-include-directories.patch | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 package/libxml2/0001-libxml2-config.cmake.in-update-include-directories.patch
package/libxml2/0001-libxml2-config.cmake.in-update-include-directories.patch new file +28 -0
new file mode 100644
index 0000000..589c8d6
@@ -0,0 +1,28 @@
+From dd6125f4b58fe7bc270e51bc3fcf41cd228d22fc Mon Sep 17 00:00:00 2001
+From: Samuel Martin <[email protected]>
+Date: Mon, 29 Dec 2014 20:40:18 +0100
+Subject: [PATCH] libxml2-config.cmake.in: update include directories
+
+Align the include directories on those from the pkg-config module.
+
+Signed-off-by: Samuel Martin <[email protected]>
+---
+ libxml2-config.cmake.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libxml2-config.cmake.in b/libxml2-config.cmake.in
+index ac29329..6b16fc2 100644
+--- a/libxml2-config.cmake.in
++++ b/libxml2-config.cmake.in
+@@ -21,7 +21,7 @@ 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_INCLUDE_DIRS   ${_libxml2_rootdir}/include ${_libxml2_rootdir}/include/libxml2)
+ set(LIBXML2_LIBRARY_DIR    ${_libxml2_rootdir}/lib)
+ set(LIBXML2_LIBRARIES      -L${LIBXML2_LIBRARY_DIR} -lxml2)
+ 
+-- 
+2.2.1
+
Signature · 1 line
2.2.1
#1 lore raw

PATCH 2/2 package/libiio: fix static build

Use the CMake module provided by libxml2 instead of the one from CMake to correctly set the cflags and ldflags.

Fixes:
http://autobuild.buildroot.net/results/964f98fafdcd7e994ea25cf0993915d81537c31c/

Note that this patch needs the following one to be merged in libxml2:
https://mail.gnome.org/archives/xml/2014-December/msg00015.html

---
 ...l2-detection-try-first-the-CMake-module-f.patch | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 package/libiio/0002-cmake-libxml2-detection-try-first-the-CMake-module-f.patch
package/libiio/0002-cmake-libxml2-detection-try-first-the-CMake-module-f.patch new file +42 -0
new file mode 100644
index 0000000..9f44169
@@ -0,0 +1,42 @@
+From 4f849e1d2287206cfb7ff0fdeca96c22383b0d53 Mon Sep 17 00:00:00 2001
+From: Samuel Martin <[email protected]>
+Date: Mon, 29 Dec 2014 19:05:13 +0100
+Subject: [PATCH] cmake: libxml2 detection: try first the CMake module from
+ libxml2
+
+Libxml2 >=2.9.2 provides its own CMake module, so check for it before
+falling back on the CMake's module FindLibXml2.cmake.
+
+Signed-off-by: Samuel Martin <[email protected]>
+---
+ CMakeLists.txt | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 393fee3..b4f1d26 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -38,7 +38,19 @@ endif()
+ find_library(AVAHI_CLIENT_LIBRARIES avahi-client)
+ find_library(AVAHI_COMMON_LIBRARIES avahi-common)
+ find_library(PTHREAD_LIBRARIES pthread)
+-include(FindLibXml2)
++
++# Since libxml2-2.9.2, libxml2 provides its own LibXml2-config.cmake, with all
++# variables correctly set.
++# So, try first to find the CMake module provided by libxml2 package, then fallback
++# on the CMake's FindLibXml2.cmake module (which can lack some definition, especially
++# in static build case).
++find_package(LibXml2 QUIET NO_MODULE)
++if(DEFINED LIBXML2_VERSION_STRING)
++  set(LIBXML2_FOUND ON)
++  set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS})
++else()
++  include(FindLibXml2)
++endif()
+ 
+ set(LIBIIO_CFILES channel.c device.c context.c buffer.c utilities.c)
+ set(LIBIIO_HEADERS iio.h)
+-- 
+2.2.1
+
Signature · 1 line
2.2.1
#2 lore raw

PATCH 2/2 package/libiio: fix static build

Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Samuel" == Samuel Martin <[email protected]> writes:

Use the CMake module provided by libxml2 instead of the one from CMake to correctly set the cflags and ldflags.

Quoted 7 lines

Fixes:
http://autobuild.buildroot.net/results/964f98fafdcd7e994ea25cf0993915d81537c31c/

Note that this patch needs the following one to be merged in libxml2:
https://mail.gnome.org/archives/xml/2014-December/msg00015.html

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/2 package/libxml2: fix libxml2-config.cmake

In reply to Samuel Martin
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Samuel" == Samuel Martin <[email protected]> writes:

This patch aligns the libxml2-config.cmake module to what the libxml-2.0.pc set. This patch has already been sent upstream:
https://mail.gnome.org/archives/xml/2014-December/msg00015.html

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard