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