diff --git a/CMakeLists.txt b/CMakeLists.txt index e2465cf..aa028e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.16) project(squawk VERSION 0.2.3 LANGUAGES CXX) cmake_policy(SET CMP0076 NEW) @@ -211,6 +211,11 @@ if(CMAKE_COMPILER_IS_GNUCXX) target_compile_options(squawk PRIVATE ${COMPILE_OPTIONS}) endif(CMAKE_COMPILER_IS_GNUCXX) +# I am not really sure about this solution +# This should enable plugins to be found in path like /usr/lib/squawk instead of just /usr/lib +set(PLUGIN_PATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/squawk") +add_compile_definitions(PLUGIN_PATH="${PLUGIN_PATH}") + add_subdirectory(main) add_subdirectory(core) add_subdirectory(external/simpleCrypt) diff --git a/core/passwordStorageEngines/kwallet.cpp b/core/passwordStorageEngines/kwallet.cpp index 0dfe071..c92085b 100644 --- a/core/passwordStorageEngines/kwallet.cpp +++ b/core/passwordStorageEngines/kwallet.cpp @@ -28,7 +28,8 @@ Core::PSE::KWallet::CreateFolder Core::PSE::KWallet::createFolder = 0; Core::PSE::KWallet::SetFolder Core::PSE::KWallet::setFolder = 0; Core::PSE::KWallet::SupportState Core::PSE::KWallet::sState = Core::PSE::KWallet::initial; -QLibrary Core::PSE::KWallet::lib("kwalletWrapper"); + +QLibrary Core::PSE::KWallet::lib(QString("%1/kwalletWrapper").arg(PLUGIN_PATH)); Core::PSE::KWallet::KWallet(): QObject(), diff --git a/core/squawk.h b/core/squawk.h index 2ee122e..f00500e 100644 --- a/core/squawk.h +++ b/core/squawk.h @@ -42,10 +42,8 @@ #include "passwordStorageEngines/kwallet.h" #endif -namespace Core -{ -class Squawk : public QObject -{ +namespace Core { +class Squawk : public QObject { Q_OBJECT public: diff --git a/shared/global.cpp b/shared/global.cpp index 6618426..8277ff5 100644 --- a/shared/global.cpp +++ b/shared/global.cpp @@ -50,12 +50,12 @@ Shared::Global* Shared::Global::instance = 0; const std::set Shared::Global::supportedImagesExts = {"png", "jpg", "webp", "jpeg", "gif", "svg"}; #ifdef WITH_KIO -QLibrary Shared::Global::openFileManagerWindowJob("openFileManagerWindowJob"); +QLibrary Shared::Global::openFileManagerWindowJob(QString("%1/openFileManagerWindowJob").arg(PLUGIN_PATH)); Shared::Global::HighlightInFileManager Shared::Global::hfm = 0; #endif #ifdef WITH_KCONFIG -QLibrary Shared::Global::colorSchemeTools("colorSchemeTools"); +QLibrary Shared::Global::colorSchemeTools(QString("%1/colorSchemeTools").arg(PLUGIN_PATH)); Shared::Global::CreatePreview Shared::Global::createPreview = 0; Shared::Global::DeletePreview Shared::Global::deletePreview = 0; Shared::Global::ColorSchemeName Shared::Global::colorSchemeName = 0;