ProjectExplorer: Use function object for special build config init

Change-Id: I5da0f28ee1a64f8d9a3145f059019be702bee463
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-12-09 12:59:38 +01:00
parent b82add7813
commit 041a86c8c7
18 changed files with 269 additions and 282 deletions

View File

@@ -53,26 +53,25 @@ AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent, Core::I
setBuildDirectory(Utils::FilePath::fromString("/<foobar>"));
setBuildDirectoryHistoryCompleter("AutoTools.BuildDir.History");
setConfigWidgetDisplayName(tr("Autotools Manager"));
}
void AutotoolsBuildConfiguration::initialize()
{
// ### Build Steps Build ###
// autogen.sh or autoreconf
QFile autogenFile(target()->project()->projectDirectory().toString() + "/autogen.sh");
if (autogenFile.exists())
buildSteps()->appendStep(Constants::AUTOGEN_STEP_ID);
else
buildSteps()->appendStep(Constants::AUTORECONF_STEP_ID);
setInitializer([this] {
// ### Build Steps Build ###
// autogen.sh or autoreconf
QFile autogenFile(target()->project()->projectDirectory().toString() + "/autogen.sh");
if (autogenFile.exists())
buildSteps()->appendStep(Constants::AUTOGEN_STEP_ID);
else
buildSteps()->appendStep(Constants::AUTORECONF_STEP_ID);
// ./configure.
buildSteps()->appendStep(Constants::CONFIGURE_STEP_ID);
// ./configure.
buildSteps()->appendStep(Constants::CONFIGURE_STEP_ID);
// make
buildSteps()->appendStep(Constants::MAKE_STEP_ID);
// make
buildSteps()->appendStep(Constants::MAKE_STEP_ID);
// ### Build Steps Clean ###
cleanSteps()->appendStep(Constants::MAKE_STEP_ID);
// ### Build Steps Clean ###
cleanSteps()->appendStep(Constants::MAKE_STEP_ID);
});
}