Blame view

cmake/modules/FindLibXML2.cmake 1.14 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
# - Try to find LibXml2
# Once done this will define
#  LIBXML2_FOUND - System has LibXml2
#  LIBXML2_INCLUDE_DIRS - The LibXml2 include directories
#  LIBXML2_LIBRARIES - The libraries needed to use LibXml2
#  LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2

6c8de11c   Benjamin Renard   Remove hard coded...
8
FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xinclude.h PATHS ${USERLOCAL_ROOT}/include/libxml2 NO_DEFAULT_PATH)
23b5301b   Benjamin Renard   Use libxml2 V2.9....
9

6c8de11c   Benjamin Renard   Remove hard coded...
10
FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2 PATHS ${USERLOCAL_ROOT}/lib NO_DEFAULT_PATH)
fbe3c2bb   Benjamin Renard   First commit
11
12
13
14
15
16
17
18
19
20
21
22
23
24

IF(LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
    SET(LibXML2_FOUND 1)
    #remove last /libxml2 string
    STRING(REGEX REPLACE "/libxml2" "" LIBXML2_INCLUDE_DIR_SUP_LEVEL ${LIBXML2_INCLUDE_DIR})
    SET (LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIR_SUP_LEVEL} ${LIBXML2_INCLUDE_DIR} )
    if(NOT LibXML2_FIND_QUIETLY)
        message(STATUS "Found libXML2: ${LIBXML2_LIBRARIES}")
    endif(NOT LibXML2_FIND_QUIETLY)
ELSE(LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
    SET(LibXML2_FOUND 0 CACHE BOOL "Not found libxml2 library")
    message(STATUS "NOT Found libxml2, disabling it")
ENDIF(LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)

23b5301b   Benjamin Renard   Use libxml2 V2.9....
25
MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES)