diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2013-05-22 15:30:56 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-05-23 16:16:30 +0200 |
commit | e004a46267ea3a1b45c3361db34ba603d55dbaeb (patch) | |
tree | aa9ca4fa801975ea89a48733fa081c34f226bf84 /src/app/qbs | |
parent | 64c9bf5e3696834c5b865205e92cb4da675c7c97 (diff) |
Don't install into sysroot by default.
Task-number: QBS-249
Change-Id: I8c4dd985873afd48f65dbc1e368a52b4acadc9c2
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/app/qbs')
-rw-r--r-- | src/app/qbs/commandlinefrontend.cpp | 2 | ||||
-rw-r--r-- | src/app/qbs/parser/commandlineoption.cpp | 21 | ||||
-rw-r--r-- | src/app/qbs/parser/commandlineoption.h | 4 | ||||
-rw-r--r-- | src/app/qbs/parser/commandlineparser.cpp | 1 |
4 files changed, 22 insertions, 6 deletions
diff --git a/src/app/qbs/commandlinefrontend.cpp b/src/app/qbs/commandlinefrontend.cpp index d734b9120..b7a678344 100644 --- a/src/app/qbs/commandlinefrontend.cpp +++ b/src/app/qbs/commandlinefrontend.cpp @@ -395,7 +395,7 @@ int CommandLineFrontend::runTarget() Q_ASSERT(products.count() == 1); const ProductData productToRun = products.first(); const QString executableFilePath = project.targetExecutable(productToRun, - m_parser.installOptions().installRoot()); + m_parser.installOptions()); if (executableFilePath.isEmpty()) { throw Error(Tr::tr("Cannot run: Product '%1' is not an application.") .arg(productToRun.name())); diff --git a/src/app/qbs/parser/commandlineoption.cpp b/src/app/qbs/parser/commandlineoption.cpp index 7f09c2d76..179813d6d 100644 --- a/src/app/qbs/parser/commandlineoption.cpp +++ b/src/app/qbs/parser/commandlineoption.cpp @@ -336,15 +336,22 @@ QString ForceOption::longRepresentation() const } +InstallRootOption::InstallRootOption() : m_useSysroot(false) +{ +} + +static QString magicSysrootString() { return QLatin1String("@sysroot"); } + QString InstallRootOption::description(CommandType command) const { Q_ASSERT(command == InstallCommandType || command == RunCommandType); Q_UNUSED(command); return Tr::tr("%1 <directory>\n" - "\tInstall into the given directory. The default value is qbs.sysroot, " - "if it is defined; otherwise '<build dir>/%2' is used.\n" - "\tIf the directory does not exist, it will be created.\n") - .arg(longRepresentation(), InstallOptions::defaultInstallRoot()); + "\tInstall into the given directory. The default value is '<build dir>/%2'.\n" + "\tIf the directory does not exist, it will be created. Use the special value " + "'%3' to install into the sysroot (i.e. the value of the property " + "qbs.sysroot).\n") + .arg(longRepresentation(), InstallOptions::defaultInstallRoot(), magicSysrootString()); } QString InstallRootOption::longRepresentation() const @@ -358,7 +365,11 @@ void InstallRootOption::doParse(const QString &representation, QStringList &inpu throw Error(Tr::tr("Invalid use of option '%1: Argument expected.\n" "Usage: %2").arg(representation, description(command()))); } - m_installRoot = input.takeFirst(); + const QString installRoot = input.takeFirst(); + if (installRoot == magicSysrootString()) + m_useSysroot = true; + else + m_installRoot = installRoot; } QString RemoveFirstOption::description(CommandType command) const diff --git a/src/app/qbs/parser/commandlineoption.h b/src/app/qbs/parser/commandlineoption.h index d298ba79b..be03301a8 100644 --- a/src/app/qbs/parser/commandlineoption.h +++ b/src/app/qbs/parser/commandlineoption.h @@ -225,7 +225,10 @@ private: class InstallRootOption : public CommandLineOption { public: + InstallRootOption(); + QString installRoot() const { return m_installRoot; } + bool useSysroot() const { return m_useSysroot; } QString description(CommandType command) const; QString shortRepresentation() const { return QString(); } @@ -235,6 +238,7 @@ private: void doParse(const QString &representation, QStringList &input); QString m_installRoot; + bool m_useSysroot; }; class RemoveFirstOption : public OnOffOption diff --git a/src/app/qbs/parser/commandlineparser.cpp b/src/app/qbs/parser/commandlineparser.cpp index cea0c8587..eb0bbe945 100644 --- a/src/app/qbs/parser/commandlineparser.cpp +++ b/src/app/qbs/parser/commandlineparser.cpp @@ -152,6 +152,7 @@ InstallOptions CommandLineParser::installOptions() const InstallOptions options; options.setRemoveExistingInstallation(d->optionPool.removeFirstoption()->enabled()); options.setInstallRoot(d->optionPool.installRootOption()->installRoot()); + options.setInstallIntoSysroot(d->optionPool.installRootOption()->useSysroot()); if (!options.installRoot().isEmpty()) { QFileInfo fi(options.installRoot()); if (!fi.isAbsolute()) |