aboutsummaryrefslogtreecommitdiff
path: root/ports/libxml2
diff options
context:
space:
mode:
Diffstat (limited to 'ports/libxml2')
-rw-r--r--ports/libxml2/CMakeLists.txt4
-rw-r--r--ports/libxml2/vcpkg-cmake-wrapper.cmake13
2 files changed, 12 insertions, 5 deletions
diff --git a/ports/libxml2/CMakeLists.txt b/ports/libxml2/CMakeLists.txt
index a7118bec9..323f64c34 100644
--- a/ports/libxml2/CMakeLists.txt
+++ b/ports/libxml2/CMakeLists.txt
@@ -8,7 +8,7 @@ set(CMAKE_STATIC_LIBRARY_PREFIX)
find_package(ZLIB REQUIRED)
find_package(LibLZMA REQUIRED)
-find_package(unofficial-iconv REQUIRED)
+find_package(Iconv REQUIRED)
file(GLOB SOURCES *.c)
list(FILTER SOURCES EXCLUDE REGEX "/(run|test|trio)[^/]*$")
@@ -109,7 +109,7 @@ if(INSTALL_HEADERS)
endif()
target_include_directories(libxml2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include include ${LIBLZMA_INCLUDE_DIRS})
target_link_libraries(libxml2 PRIVATE
- unofficial::iconv::libcharset unofficial::iconv::libiconv
+ Iconv::Iconv
ZLIB::ZLIB
${LIBLZMA_LIBRARIES}
)
diff --git a/ports/libxml2/vcpkg-cmake-wrapper.cmake b/ports/libxml2/vcpkg-cmake-wrapper.cmake
index 94ef45803..405b94670 100644
--- a/ports/libxml2/vcpkg-cmake-wrapper.cmake
+++ b/ports/libxml2/vcpkg-cmake-wrapper.cmake
@@ -14,10 +14,17 @@ if(LibXml2_FOUND)
list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES})
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND LIBXML2_LIBRARIES m)
- else()
- list(APPEND LIBXML2_LIBRARIES ${ICONV_LIBRARIES} ${CHARSET_LIBRARIES})
+ endif()
+ if(ICONV_LIBRARIES)
+ list(APPEND LIBXML2_LIBRARIES ${ICONV_LIBRARIES})
+ if(TARGET LibXml2::LibXml2)
+ target_link_libraries(LibXml2::LibXml2 INTERFACE ${ICONV_LIBRARIES} )
+ endif()
+ endif()
+ if(CHARSET_LIBRARIES)
+ list(APPEND LIBXML2_LIBRARIES ${CHARSET_LIBRARIES})
if(TARGET LibXml2::LibXml2)
- target_link_libraries(LibXml2::LibXml2 INTERFACE ${ICONV_LIBRARIES} ${CHARSET_LIBRARIES})
+ target_link_libraries(LibXml2::LibXml2 INTERFACE ${CHARSET_LIBRARIES})
endif()
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")