aboutsummaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-06-20 09:49:02 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2014-06-24 14:05:29 +0200
commita68470880a0195f7a52caad46b442df694cb26b0 (patch)
tree780395fb8f574b2fb6a8756111ccd9996af69af5 /src/app
parent6d72bca8f84ff2b9a83a34a361acc3a4d510ad74 (diff)
Command-line frontend: Make plugin and search paths configurable.
Projects embedding qbs might put these somewhere else. Task-number: QTCREATORBUG-12473 Change-Id: I13e1a1843586501bb3e17a314ccd11af6c25ee43 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'src/app')
-rw-r--r--src/app/qbs/commandlinefrontend.cpp9
-rw-r--r--src/app/qbs/qbs.pro5
-rw-r--r--src/app/qbs/qbs.qbs3
3 files changed, 10 insertions, 7 deletions
diff --git a/src/app/qbs/commandlinefrontend.cpp b/src/app/qbs/commandlinefrontend.cpp
index e24ad8677..1a958935c 100644
--- a/src/app/qbs/commandlinefrontend.cpp
+++ b/src/app/qbs/commandlinefrontend.cpp
@@ -118,8 +118,6 @@ void CommandLineFrontend::start()
if (m_parser.showProgress())
m_observer = new ConsoleProgressObserver;
- const QString qbsRootPath = QDir::cleanPath(QCoreApplication::applicationDirPath()
- + QLatin1String("/../"));
SetupProjectParameters params;
params.setProjectFilePath(m_parser.projectFilePath());
params.setIgnoreDifferentProjectFilePath(m_parser.force());
@@ -139,9 +137,10 @@ void CommandLineFrontend::start()
if (profileName.isEmpty())
throw ErrorInfo(Tr::tr("No profile specified and no default profile exists."));
const Preferences prefs(m_settings, profileName);
- params.setSearchPaths(prefs.searchPaths(qbsRootPath));
- params.setPluginPaths(prefs.pluginPaths(qbsRootPath
- + QLatin1String("/" QBS_LIBRARY_DIRNAME)));
+ params.setSearchPaths(prefs.searchPaths(QDir::cleanPath(QCoreApplication::applicationDirPath()
+ + QLatin1String("/" QBS_RELATIVE_SEARCH_PATH))));
+ params.setPluginPaths(prefs.pluginPaths(QDir::cleanPath(QCoreApplication::applicationDirPath()
+ + QLatin1String("/" QBS_RELATIVE_PLUGINS_PATH))));
params.setTopLevelProfile(profileName);
params.setBuildVariant(buildVariant);
params.setBuildRoot(buildDirectory(profileName));
diff --git a/src/app/qbs/qbs.pro b/src/app/qbs/qbs.pro
index cc48c5c78..20fce2697 100644
--- a/src/app/qbs/qbs.pro
+++ b/src/app/qbs/qbs.pro
@@ -21,4 +21,7 @@ HEADERS += \
../shared/qbssettings.h
include(../../library_dirname.pri)
-DEFINES += QBS_LIBRARY_DIRNAME=\\\"$${QBS_LIBRARY_DIRNAME}\\\"
+isEmpty(QBS_RELATIVE_PLUGINS_PATH):QBS_RELATIVE_PLUGINS_PATH=../$${QBS_LIBRARY_DIRNAME}
+isEmpty(QBS_RELATIVE_SEARCH_PATH):QBS_RELATIVE_SEARCH_PATH=..
+DEFINES += QBS_RELATIVE_PLUGINS_PATH=\\\"$${QBS_RELATIVE_PLUGINS_PATH}\\\"
+DEFINES += QBS_RELATIVE_SEARCH_PATH=\\\"$${QBS_RELATIVE_SEARCH_PATH}\\\"
diff --git a/src/app/qbs/qbs.qbs b/src/app/qbs/qbs.qbs
index 71a89c43b..dc5f79cad 100644
--- a/src/app/qbs/qbs.qbs
+++ b/src/app/qbs/qbs.qbs
@@ -7,7 +7,8 @@ QbsApp {
targetName: "qbs"
cpp.defines: base.concat([
'QBS_VERSION="' + Version.qbsVersion() + '"',
- 'QBS_LIBRARY_DIRNAME="' + project.libDirName + '"'
+ 'QBS_RELATIVE_SEARCH_PATH="' + project.relativeSearchPath + '"',
+ 'QBS_RELATIVE_PLUGINS_PATH="' + project.relativePluginsPath + '"'
])
files: [
"../shared/qbssettings.h",