Fix swiftlauncher executable names for Linux platforms

refs #615
This commit is contained in:
Roland Winklmeier
2016-04-29 21:55:27 +02:00
parent ab1491f085
commit 014c218afa
3 changed files with 30 additions and 4 deletions

View File

@@ -77,6 +77,20 @@ namespace BlackMisc
#endif #endif
} }
bool CBuildConfig::isRunningOnLinuxPlatform()
{
#ifdef Q_OS_LINUX
return true;
#else
return false;
#endif
}
bool CBuildConfig::isRunningOnUnixPlatform()
{
return isRunningOnMacOSXPlatform() || isRunningOnLinuxPlatform();
}
bool CBuildConfig::isDebugBuild() bool CBuildConfig::isDebugBuild()
{ {
#ifdef QT_DEBUG #ifdef QT_DEBUG

View File

@@ -77,6 +77,12 @@ namespace BlackMisc
//! Running on Mac OS X platform? //! Running on Mac OS X platform?
static bool isRunningOnMacOSXPlatform(); static bool isRunningOnMacOSXPlatform();
//! Running on Linux platform?
static bool isRunningOnLinuxPlatform();
//! Running on Unix (Linux or Mac OS X) platform
static bool isRunningOnUnixPlatform();
//! Application directory where current application is located //! Application directory where current application is located
//! \todo Move to to CApplication //! \todo Move to to CApplication
static const QString &getApplicationDir(); static const QString &getApplicationDir();

View File

@@ -195,8 +195,10 @@ void CSwiftLauncher::startSwiftCore()
} }
// I set this for debug purpose only // I set this for debug purpose only
this->m_executableArgs = args; m_executableArgs = args;
this->m_executable = CBuildConfig::swiftCoreExecutableName(); m_executable.clear();
if (CBuildConfig::isRunningOnUnixPlatform()) { m_executable += "./"; }
m_executable += CBuildConfig::swiftCoreExecutableName();
CLogMessage(this).info(this->getCmdLine()); CLogMessage(this).info(this->getCmdLine());
// start // start
@@ -205,7 +207,9 @@ void CSwiftLauncher::startSwiftCore()
void CSwiftLauncher::setSwiftDataExecutable() void CSwiftLauncher::setSwiftDataExecutable()
{ {
m_executable = CBuildConfig::swiftDataExecutableName(); m_executable.clear();
if (CBuildConfig::isRunningOnUnixPlatform()) { m_executable += "./"; }
m_executable += CBuildConfig::swiftDataExecutableName();
m_executableArgs.clear(); m_executableArgs.clear();
} }
@@ -214,7 +218,9 @@ bool CSwiftLauncher::setSwiftGuiExecutable()
QString msg; QString msg;
if (this->isStandaloneGuiSelected() || this->canConnectDBusServer(msg)) if (this->isStandaloneGuiSelected() || this->canConnectDBusServer(msg))
{ {
m_executable = CBuildConfig::swiftGuiExecutableName(); m_executable.clear();
if (CBuildConfig::isRunningOnUnixPlatform()) { m_executable += "./"; }
m_executable += CBuildConfig::swiftGuiExecutableName();
QStringList args QStringList args
{ {
"--core", CoreModes::coreModeToString(getCoreMode()), "--core", CoreModes::coreModeToString(getCoreMode()),