1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-12 09:17:37 +03:00

Add variables for configured options to CMake config files

This commit is contained in:
Markus Rickert 2020-12-31 16:34:25 +01:00
parent 95519737af
commit 0048728916
2 changed files with 24 additions and 11 deletions

View File

@ -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()

View File

@ -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 "\$<LINK_ONLY:Threads::Threads>")
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 "\$<LINK_ONLY:ICU::data>;\$<LINK_ONLY:ICU::i18n>;\$<LINK_ONLY:ICU::uc>")
endif()
if(@WITH_LZMA@)
if(LIBXML2_WITH_LZMA)
find_dependency(LibLZMA)
list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES})
list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:LibLZMA::LibLZMA>")
endif()
if(@WITH_ZLIB@)
if(LIBXML2_WITH_ZLIB)
find_dependency(ZLIB)
list(APPEND LIBXML2_LIBRARIES ${ZLIB_LIBRARIES})
list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ZLIB::ZLIB>")