From: Hefee Date: Tue, 26 May 2020 22:00:37 +0000 (+0100) Subject: Make GAPI optional X-Git-Tag: archive/raspbian/4%20.04.1-1+rpi1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8a0eb57ab3823f76026a9f3490c25777b347d293;p=kdepim-runtime.git Make GAPI optional Origin: Debian Bug-Debian: https://bugs.debian.org/925155 Last-Update: 2019-03-20 GAPI is only needed for the google resource. If GAPI is not available simply skip building this resource. Last-Update: 2019-03-20 Gbp-Pq: Name make_GAPI_optional.patch --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 15cbb9cb..6c2d46f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,7 +134,7 @@ find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED) find_package(KF5AkonadiNotes ${AKONADINOTE_LIB_VERSION} CONFIG REQUIRED) find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED) find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED) -find_package(KPimGAPI ${KGAPI_LIB_VERSION} CONFIG REQUIRED) +find_package(KPimGAPI ${KGAPI_LIB_VERSION} CONFIG) option(KDEPIM_RUN_ISOLATED_TESTS "Run the isolated tests." FALSE) option(NO_REGENERATE_MIME "Don't regenerate mime file (developer-only option)" FALSE ) diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 326e3f2b..3dafa46f 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -52,7 +52,9 @@ add_subdirectory( maildir ) add_subdirectory( openxchange ) add_subdirectory( pop3 ) -add_subdirectory( google ) +if (KPimGAPI_FOUND) + add_subdirectory( google ) +endif() add_subdirectory( shared ) add_subdirectory( birthdays ) diff --git a/resources/imap/CMakeLists.txt b/resources/imap/CMakeLists.txt index d2745f46..3a0c0b98 100644 --- a/resources/imap/CMakeLists.txt +++ b/resources/imap/CMakeLists.txt @@ -1,6 +1,10 @@ add_definitions(-DTRANSLATION_DOMAIN=\"akonadi_imap_resource\") -set(WITH_GMAIL_XOAUTH2 TRUE) +if (KPimGAPI_FOUND) + set(WITH_GMAIL_XOAUTH2 TRUE) +else() + set(WITH_GMAIL_XOAUTH2 FALSE) +endif() configure_file(config-imap.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-imap.h) @@ -90,6 +94,15 @@ target_link_libraries(imapresource ) ########### next target ############### +if (KPimGAPI_FOUND) + set(akonadi_imap_resource_KPimGAPI + KPim::GAPICore + ) + set( akonadi_imap_resource_KPimGAPI_SRCS + passwordrequester.cpp + gmailpasswordrequester.cpp + ) +endif() set( akonadi_imap_resource_SRCS main.cpp @@ -98,8 +111,7 @@ set( akonadi_imap_resource_SRCS settingspasswordrequester.cpp setupserver.cpp serverinfodialog.cpp - passwordrequester.cpp - gmailpasswordrequester.cpp + ${akonadi_imap_resource_KPimGAPI_SRCS} ) install( FILES imapresource.desktop DESTINATION "${KDE_INSTALL_DATAROOTDIR}/akonadi/agents" ) @@ -129,9 +141,12 @@ target_link_libraries(akonadi_imap_resource imapresource KF5::TextWidgets folderarchivesettings - KPim::GAPICore + ${akonadi_imap_resource_KPimGAPI} ) + + + install(TARGETS akonadi_imap_resource ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) add_subdirectory( wizard )