forked from qt-creator/qt-creator
Fix a race in CMakeProjectManager::createXml
This commit is contained in:
@@ -99,7 +99,7 @@ bool CMakeManager::hasCodeBlocksMsvcGenerator() const
|
||||
// we probably want the process instead of this function
|
||||
// cmakeproject then could even run the cmake process in the background, adding the files afterwards
|
||||
// sounds like a plan
|
||||
QProcess *CMakeManager::createXmlFile(const QStringList &arguments, const QString &sourceDirectory, const QDir &buildDirectory, const ProjectExplorer::Environment &env, const QString &generator)
|
||||
void CMakeManager::createXmlFile(QProcess *proc, const QStringList &arguments, const QString &sourceDirectory, const QDir &buildDirectory, const ProjectExplorer::Environment &env, const QString &generator)
|
||||
{
|
||||
// We create a cbp file, only if we didn't find a cbp file in the base directory
|
||||
// Yet that can still override cbp files in subdirectories
|
||||
@@ -111,14 +111,12 @@ QProcess *CMakeManager::createXmlFile(const QStringList &arguments, const QStrin
|
||||
// TODO we need to pass on the same paremeters as the cmakestep
|
||||
QString buildDirectoryPath = buildDirectory.absolutePath();
|
||||
buildDirectory.mkpath(buildDirectoryPath);
|
||||
QProcess *cmake = new QProcess;
|
||||
cmake->setWorkingDirectory(buildDirectoryPath);
|
||||
cmake->setProcessChannelMode(QProcess::MergedChannels);
|
||||
cmake->setEnvironment(env.toStringList());
|
||||
proc->setWorkingDirectory(buildDirectoryPath);
|
||||
proc->setProcessChannelMode(QProcess::MergedChannels);
|
||||
proc->setEnvironment(env.toStringList());
|
||||
|
||||
const QString srcdir = buildDirectory.exists(QLatin1String("CMakeCache.txt")) ? QString(QLatin1Char('.')) : sourceDirectory;
|
||||
cmake->start(cmakeExecutable(), QStringList() << srcdir << arguments << generator);
|
||||
return cmake;
|
||||
proc->start(cmakeExecutable(), QStringList() << srcdir << arguments << generator);
|
||||
}
|
||||
|
||||
QString CMakeManager::findCbpFile(const QDir &directory)
|
||||
|
||||
Reference in New Issue
Block a user