From: José Fonseca Date: Sun, 9 Dec 2012 13:22:30 +0000 (+0000) Subject: qapitrace: Determine binary dir in run-time. X-Git-Url: https://git.cworth.org/git?p=apitrace;a=commitdiff_plain;h=db3491e272f3754676673d52c89238e9cc43b7ad qapitrace: Determine binary dir in run-time. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e31cb54..4963bd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -274,7 +274,6 @@ set (WRAPPER_INSTALL_DIR ${LIB_ARCH_INSTALL_DIR}/wrappers) # so that binaries can find each other using just relative paths. # add_definitions( - -DAPITRACE_BINARY_DIR="${CMAKE_BINARY_DIR}" -DAPITRACE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}" -DAPITRACE_PROGRAMS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/bin" -DAPITRACE_SCRIPTS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${SCRIPTS_INSTALL_DIR}" diff --git a/gui/main.cpp b/gui/main.cpp index 3ae56db..471dec7 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -3,6 +3,9 @@ #include "apitrace.h" #include "apitracecall.h" +#include "os_string.hpp" +#include "os_process.hpp" + #include #include #include @@ -34,8 +37,10 @@ int main(int argc, char **argv) qRegisterMetaType >(); #ifndef Q_OS_WIN + os::String currentProcess = os::getProcessName(); + currentProcess.trimFilename(); QString path = qgetenv("PATH"); - path = QLatin1String(APITRACE_BINARY_DIR) + QLatin1String(":") + path; + path = QLatin1String(currentProcess.str()) + QLatin1String(":") + path; qputenv("PATH", path.toLatin1()); #endif