From 75633580dce7382a7a8aec9a47be55affdf6d4c1 Mon Sep 17 00:00:00 2001 From: Yixue Wang Date: Wed, 27 Sep 2023 14:40:04 +0800 Subject: [PATCH] fix: missing link when disable librsvg When disable librsvg, we use QtSvg to implement dsvgrenderer. Link to Qt(5/6)::Svg target. Log: fix missing link when disable librsvg --- src/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 14714221..7fc7aff6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,9 +34,15 @@ PRIVATE Qt${QT_VERSION_MAJOR}::GuiPrivate Qt${QT_VERSION_MAJOR}::CorePrivate Qt${QT_VERSION_MAJOR}::DBus - PkgConfig::librsvg ) +if(DTK_DISABLE_LIBRSVG) + find_package(Qt${QT_VERSION_MAJOR}Svg REQUIRED) + target_link_libraries(${LIB_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Svg) +else() + target_link_libraries(${LIB_NAME} PRIVATE PkgConfig::librsvg) +endif() + if(NOT DTK_DISABLE_EX_IMAGE_FORMAT AND EX_IMAGE_FORMAT_LIBS_FOUND) target_link_libraries(${LIB_NAME} PRIVATE ${libraw_LIBRARIES} @@ -79,4 +85,3 @@ set(EnableCov CACHE BOOL OFF) if (EnableCov) dtk_setup_code_coverage(${LIB_NAME}) endif() -