Subversion Repositories Scribus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5138 cbradney 1
# - Try to find LibXml2
2
# Once done this will define
3
#
4
#  LIBXML2_FOUND - system has LibXml2
5
#  LIBXML2_INCLUDE_DIR - the LibXml2 include directory
6
#  LIBXML2_LIBRARIES - the libraries needed to use LibXml2
7
#  LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
8
#
9
# use pkg-config to get the directories and then use these values
10
# in the FIND_PATH() and FIND_LIBRARY() calls
11
 
12
 
13
INCLUDE(UsePkgConfig)
14
 
15
PKGCONFIG(libxml-2.0 _LibXml2IncDir _LibXml2LinkDir _LibXml2LinkFlags _LibXml2Cflags)
16
 
17
SET(LIBXML2_DEFINITIONS ${_LibXml2Cflags})
18
 
19
FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h
20
  PATHS ${_LibXml2IncDir} PATH_SUFFIXES libxml2
21
)
22
 
23
FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
24
  PATHS ${_LibXml2LinkDir}
25
)
26
 
27
IF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
28
   SET(LIBXML2_FOUND TRUE)
29
ENDIF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
30
 
31
SET(LibXml2_FIND_QUIETLY 1)
32
 
33
IF (LIBXML2_FOUND)
34
  IF (NOT LibXml2_FIND_QUIETLY)
35
    MESSAGE(STATUS "Found LibXml2: ${LIBXML2_LIBRARIES}")
36
  ENDIF (NOT LibXml2_FIND_QUIETLY)
37
ELSE (LIBXML2_FOUND)
38
  IF (LibXml2_FIND_REQUIRED)
39
    MESSAGE(SEND_ERROR "Could NOT find LibXml2")
40
  ENDIF (LibXml2_FIND_REQUIRED)
41
ENDIF (LIBXML2_FOUND)
42
 
43
MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES)