From 6a5c352aeda4fc5ae0507ffd8ff433af26675597 Mon Sep 17 00:00:00 2001 From: Quentin Rouland Date: Sat, 16 Mar 2019 19:57:17 +0100 Subject: [PATCH] Fix cmake third linking --- plugins/Pass/CMakeLists.txt | 22 ++++++++++++---------- plugins/Pass/pass.cpp | 22 ++++++++++++++-------- po/utpass.qrouland.pot | 2 +- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/plugins/Pass/CMakeLists.txt b/plugins/Pass/CMakeLists.txt index f8f11c7..f44da68 100644 --- a/plugins/Pass/CMakeLists.txt +++ b/plugins/Pass/CMakeLists.txt @@ -13,26 +13,28 @@ add_library(${PLUGIN} MODULE ${SRC}) set_target_properties(${PLUGIN} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PLUGIN}) qt5_use_modules(${PLUGIN} Qml Quick DBus) - set(EXTERNAL_LIBS "${CMAKE_SOURCE_DIR}/local") set(THIRD_PATH "${CMAKE_CURRENT_SOURCE_DIR}") INCLUDE_DIRECTORIES(${EXTERNAL_LIBS}/include) add_dependencies(${PLUGIN} LibGpgme) -add_library(target-LibGpgError STATIC IMPORTED) -set_property(TARGET target-LibGpgError PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libgpg-error.a") +add_library(GpgError STATIC IMPORTED) +set_property(TARGET GpgError PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libgpg-error.a") -add_library(target-LibGpgAssuan STATIC IMPORTED) -set_property(TARGET target-LibGpgAssuan PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libassuan.a") +add_library(GpgAssuan STATIC IMPORTED) +set_property(TARGET GpgAssuan PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libassuan.a") -add_library(target-LibGpgppme STATIC IMPORTED) -set_property(TARGET target-LibGpgppme PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libgpgmepp.a") +add_library(Gpgme STATIC IMPORTED) +set_property(TARGET Gpgme PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libgpgme.a") -add_library(target-LibQGpgme STATIC IMPORTED) -set_property(TARGET target-LibQGpgme PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libqgpgme.a") +add_library(Gpgmepp STATIC IMPORTED) +set_property(TARGET Gpgmepp PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libgpgmepp.a") -target_link_libraries(${PLUGIN} target-LibGpgAssuan target-LibGpgError target-LibGpgppme target-LibQGpgme) +add_library(QGpgme STATIC IMPORTED) +set_property(TARGET QGpgme PROPERTY IMPORTED_LOCATION "${EXTERNAL_LIBS}/lib/libqgpgme.a") + +target_link_libraries(${PLUGIN} QGpgme Gpgmepp Gpgme GpgAssuan GpgError) execute_process( COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH diff --git a/plugins/Pass/pass.cpp b/plugins/Pass/pass.cpp index ba4ab9b..941a54d 100644 --- a/plugins/Pass/pass.cpp +++ b/plugins/Pass/pass.cpp @@ -2,17 +2,17 @@ #include #include "pass.h" #include "gpgme++/global.h" +#include "gpgme++/engineinfo.h" +#include "qgpgme/protocol.h" #include "qgpgme/encryptjob.h" -#include "qgpgme/decryptjob.h" -#include "qgpgme/keylistjob.h" + Pass::Pass() { qDebug() << "Initializing GpgMe"; - /*auto err = GpgME::initializeLibrary(GpgME::OpenPGP); - if(err) { + if(GpgME::initializeLibrary(GpgME::OpenPGP)) qFatal("Fatal error when initializing GpgMe"); - }*/ + qDebug() << "GpgME Engine Version :" << GpgME::engineInfo(GpgME::GpgEngine).version(); } void Pass::speak() { @@ -46,9 +46,15 @@ QString Pass::decrypt_file(const QString path) { QByteArray Pass::encrypt(const QString str) { /*auto listjob = QGpgME::openpgp()->keyListJob(false, false, false); std::vector keys; - auto keylistresult = listjob->exec(QStringList() << QStringLiteral("alfa@example.net"), - false, keys); - auto job = QGpgME::openpgp()->encryptJob(/*ASCII Armor *//*true, /* Textmode *//* true); + auto keylistresult = listjob->exec(QStringList() << QStringLiteral("alfa@example.net"), false, keys); + + + + auto job = QGpgME::openpgp() + ->encryptJob( + true, //ASCII Armor + true //Textmode + ); QByteArray cipherText; auto result = job->exec(keys, QStringLiteral("Hello World").toUtf8(), GpgME::Context::AlwaysTrust, cipherText); return cipherText;*/ diff --git a/po/utpass.qrouland.pot b/po/utpass.qrouland.pot index c8b639e..926c8ea 100644 --- a/po/utpass.qrouland.pot +++ b/po/utpass.qrouland.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: utpass.qrouland\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-03-16 15:17+0000\n" +"POT-Creation-Date: 2019-03-16 17:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n"