On Mon, Apr 17, 2017 at 9:30 AM, Martin Gräßlin <mgraess...@kde.org> wrote: >> Would it be possible to use relative-to-calling-binary paths? > > > Simply put: no. That would require quite some engineering effort especially > considering that distros do have the libexec paths different with some > adding the arch into it. This makes it almost impossible to get it right.
``` QString path; char *bin_path = realpath("/proc/self/exe", NULL); if (bin_path == NULL) { path = QString::fromLatin1(KDE_INSTALL_FULL_LIBEXEC); } else { QFileInfo info(QString::fromLatin1(bin_path)); path = info.dir().relativeFilePath(QLatin1String(KDE_INSTALL_FULL_LIBEXEC)); } auto helper = relativePath + QLatin1String("/magicExecutable"); ``` We always know where stuff is installed to... we install it. Not wanting to add the relative resolution code is, of course, a different story. HS