From 293337d994ffd0b5747b43ef3f2315a8d9118b07 Mon Sep 17 00:00:00 2001 From: Andreas Naumann Date: Mon, 7 Mar 2022 23:09:02 +0000 Subject: [PATCH] Set QT_PLUGIN_PATH The MR 1. adds a note, that the tests in the build tree depend on the install tree. 2. extends the QT_PLUGIN_PATH with KDE_INSTALL_FULL_QTPLUGINDIR in cmake before creating the tests. That removes the need to source prefix.sh before calling cmake. --- CMakeLists.txt | 7 +++++++ README.md | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3dc3c42a..1eea1ad2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,13 @@ include(ECMAddAppIcon) include(CMakePackageConfigHelpers) include(ECMSetupQtPluginMacroNames) +# append the plugins from the install tree folder to the QT_PLUGIN_PATH +if(UNIX) + set(ENV{QT_PLUGIN_PATH} "$ENV{QT_PLUGIN_PATH}:${KDE_INSTALL_FULL_QTPLUGINDIR}") +elseif(WIN32) + set(ENV{QT_PLUGIN_PATH} "$ENV{QT_PLUGIN_PATH};${KDE_INSTALL_FULL_QTPLUGINDIR}") +endif() + set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/README.md b/README.md index c29063f5c..69075719b 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,17 @@ make make install ``` +Okular also builds tests in the build tree. To run them, you have to run `make install` first. + If you install Okular in a different path than your system install directory it is possible that you need to run ```bash -source build/prefix.sh; okular +source prefix.sh ``` so that the correct Okular instance and libraries are picked up. +Afterwards one can run `okular` inside the shell instance. +The source command is also required to run the tests manually. As stated above, Okular has various build targets. Two of them are executables.