forked from qt-creator/qt-creator
CMake: Use new ExecutableAspect
Change-Id: Ic880351802c52b61c53c6730d23dfe3f124ebc44 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
#include "cmakekitinformation.h"
|
||||
#include "cmakeprojectconstants.h"
|
||||
#include "cmakeprojectnodes.h"
|
||||
#include "cmakerunconfiguration.h"
|
||||
#include "cmakeprojectmanager.h"
|
||||
|
||||
#include <coreplugin/progressmanager/progressmanager.h>
|
||||
@@ -48,7 +47,6 @@
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
#include <texteditor/textdocument.h>
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
@@ -279,7 +277,7 @@ void CMakeProject::updateProjectData(CMakeBuildConfiguration *bc)
|
||||
}
|
||||
|
||||
updateApplicationAndDeploymentTargets();
|
||||
updateTargetRunConfigurations(t);
|
||||
t->updateDefaultRunConfigurations();
|
||||
|
||||
createGeneratedCodeModelSupport();
|
||||
|
||||
@@ -590,34 +588,6 @@ QStringList CMakeProject::filesGeneratedFrom(const QString &sourceFile) const
|
||||
}
|
||||
}
|
||||
|
||||
void CMakeProject::updateTargetRunConfigurations(Target *t)
|
||||
{
|
||||
// *Update* existing runconfigurations (no need to update new ones!):
|
||||
QHash<QString, const CMakeBuildTarget *> buildTargetHash;
|
||||
const QList<CMakeBuildTarget> buildTargetList = buildTargets();
|
||||
foreach (const CMakeBuildTarget &bt, buildTargetList) {
|
||||
if (bt.targetType != ExecutableType || bt.executable.isEmpty())
|
||||
continue;
|
||||
|
||||
buildTargetHash.insert(bt.title, &bt);
|
||||
}
|
||||
|
||||
foreach (RunConfiguration *rc, t->runConfigurations()) {
|
||||
auto cmakeRc = qobject_cast<CMakeRunConfiguration *>(rc);
|
||||
if (!cmakeRc)
|
||||
continue;
|
||||
|
||||
auto btIt = buildTargetHash.constFind(cmakeRc->title());
|
||||
if (btIt != buildTargetHash.constEnd()) {
|
||||
cmakeRc->setExecutable(btIt.value()->executable.toString());
|
||||
cmakeRc->setBaseWorkingDirectory(btIt.value()->workingDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
// create new and remove obsolete RCs using the factories
|
||||
t->updateDefaultRunConfigurations();
|
||||
}
|
||||
|
||||
void CMakeProject::updateApplicationAndDeploymentTargets()
|
||||
{
|
||||
Target *t = activeTarget();
|
||||
|
||||
Reference in New Issue
Block a user