-
Notifications
You must be signed in to change notification settings - Fork 0
/
libxml2-config.cmake.cmake.in
100 lines (84 loc) · 3.83 KB
/
libxml2-config.cmake.cmake.in
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# libxml2-config.cmake
# --------------------
#
# Libxml2 cmake module.
# THis module sets the following variables:
#
# ::
#
# LIBXML2_INCLUDE_DIRS - Directory where libxml2 headers are located.
# LIBXML2_LIBRARIES - xml2 libraries to link against.
# LIBXML2_VERSION_MAJOR - The major version of libxml2.
# LIBXML2_VERSION_MINOR - The minor version of libxml2.
# LIBXML2_VERSION_PATCH - The patch version of libxml2.
# LIBXML2_VERSION_STRING - version number as a string (ex: "2.3.4")
# LIBXML2_MODULES - whether libxml2 has dso support
include("${CMAKE_CURRENT_LIST_DIR}/libxml2-export.cmake")
@PACKAGE_INIT@
set(LIBXML2_VERSION_MAJOR @LIBXML_MAJOR_VERSION@)
set(LIBXML2_VERSION_MINOR @LIBXML_MINOR_VERSION@)
set(LIBXML2_VERSION_PATCH @LIBXML_MICRO_VERSION@)
set(LIBXML2_VERSION_STRING "@VERSION@")
set(LIBXML2_INSTALL_PREFIX ${PACKAGE_PREFIX_DIR})
set(LIBXML2_INCLUDE_DIRS ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@ ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@/libxml2)
set(LIBXML2_LIBRARY_DIR ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@)
macro(select_library_location target basename)
foreach(property IN ITEMS IMPORTED_LOCATION IMPORTED_IMPLIB)
get_target_property(${basename}_${property}_DEBUG ${target} ${property}_DEBUG)
get_target_property(${basename}_${property}_MINSIZEREL ${target} ${property}_MINSIZEREL)
get_target_property(${basename}_${property}_RELEASE ${target} ${property}_RELEASE)
get_target_property(${basename}_${property}_RELWITHDEBINFO ${target} ${property}_RELWITHDEBINFO)
if(${basename}_${property}_DEBUG AND ${basename}_${property}_RELEASE)
set(${basename}_LIBRARIES debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_RELEASE})
elseif(${basename}_${property}_DEBUG AND ${basename}_${property}_RELWITHDEBINFO)
set(${basename}_LIBRARIES debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_RELWITHDEBINFO})
elseif(${basename}_${property}_DEBUG AND ${basename}_${property}_MINSIZEREL)
set(${basename}_LIBRARIES debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_MINSIZEREL})
elseif(${basename}_${property}_RELEASE)
set(${basename}_LIBRARIES ${${basename}_${property}_RELEASE})
elseif(${basename}_${property}_RELWITHDEBINFO)
set(${basename}_LIBRARIES ${${basename}_${property}_RELWITHDEBINFO})
elseif(${basename}_${property}_MINSIZEREL)
set(${basename}_LIBRARIES ${${basename}_${property}_MINSIZEREL})
elseif(${basename}_${property}_DEBUG)
set(${basename}_LIBRARIES ${${basename}_${property}_DEBUG})
endif()
endforeach()
endmacro()
select_library_location(LibXml2::LibXml2 LIBXML2)
include(CMakeFindDependencyMacro)
if(@LIBXML2_WITH_ICONV@)
find_dependency(Iconv)
list(APPEND LIBXML2_LIBRARIES ${Iconv_LIBRARIES})
list(APPEND LIBXML2_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS})
endif()
if(NOT @BUILD_SHARED_LIBS@)
if(@LIBXML2_WITH_THREADS@)
find_dependency(Threads)
list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif()
if(@LIBXML2_WITH_ICU@)
find_dependency(ICU)
list(APPEND LIBXML2_LIBRARIES ${ICU_LIBRARIES})
list(APPEND LIBXML2_INCLUDE_DIRS ${ICU_INCLUDE_DIRS})
endif()
if(@LIBXML2_WITH_LZMA@)
find_dependency(LibLZMA)
list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES})
list(APPEND LIBXML2_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIRS})
endif()
if(@LIBXML2_WITH_ZLIB@)
find_dependency(ZLIB)
list(APPEND LIBXML2_LIBRARIES ${ZLIB_LIBRARIES})
list(APPEND LIBXML2_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
endif()
if(UNIX)
list(APPEND LIBXML2_LIBRARIES m)
endif()
if(WIN32)
list(APPEND LIBXML2_LIBRARIES ws2_32)
endif()
endif()
# whether libxml2 has dso support
set(LIBXML2_MODULES @LIBXML2_WITH_MODULES@)
mark_as_advanced( LIBXML2_INCLUDE_DIRS LIBXML2_LIBRARIES )