Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[libxml2] Add link libraries for target LibXml2::LibXml2 #14478

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ports/libxml2/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Source: libxml2
Version: 2.9.10
Port-Version: 1
Homepage: https://xmlsoft.org/
Description: Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform)
Build-Depends: zlib, libiconv, liblzma
9 changes: 4 additions & 5 deletions ports/libxml2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ vcpkg_from_github(
RemoveIncludeFromWindowsRcFile.patch
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
Expand All @@ -20,14 +20,13 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()

# Handle copyright
configure_file(${SOURCE_PATH}/Copyright ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
configure_file("${SOURCE_PATH}/Copyright" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)

# Install usage
file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

vcpkg_copy_pdbs()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
endif()
6 changes: 5 additions & 1 deletion ports/libxml2/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ if(LibXml2_FOUND)
else()
list(APPEND LIBXML2_LIBRARIES ${ICONV_LIBRARIES} ${CHARSET_LIBRARIES})
if(TARGET LibXml2::LibXml2)
target_link_libraries(LibXml2::LibXml2 INTERFACE ${ICONV_LIBRARIES} ${CHARSET_LIBRARIES})
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries(LibXml2::LibXml2 INTERFACE ${ICONV_LIBRARIES} ${CHARSET_LIBRARIES} ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES} ws2_32)
else()
target_link_libraries(LibXml2::LibXml2 INTERFACE ${ICONV_LIBRARIES} ${CHARSET_LIBRARIES} ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES})
endif()
endif()
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
Expand Down