Description: Use pkg-config to locate gpgme
Author: Andreas Metzler <ametzler@debian.org>
Bug-Debian: https://bugs.debian.org/1024475
Origin: vendor
Forwarded: no
Last-Update: 2022-12-10

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,11 +10,12 @@
 find_package(ECM REQUIRED NO_MODULE)
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
 
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
 IF(NOT BASKET_DISABLE_GPG)
-  find_package(Gpgme)
+  FIND_PACKAGE(PkgConfig)
+  pkg_search_module(GPGME gpgme)
 ENDIF(NOT BASKET_DISABLE_GPG)
 
 # libgit2
 find_package(Libgit2)
 IF(LIBGIT2_FOUND)
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,6 +1,6 @@
-include_directories(${GPGME_INCLUDES})
+include_directories(${GPGME_INCLUDE_DIRS})
 
 ########### next target ###############
 
 set(basketcommon_LIB_SRCS
     aboutdata.cpp
@@ -67,11 +67,11 @@
 
 add_library(basketcommon SHARED ${basketcommon_LIB_SRCS} ${basket_FORM_HDRS} ${basket_RESOURCES})
 
 target_link_libraries(basketcommon
   ${PHONON_LIBRARY}
-  ${GPGME_VANILLA_LIBRARIES}
+  ${GPGME_LIBRARIES}
   KF5::Archive
   KF5::ConfigWidgets
   KF5::CoreAddons
   KF5::Crash
   KF5::DBusAddons
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -36,11 +36,11 @@
 
     add_executable(${_testname} ${_testname}.cpp ${baskettest_SRCS})
     ecm_mark_as_test(${_testname})
     add_dependencies(tests ${_testname})
     
-    target_link_libraries(${_testname} basketcommon ${GPGME_VANILLA_LIBRARIES} Qt5::Test)
+    target_link_libraries(${_testname} basketcommon ${GPGME_LIBRARIES} Qt5::Test)
 endmacro(basket_full_unit_test)
 
 
 basket_standalone_unit_test(notetest)
 basket_standalone_unit_test(basketviewtest)
