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/parser/commandlineoption.cpp | |
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/parser/commandlineoption.cpp')
-rw-r--r-- | src/app/qbs/parser/commandlineoption.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
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 |