Hi Marco,

I’ve seen your below commit for kio and wondered whether something similar
regarding CMAKE_INSTALL_FULL_LIBEXECDIR could be done for kconfig, since 
currently I need this OSX-specific configure option:
---
$ cat config/build/darwin-mavericks.cfg 
[DEFAULT]
configureExtraArgs=-DCMAKE_INSTALL_BUNDLEDIR="lib/libexec/kf5"
---
to make sure that kconfig can actually find kconfig_compiler.app which
otherwise gets installed in an OSX-location [1].

Surely this application doesn’t need to be exposed to a user, thus the
location in $PREFIX/lib/libexec/kf5 is ok.

But in case cmake does install it - like in [1] below the path
/Applications/KDE - kconfig and kservice [2] should also be able to find
kconfig_compiler's application package.

Greets,
Marko




[1] https://paste.kde.org/pdubpj7nm
[2] https://mail.kde.org/pipermail/kde-frameworks-devel/2014-May/016059.html




On 09 Feb 2015, at 18:41 , Marco Martin <notm...@gmail.com> wrote:

> Git commit 5d70bd5de594ff40a009c0e783f9a0a7eed2f14e by Marco Martin.
> Committed on 09/02/2015 at 17:39.
> Pushed by mart into branch 'master'.
> 
> Look for kdesu in the correct location
> 
> Look for kdesu under CMAKE_INSTALL_FULL_LIBEXECDIR directory
> patch by Maarten De Meyer
> 
> REVIEW:120185
> CCMAIL:de.meyer.maar...@gmail.com
> 
> M  +2    -2    autotests/krununittest.cpp
> M  +11   -1    src/core/desktopexecparser.cpp
> 
> http://commits.kde.org/kio/5d70bd5de594ff40a009c0e783f9a0a7eed2f14e
> 
> diff --git a/autotests/krununittest.cpp b/autotests/krununittest.cpp
> index 73a3932..03cbde8 100644
> --- a/autotests/krununittest.cpp
> +++ b/autotests/krununittest.cpp
> @@ -154,8 +154,8 @@ void KRunUnitTest::testProcessDesktopExec()
>                 int pt = ex + te * 2 + su * 4;
>                 QString exe;
>                 if (pt == 4 || pt == 5) {
> -                    exe = QStandardPaths::findExecutable("kdesu");
> -                    if (exe.isEmpty()) {
> +                    exe = 
> QFile::decodeName(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesu");
> +                    if (!QFile::exists(exe)) {
>                         qWarning() << "kdesu not found, skipping test";
>                         continue;
>                     }
> diff --git a/src/core/desktopexecparser.cpp b/src/core/desktopexecparser.cpp
> index e20f046..7bb29ba 100644
> --- a/src/core/desktopexecparser.cpp
> +++ b/src/core/desktopexecparser.cpp
> @@ -393,7 +393,17 @@ QStringList KIO::DesktopExecParser::resultingArguments() 
> const
>         if (d->service.terminal()) {
>             result << "su";
>         } else {
> -            result << QStandardPaths::findExecutable("kdesu") << "-u";
> +            QString kdesu = 
> QFile::decodeName(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesu");
> +            if (!QFile::exists(kdesu)) {
> +                kdesu = QStandardPaths::findExecutable("kdesu");
> +            }
> +            if (!QFile::exists(kdesu)) {
> +                // Insert kdesu as string so we show a nice warning: 'Could 
> not launch kdesu'
> +                result << QStringLiteral("kdesu");
> +                return result;
> +            } else {
> +                result << kdesu << "-u";
> +            }
>         }
> 
>         result << d->service.username() << "-c";
> 

_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel

Reply via email to