Fix ICU build in CMake

This commit is contained in:
Markus Rickert 2020-12-30 14:28:24 +01:00
parent 296ab61e1c
commit 26835480dc
3 changed files with 5 additions and 5 deletions

View File

@ -68,7 +68,7 @@ if(LIBXML2_WITH_ICONV)
endif()
if(LIBXML2_WITH_ICU)
find_package(ICU REQUIRED)
find_package(ICU REQUIRED COMPONENTS data i18n uc)
endif()
if(LIBXML2_WITH_LZMA)
@ -463,7 +463,7 @@ if(LIBXML2_WITH_ICONV)
endif()
if(LIBXML2_WITH_ICU)
target_link_libraries(LibXml2 PRIVATE ICU::i18n)
target_link_libraries(LibXml2 PRIVATE ICU::data ICU::i18n ICU::uc)
if(WIN32)
set(ICU_LIBS "-licudt -licuin -licuuc")
else()

View File

@ -95,7 +95,7 @@ if(NOT @BUILD_SHARED_LIBS@)
endif()
if(@LIBXML2_WITH_ICU@)
find_dependency(ICU)
find_dependency(ICU COMPONENTS data i18n uc)
list(APPEND LIBXML2_LIBRARIES ${ICU_LIBRARIES})
list(APPEND LIBXML2_INCLUDE_DIRS ${ICU_INCLUDE_DIRS})
endif()

View File

@ -57,10 +57,10 @@ if(@WITH_THREADS@)
endif()
if(@WITH_ICU@)
find_dependency(ICU)
find_dependency(ICU COMPONENTS data i18n uc)
list(APPEND LIBXML2_LIBRARIES ${ICU_LIBRARIES})
list(APPEND LIBXML2_INCLUDE_DIRS ${ICU_INCLUDE_DIRS})
list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ICU::i18n>")
list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ICU::data>;\$<LINK_ONLY:ICU::i18n>;\$<LINK_ONLY:ICU::uc>")
endif()
if(@WITH_LZMA@)