FindLibxml.cmake 724 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

if(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
	# Already in cache, be silent
	set(LIBXML_FIND_QUIETLY TRUE)	
endif(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)

set(LIBXML_LIBRARY)
set(LIBXML_INCLUDE_DIR)

FIND_PATH(LIBXML_INCLUDE_DIR libxml/parser.h
	/usr/include
	/usr/include/libxml2
	/usr/local/include
)

FIND_LIBRARY(LIBXML_LIBRARY NAMES xml2
	PATHS
	/usr/lib
	/usr/local/lib
)

if(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
   MESSAGE( STATUS "libxml found: includes in ${LIBXML_INCLUDE_DIR}, library in ${LIBXML_LIBRARY}")
   set(LIBXML_FOUND TRUE)
else(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)
   MESSAGE( STATUS "libxml not found")
endif(LIBXML_INCLUDE_DIR AND LIBXML_LIBRARY)

MARK_AS_ADVANCED(LIBXML_INCLUDE_DIR LIBXML_LIBRARY)