• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/libiio/0002-cmake-libxml2-detection-try-first-the-CMake-module-f.patch
Samuel MartinSamuel Martin committed 4fc5f4a644030 Dec 2014
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
From 4f849e1d2287206cfb7ff0fdeca96c22383b0d53 Mon Sep 17 00:00:00 2001
2
From: Samuel Martin <s.martin49@gmail.com>
3
Date: Mon, 29 Dec 2014 19:05:13 +0100
4
Subject: [PATCH] cmake: libxml2 detection: try first the CMake module from
5
 libxml2
6
​
7
Libxml2 >=2.9.2 provides its own CMake module, so check for it before
8
falling back on the CMake's module FindLibXml2.cmake.
9
​
10
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
11
---
12
 CMakeLists.txt | 14 +++++++++++++-
13
 1 file changed, 13 insertions(+), 1 deletion(-)
14
​
15
diff --git a/CMakeLists.txt b/CMakeLists.txt
16
index 393fee3..b4f1d26 100644
17
--- a/CMakeLists.txt
18
+++ b/CMakeLists.txt
19
@@ -38,7 +38,19 @@ endif()
20
 find_library(AVAHI_CLIENT_LIBRARIES avahi-client)
21
 find_library(AVAHI_COMMON_LIBRARIES avahi-common)
22
 find_library(PTHREAD_LIBRARIES pthread)
23
-include(FindLibXml2)
24
+
25
+# Since libxml2-2.9.2, libxml2 provides its own LibXml2-config.cmake, with all
26
+# variables correctly set.
27
+# So, try first to find the CMake module provided by libxml2 package, then fallback
28
+# on the CMake's FindLibXml2.cmake module (which can lack some definition, especially
29
+# in static build case).
30
+find_package(LibXml2 QUIET NO_MODULE)
31
+if(DEFINED LIBXML2_VERSION_STRING)
32
+  set(LIBXML2_FOUND ON)
33
+  set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS})
34
+else()
35
+  include(FindLibXml2)
36
+endif()
37
 
38
 set(LIBIIO_CFILES channel.c device.c context.c buffer.c utilities.c)
39
 set(LIBIIO_HEADERS iio.h)
40
-- 
41
2.2.1
42
​
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.