1 # libxml2-config.cmake 2 # -------------------- 3 # 4 # Libxml2 cmake module. 5 # THis module sets the following variables: 6 # 7 # :: 8 # 9 # LIBXML2_INCLUDE_DIRS - Directory where libxml2 headers are located. 10 # LIBXML2_LIBRARIES - xml2 libraries to link against. 11 # LIBXML2_VERSION_MAJOR - The major version of libxml2. 12 # LIBXML2_VERSION_MINOR - The minor version of libxml2. 13 # LIBXML2_VERSION_PATCH - The patch version of libxml2. 14 # LIBXML2_VERSION_STRING - version number as a string (ex: "2.3.4") 15 # LIBXML2_MODULES - whether libxml2 as dso support 16 17 get_filename_component(_libxml2_rootdir ${CMAKE_CURRENT_LIST_DIR}/../../../ ABSOLUTE) 18 19 set(LIBXML2_VERSION_MAJOR @LIBXML_MAJOR_VERSION@) 20 set(LIBXML2_VERSION_MINOR @LIBXML_MINOR_VERSION@) 21 set(LIBXML2_VERSION_MICRO @LIBXML_MICRO_VERSION@) 22 set(LIBXML2_VERSION_STRING "@VERSION@") 23 set(LIBXML2_INSTALL_PREFIX ${_libxml2_rootdir}) 24 set(LIBXML2_INCLUDE_DIRS ${_libxml2_rootdir}/include ${_libxml2_rootdir}/include/libxml2) 25 set(LIBXML2_LIBRARY_DIR ${_libxml2_rootdir}/lib) 26 set(LIBXML2_LIBRARIES -L${LIBXML2_LIBRARY_DIR} -lxml2) 27 28 if(@WITH_THREADS@) 29 find_package(Threads REQUIRED) 30 list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) 31 endif() 32 33 if(@WITH_LZMA@) 34 find_package(LibLZMA REQUIRED) 35 list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES}) 36 list(APPEND LIBXML2_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIRS}) 37 endif() 38 39 if(@WITH_ZLIB@) 40 find_package(ZLIB REQUIRED) 41 list(APPEND LIBXML2_LIBRARIES ${ZLIB_LIBRARIES}) 42 list(APPEND LIBXML2_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) 43 endif() 44 45 list(APPEND LIBXML2_LIBRARIES @ICU_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@) 46 47 # whether libxml2 has dso support 48 set(LIBXML2_MODULES @WITH_MODULES@) 49 50 mark_as_advanced( LIBXML2_INCLUDE_DIRS LIBXML2_LIBRARIES ) 51