Commit f539ff1f authored by Tobias Hunger's avatar Tobias Hunger

CMake: Document all arguments passed to cmake

Do not leave out -Csomething (set by the kit) or the generator used
(set by the wizard).

Change-Id: I41cfb935da2877deaa26ae84bfdd96948fa20763
Reviewed-by: default avatarNiels Weber <niels.weber@theqtcompany.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent d144ea58
......@@ -544,15 +544,17 @@ void CMakeRunPage::runCMake()
QString arguments = m_argumentsLineEdit->text();
m_output->appendPlainText(tr("Running: '%1' with arguments '%2' in '%3'.\n")
.arg(cmake->cmakeExecutable().toUserOutput())
.arg(arguments)
.arg(QDir::toNativeSeparators(m_buildDirectory)));
Utils::QtcProcess::addArg(&arguments, QString::fromLatin1(generatorInfo.generatorArgument()));
const QString preloadCache = generatorInfo.preLoadCacheFileArgument();
if (!preloadCache.isEmpty())
Utils::QtcProcess::addArg(&arguments, preloadCache);
m_output->appendHtml(tr("<b>Running: '%1' with arguments '%2' in '%3'.</b><br>")
.arg(cmake->cmakeExecutable().toUserOutput())
.arg(arguments)
.arg(QDir::toNativeSeparators(m_buildDirectory)));
CMakeManager::createXmlFile(m_cmakeProcess, cmake->cmakeExecutable().toString(),
arguments, m_cmakeWizard->sourceDirectory(),
m_buildDirectory, env,
QString::fromLatin1(generatorInfo.generatorArgument()),
generatorInfo.preLoadCacheFileArgument());
m_buildDirectory, env);
} else {
m_runCMake->setEnabled(true);
m_argumentsLineEdit->setEnabled(true);
......
......@@ -147,8 +147,7 @@ bool CMakeManager::preferNinja()
// sounds like a plan
void CMakeManager::createXmlFile(Utils::QtcProcess *proc, const QString &executable,
const QString &arguments, const QString &sourceDirectory,
const QDir &buildDirectory, const Utils::Environment &env,
const QString &generator, const QString &preloadCache)
const QDir &buildDirectory, const Utils::Environment &env)
{
QString buildDirectoryPath = buildDirectory.absolutePath();
buildDirectory.mkpath(buildDirectoryPath);
......@@ -160,9 +159,7 @@ void CMakeManager::createXmlFile(Utils::QtcProcess *proc, const QString &executa
QString args;
Utils::QtcProcess::addArg(&args, srcdir);
Utils::QtcProcess::addArgs(&args, arguments);
Utils::QtcProcess::addArg(&args, generator);
if (!preloadCache.isEmpty())
Utils::QtcProcess::addArg(&args, preloadCache);
proc->setCommand(executable, args);
proc->start();
}
......
......@@ -60,8 +60,7 @@ public:
static void createXmlFile(Utils::QtcProcess *process, const QString &executable,
const QString &arguments, const QString &sourceDirectory,
const QDir &buildDirectory, const Utils::Environment &env,
const QString &generator, const QString &preloadCache);
const QDir &buildDirectory, const Utils::Environment &env);
static bool preferNinja();
static QString findCbpFile(const QDir &);
......
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