meteoio

meteoio Svn Source Tree

Root/trunk/tools/cmake/FindLibXML++.cmake

1# - Try to find LibXML++ 2.6
2# Once done, this will define
3#
4# LibXML++_FOUND - system has LibXML++
5# LibXML++_INCLUDE_DIRS - the LibXML++ include directories
6# LibXML++_LIBRARIES - link these to use LibXML++
7
8include(LibFindMacros)
9
10# Dependencies
11libfind_package(LibXML++ LibXml2)
12libfind_package(LibXML++ Glibmm)
13
14# Use pkg-config to get hints about paths
15libfind_pkg_check_modules(LibXML++_PKGCONF libxml++-2.6)
16
17# Main include dir
18find_path(LibXML++_INCLUDE_DIR
19 NAMES libxml++/libxml++.h
20 PATHS ${LibXML++_PKGCONF_INCLUDE_DIRS}
21 PATH_SUFFIXES libxml++-2.6
22)
23
24# Glib-related libraries also use a separate config header, which is in lib dir
25find_path(LibXML++Config_INCLUDE_DIR
26 NAMES libxml++config.h
27 PATHS ${LibXML++_PKGCONF_INCLUDE_DIRS} /usr
28 PATH_SUFFIXES lib/libxml++-2.6/include
29)
30
31# Finally the library itself
32find_library(LibXML++_LIBRARY
33 NAMES xml++-2.6
34 PATHS ${LibXML++_PKGCONF_LIBRARY_DIRS}
35)
36
37# Set the include dir variables and the libraries and let libfind_process do the rest.
38# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
39set(LibXML++_PROCESS_INCLUDES LibXML++_INCLUDE_DIR LibXML++Config_INCLUDE_DIR LIBXML2_INCLUDE_DIR Glibmm_INCLUDE_DIRS)
40set(LibXML++_PROCESS_LIBS LibXML++_LIBRARY LIBXML2_LIBRARIES Glibmm_LIBRARIES)
41libfind_process(LibXML++)
42

Archive Download this file

Revision: HEAD