Commit 471f44aa authored by Tobias Hunger's avatar Tobias Hunger

SDKtool: Always write settings to the place creator expects them

Simplify the .pro-file while at it and add rpath.

Change-Id: Ia111e76093c6c375d04fca51d81ac87a267b0121
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 1b575cb5
......@@ -68,7 +68,6 @@ QString AddQtOperation::argumentsHelpText() const
" --name <NAME> display name of the new Qt version. (required)\n"
" --qmake <PATH> path to qmake. (required)\n"
" --type <TYPE> type of Qt version to add. (required)\n"
" --noauto do not mark tool chain as autodetected.\n"
" <KEY> <TYPE:VALUE> extra key value pairs\n");
}
......
include(../../../qtcreator.pri)
include(../../rpath.pri)
include(../../libs/utils/utils.pri)
CONFIG += console
CONFIG -= app_bundle
QT -= gui test
......@@ -36,9 +38,7 @@ HEADERS += \
rmtoolchainoperation.h \
settings.h \
INCLUDEPATH += \
$$PWD/../../plugins \
$$PWD/../../libs
DESTDIR=$$IDE_APP_PATH
DESTDIR=$$IDE_LIBEXEC_PATH
macx:DEFINES += "DATA_PATH=\"\\\".\\\"\""
else:DEFINES += "DATA_PATH=\"\\\"../share/qtcreator\\\"\""
......@@ -31,10 +31,12 @@
#include "settings.h"
#include "operation.h"
#include <app/app_version.h>
#include <iostream>
#include <QCoreApplication>
#include <QFileInfo>
#include <QDir>
Settings *Settings::m_instance = 0;
......@@ -50,32 +52,11 @@ Settings::Settings() :
m_instance = this;
// autodetect sdk dir:
Utils::FileName sdk = Utils::FileName::fromString(QCoreApplication::applicationDirPath());
Utils::FileName qtc = sdk;
qtc.appendPath(QLatin1String("qtcreator"));
#ifdef Q_OS_WIN
qtc.append(".exe");
#endif
QFileInfo qtcFi = qtc.toFileInfo();
if (!qtcFi.exists() || !qtcFi.isFile() || !qtcFi.isExecutable()) {
// we are in src/tools/sdktool (or lib/qtcreator/bin):
qtc = sdk;
qtc.appendPath(QLatin1String("../../../bin/qtcreator"));
#ifdef Q_OS_WIN
qtc.append(".exe");
#endif
qtcFi = qtc.toFileInfo();
if (!qtcFi.exists() || !qtcFi.isFile() || !qtcFi.isExecutable())
qtc.clear();
}
if (!qtc.isEmpty()) {
sdk = qtc.parentDir();
sdk = sdk.parentDir();
sdk.appendPath(QLatin1String("share/qtcreator/Nokia/qtcreator"));
sdkPath = sdk;
}
sdkPath = Utils::FileName::fromString(QCoreApplication::applicationDirPath());
sdkPath.appendPath(QLatin1String(DATA_PATH));
sdkPath = Utils::FileName::fromString(QDir::cleanPath(sdkPath.toString()));
sdkPath.appendPath(QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR)
+ QLatin1String("/qtcreator"));
}
Utils::FileName Settings::getPath(const QString &file)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment