forked from qt-creator/qt-creator
Appman: Initial CMake integration
* Detection of packages created using CMake API * Run target for all detected packages * Special CMake package step for installable packages * Run/Debug of builtin apps * Package/Install/Run/Debug of installable packages * Works locally and with Remote Linux Change-Id: Ic297ba04f20caf0a5383ed016d759e654864a065 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
// Copyright (C) 2019 Luxoft Sweden AB
|
||||
// Copyright (C) 2018 Pelagicore AG
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "appmanagercmakepackagestep.h"
|
||||
|
||||
#include "appmanagerconstants.h"
|
||||
#include "appmanagertargetinformation.h"
|
||||
|
||||
#include <projectexplorer/processparameters.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <cmakeprojectmanager/cmakeprojectconstants.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace CMakeProjectManager;
|
||||
using namespace Utils;
|
||||
|
||||
namespace AppManager {
|
||||
namespace Internal {
|
||||
|
||||
AppManagerCMakePackageStepFactory::AppManagerCMakePackageStepFactory()
|
||||
{
|
||||
cloneStepCreator(CMakeProjectManager::Constants::CMAKE_BUILD_STEP_ID, Constants::CMAKE_PACKAGE_STEP_ID);
|
||||
setExtraInit([] (BuildStep *step) {
|
||||
// We update the build targets when the active run configuration changes
|
||||
const auto updaterSlot = [step] {
|
||||
const auto targetInformation = TargetInformation(step->target());
|
||||
step->setBuildTargets({targetInformation.cmakeBuildTarget});
|
||||
step->setEnabled(!targetInformation.isBuiltin);
|
||||
};
|
||||
QObject::connect(step->target(), &Target::activeRunConfigurationChanged, step, updaterSlot);
|
||||
QObject::connect(step->target(), &Target::activeDeployConfigurationChanged, step, updaterSlot);
|
||||
QObject::connect(step->target(), &Target::parsingFinished, step, updaterSlot);
|
||||
QObject::connect(step->target(), &Target::runConfigurationsUpdated, step, updaterSlot);
|
||||
QObject::connect(step->project(), &Project::displayNameChanged, step, updaterSlot);
|
||||
});
|
||||
|
||||
setDisplayName(tr("Create Appman package with CMake"));
|
||||
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace AppManager
|
||||
Reference in New Issue
Block a user