IF(WINDOWS)
FIND_LIBRARY(LIBXML2_LIB libxml2 PATHS ${LIBXML2_LIB_PATHS} ${LIBXML2_FIND_PATHS_OPTION})
ELSE(WINDOWS)
- FIND_LIBRARY(LIBXML2_LIB xml2 PATHS ${LIBXML2_LIB_PATHS} ${LIBXML2_FIND_PATHS_OPTION})
+ IF(LIBXML2_LIB_PATHS)
+ FIND_LIBRARY(LIBXML2_LIB xml2 PATHS ${LIBXML2_LIB_PATHS} ${LIBXML2_FIND_PATHS_OPTION})
+ ELSE(LIBXML2_LIB_PATHS)
+ # use pkg-config to get the directories and then use these values in FIND_LIBRARY()
+ FIND_PACKAGE(PkgConfig QUIET)
+ PKG_CHECK_MODULES(PC_LIBXML QUIET libxml-2.0)
+ FIND_LIBRARY(LIBXML2_LIB xml2 HINTS ${PC_LIBXML_LIBDIR} ${PC_LIBXML_LIBRARY_DIRS})
+ ENDIF(LIBXML2_LIB_PATHS)
ENDIF(WINDOWS)
SET(LIBXML2_LIBS)
IF(LIBXML2_LIB)