diff --git a/libxml2-config.cmake.cmake.in b/libxml2-config.cmake.cmake.in index 15391bb2..27586aab 100644 --- a/libxml2-config.cmake.cmake.in +++ b/libxml2-config.cmake.cmake.in @@ -85,31 +85,38 @@ set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR}) include(CMakeFindDependencyMacro) -if(@LIBXML2_WITH_ICONV@) +set(LIBXML2_SHARED @BUILD_SHARED_LIBS@) +set(LIBXML2_WITH_ICONV @LIBXML2_WITH_ICONV@) +set(LIBXML2_WITH_THREADS @LIBXML2_WITH_THREADS@) +set(LIBXML2_WITH_ICU @LIBXML2_WITH_ICU@) +set(LIBXML2_WITH_LZMA @LIBXML2_WITH_LZMA@) +set(LIBXML2_WITH_ZLIB @LIBXML2_WITH_ZLIB@) + +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(NOT LIBXML2_SHARED) set(LIBXML2_DEFINITIONS -DLIBXML_STATIC) - if(@LIBXML2_WITH_THREADS@) + if(LIBXML2_WITH_THREADS) find_dependency(Threads) list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) endif() - if(@LIBXML2_WITH_ICU@) + if(LIBXML2_WITH_ICU) find_dependency(ICU COMPONENTS data i18n uc) list(APPEND LIBXML2_LIBRARIES ${ICU_LIBRARIES}) endif() - if(@LIBXML2_WITH_LZMA@) + if(LIBXML2_WITH_LZMA) find_dependency(LibLZMA) list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES}) endif() - if(@LIBXML2_WITH_ZLIB@) + if(LIBXML2_WITH_ZLIB) find_dependency(ZLIB) list(APPEND LIBXML2_LIBRARIES ${ZLIB_LIBRARIES}) endif() diff --git a/libxml2-config.cmake.in b/libxml2-config.cmake.in index 97bbcb51..49896900 100644 --- a/libxml2-config.cmake.in +++ b/libxml2-config.cmake.in @@ -44,32 +44,38 @@ unset(LIBXML2_INTERFACE_LINK_LIBRARIES) include(CMakeFindDependencyMacro) -if(@WITH_ICONV@) +set(LIBXML2_WITH_ICONV @WITH_ICONV@) +set(LIBXML2_WITH_THREADS @WITH_THREADS@) +set(LIBXML2_WITH_ICU @WITH_ICU@) +set(LIBXML2_WITH_LZMA @WITH_LZMA@) +set(LIBXML2_WITH_ZLIB @WITH_ZLIB@) + +if(LIBXML2_WITH_ICONV) find_dependency(Iconv) list(APPEND LIBXML2_LIBRARIES ${Iconv_LIBRARIES}) list(APPEND LIBXML2_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS}) list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "Iconv::Iconv") endif() -if(@WITH_THREADS@) +if(LIBXML2_WITH_THREADS) find_dependency(Threads) list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$") endif() -if(@WITH_ICU@) +if(LIBXML2_WITH_ICU) find_dependency(ICU COMPONENTS data i18n uc) list(APPEND LIBXML2_LIBRARIES ${ICU_LIBRARIES}) list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$;\$;\$") endif() -if(@WITH_LZMA@) +if(LIBXML2_WITH_LZMA) find_dependency(LibLZMA) list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES}) list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$") endif() -if(@WITH_ZLIB@) +if(LIBXML2_WITH_ZLIB) find_dependency(ZLIB) list(APPEND LIBXML2_LIBRARIES ${ZLIB_LIBRARIES}) list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$")