2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2009-11-23 12:11:48 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2009-11-23 12:11:48 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2009-11-23 12:11:48 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2009-11-23 12:11:48 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2009-11-23 12:11:48 +01:00
|
|
|
|
|
|
|
|
#include "cmakebuildconfiguration.h"
|
2010-01-07 18:17:24 +01:00
|
|
|
|
2016-02-24 18:00:24 +01:00
|
|
|
#include "builddirmanager.h"
|
2016-01-07 12:33:52 +01:00
|
|
|
#include "cmakebuildstep.h"
|
2019-01-29 16:51:17 +01:00
|
|
|
#include "cmakeconfigitem.h"
|
2016-02-03 13:52:50 +01:00
|
|
|
#include "cmakekitinformation.h"
|
2012-10-02 17:46:19 +02:00
|
|
|
#include "cmakeprojectconstants.h"
|
2015-03-10 10:22:38 +01:00
|
|
|
#include "cmakebuildsettingswidget.h"
|
2010-01-07 18:17:24 +01:00
|
|
|
|
2019-03-06 14:17:17 +02:00
|
|
|
#include <android/androidconstants.h>
|
|
|
|
|
|
2013-07-22 15:53:57 +02:00
|
|
|
#include <coreplugin/icore.h>
|
2014-10-22 09:16:55 +02:00
|
|
|
|
2019-01-29 16:51:17 +01:00
|
|
|
#include <projectexplorer/buildinfo.h>
|
2016-11-14 15:18:25 +01:00
|
|
|
#include <projectexplorer/buildmanager.h>
|
2010-07-16 14:00:41 +02:00
|
|
|
#include <projectexplorer/buildsteplist.h>
|
2013-04-10 12:02:06 +02:00
|
|
|
#include <projectexplorer/kit.h>
|
2019-01-07 12:15:40 +01:00
|
|
|
#include <projectexplorer/kitinformation.h>
|
2016-11-14 15:18:25 +01:00
|
|
|
#include <projectexplorer/projectexplorer.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
2014-10-22 09:16:55 +02:00
|
|
|
#include <projectexplorer/projectmacroexpander.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <projectexplorer/target.h>
|
2010-01-07 18:17:24 +01:00
|
|
|
|
2019-10-18 09:25:14 +03:00
|
|
|
#include <qtsupport/baseqtversion.h>
|
2019-08-07 10:10:01 +02:00
|
|
|
#include <qtsupport/qtkitinformation.h>
|
|
|
|
|
|
2016-02-03 13:52:50 +01:00
|
|
|
#include <utils/algorithm.h>
|
2015-02-04 09:32:46 +01:00
|
|
|
#include <utils/mimetypes/mimedatabase.h>
|
2013-07-22 15:53:57 +02:00
|
|
|
#include <utils/qtcassert.h>
|
2016-02-03 13:52:50 +01:00
|
|
|
#include <utils/qtcprocess.h>
|
2013-07-22 15:53:57 +02:00
|
|
|
|
2019-08-09 12:20:49 +02:00
|
|
|
#include <QLoggingCategory>
|
|
|
|
|
|
2014-10-22 09:16:55 +02:00
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
using namespace Utils;
|
|
|
|
|
|
2019-01-29 16:51:17 +01:00
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
|
|
|
|
|
class CMakeExtraBuildInfo
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
QString sourceDirectory;
|
|
|
|
|
CMakeConfig configuration;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace CMakeProjectManager
|
|
|
|
|
|
|
|
|
|
Q_DECLARE_METATYPE(CMakeProjectManager::CMakeExtraBuildInfo)
|
|
|
|
|
|
|
|
|
|
|
2014-10-22 09:16:55 +02:00
|
|
|
namespace CMakeProjectManager {
|
|
|
|
|
namespace Internal {
|
2009-11-23 13:29:45 +01:00
|
|
|
|
2019-08-09 12:20:49 +02:00
|
|
|
Q_LOGGING_CATEGORY(cmakeBuildConfigurationLog, "qtc.cmake.bc", QtWarningMsg);
|
|
|
|
|
|
2016-02-03 13:52:50 +01:00
|
|
|
const char CONFIGURATION_KEY[] = "CMake.Configuration";
|
2014-10-22 09:16:55 +02:00
|
|
|
|
2019-12-09 12:59:38 +01:00
|
|
|
CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Core::Id id)
|
|
|
|
|
: BuildConfiguration(target, id)
|
2009-11-23 12:11:48 +01:00
|
|
|
{
|
2019-10-25 09:55:32 +02:00
|
|
|
m_buildSystem = new CMakeBuildSystem(this);
|
2019-08-05 15:56:03 +02:00
|
|
|
setBuildDirectory(shadowBuildDirectory(project()->projectFilePath(),
|
2019-12-09 12:59:38 +01:00
|
|
|
target->kit(),
|
2019-08-05 15:56:03 +02:00
|
|
|
displayName(),
|
|
|
|
|
BuildConfiguration::Unknown));
|
|
|
|
|
|
2019-12-06 17:32:07 +01:00
|
|
|
setInitializer([this, target](const BuildInfo &info) {
|
|
|
|
|
|
2019-12-09 12:59:38 +01:00
|
|
|
buildSteps()->appendStep(Constants::CMAKE_BUILD_STEP_ID);
|
|
|
|
|
|
|
|
|
|
if (DeviceTypeKitAspect::deviceTypeId(target->kit())
|
|
|
|
|
== Android::Constants::ANDROID_DEVICE_TYPE) {
|
|
|
|
|
buildSteps()->appendStep(Android::Constants::ANDROID_BUILD_APK_ID);
|
|
|
|
|
const auto &bs = buildSteps()->steps().constLast();
|
|
|
|
|
m_initialConfiguration.prepend(CMakeProjectManager::CMakeConfigItem{"ANDROID_NATIVE_API_LEVEL",
|
|
|
|
|
CMakeProjectManager::CMakeConfigItem::Type::STRING,
|
|
|
|
|
"Android native API level",
|
|
|
|
|
bs->data(Android::Constants::AndroidNdkPlatform).toString().toUtf8()});
|
|
|
|
|
auto ndkLocation = bs->data(Android::Constants::NdkLocation).value<FilePath>();
|
|
|
|
|
m_initialConfiguration.prepend(CMakeProjectManager::CMakeConfigItem{"ANDROID_NDK",
|
|
|
|
|
CMakeProjectManager::CMakeConfigItem::Type::PATH,
|
|
|
|
|
"Android NDK PATH",
|
|
|
|
|
ndkLocation.toString().toUtf8()});
|
ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup
This follow the rough pattern of recent *RunConfigurationFactory changes
for build and deploy configurations.
- Collapse the two lines of constructors similar to what
890c1906e6fb2ec did for RunConfigurations
* Deploy* was purely mechanical
* Build* ctors are split in connects() in the ctor body
to create "empty shell for clone" etc
and build step additions in initialize() functions which
are only used in the create() case.
-- Allows to collapse the shared 'ctor()' functions, too.
- Move FooBuildConfigurationFactory::create() implementations
to FooBuildConfiguration() constructor. That was a strange
and unneeded ping-pong between factories and objects, and
furthermore allows one level less of indirection (and for a
later, left out here, some reduction of the
FooBuildConfiguration interfaces that were only used to
accommodate the *Factory::create() functions.
- Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(),
but there wasn't one in the base classses. Have one there.
- Most canHandle() functions were checking simple restrictions on
e.g. project or target types, specify those by setters in the
constructors instead and check them in the base canHandle()
- clone() is generally replaced by a creation of a "shell object"
and a fromMap(source->toMap()), implemented in the base, there
are two cases left for Android and Qbs that needed(?) some extra
polish
- generally use canHandle() in base implementation, instead
of doing that in all Derived::canFoo()
- as a result, canCreate/create/canClone/clone reimplementations
are not needed anymore, keep the base implementation for
now (could be inlined into their only users later), but
de-virtualize them.
- Combine Ios{Preset,DSym}BuildStepFactory. There was only one
'dsym' build step they could create.
- Split the 'mangled' id into the ProjectConfiguration subtype
specific constant identifier, and a QString extraId() bit.
Only maintain the mangled id in saved settings.
- Make ProjectConfiguration::m_id a constant member, adapt
all constructors of derived classe.
Not done in this patch:
- Finish possible cosmetic changes on top
- Add a way to specify restrictions to supported Qt versions
(used in Android/Ios), as the base implementation does not
depend on the qtsupport plugin
- Combine the QList<X> availableFoo() + createFoo(X) function
pairs to somthing like a direct
QList<struct { X; std::function<X()>; }> fooCreators()
to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base)
pingpong
- Remove the *Factories from the global object pool
- Do something about priority(). Falling back to plain
qmake in android+qmake setup is not helpful.
Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-29 12:28:40 +01:00
|
|
|
|
2019-12-09 12:59:38 +01:00
|
|
|
m_initialConfiguration.prepend(CMakeProjectManager::CMakeConfigItem{"CMAKE_TOOLCHAIN_FILE",
|
2019-10-18 09:25:14 +03:00
|
|
|
CMakeProjectManager::CMakeConfigItem::Type::PATH,
|
2019-12-09 12:59:38 +01:00
|
|
|
"Android CMake toolchain file",
|
|
|
|
|
ndkLocation.pathAppended("build/cmake/android.toolchain.cmake").toString().toUtf8()});
|
|
|
|
|
|
|
|
|
|
auto androidAbis = bs->data(Android::Constants::AndroidABIs).toStringList();
|
|
|
|
|
QString preferredAbi;
|
|
|
|
|
if (androidAbis.contains("armeabi-v7a")) {
|
|
|
|
|
preferredAbi = "armeabi-v7a";
|
|
|
|
|
} else if (androidAbis.isEmpty() || androidAbis.contains("arm64-v8a")) {
|
|
|
|
|
preferredAbi = "arm64-v8a";
|
|
|
|
|
} else {
|
|
|
|
|
preferredAbi = androidAbis.first();
|
|
|
|
|
}
|
|
|
|
|
// FIXME: configmodel doesn't care about our androidAbis list...
|
|
|
|
|
m_initialConfiguration.prepend(CMakeProjectManager::CMakeConfigItem{"ANDROID_ABI",
|
|
|
|
|
CMakeProjectManager::CMakeConfigItem::Type::STRING,
|
|
|
|
|
"Android ABI",
|
|
|
|
|
preferredAbi.toLatin1(),
|
|
|
|
|
androidAbis});
|
|
|
|
|
|
|
|
|
|
QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(target->kit());
|
|
|
|
|
if (qt->qtVersion() >= QtSupport::QtVersionNumber{5, 14, 0}) {
|
|
|
|
|
auto sdkLocation = bs->data(Android::Constants::SdkLocation).value<FilePath>();
|
|
|
|
|
m_initialConfiguration.prepend(CMakeProjectManager::CMakeConfigItem{"ANDROID_SDK",
|
|
|
|
|
CMakeProjectManager::CMakeConfigItem::Type::PATH,
|
|
|
|
|
"Android SDK PATH",
|
|
|
|
|
sdkLocation.toString().toUtf8()});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_initialConfiguration.prepend(CMakeProjectManager::CMakeConfigItem{"ANDROID_STL",
|
|
|
|
|
CMakeProjectManager::CMakeConfigItem::Type::STRING,
|
|
|
|
|
"Android STL",
|
|
|
|
|
"c++_shared"});
|
|
|
|
|
|
|
|
|
|
m_initialConfiguration.prepend(CMakeProjectManager::CMakeConfigItem{"CMAKE_FIND_ROOT_PATH", "%{Qt:QT_INSTALL_PREFIX}"});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cleanSteps()->appendStep(Constants::CMAKE_BUILD_STEP_ID);
|
2019-10-18 09:25:14 +03:00
|
|
|
|
2019-12-06 17:32:07 +01:00
|
|
|
if (info.buildDirectory.isEmpty()) {
|
2019-12-09 12:59:38 +01:00
|
|
|
setBuildDirectory(shadowBuildDirectory(target->project()->projectFilePath(),
|
|
|
|
|
target->kit(),
|
2019-12-06 17:32:07 +01:00
|
|
|
info.displayName,
|
|
|
|
|
info.buildType));
|
2019-10-18 09:25:14 +03:00
|
|
|
}
|
2019-12-06 17:32:07 +01:00
|
|
|
auto cinfo = info.extraInfo.value<CMakeExtraBuildInfo>();
|
|
|
|
|
setConfigurationForCMake(cinfo.configuration);
|
2019-12-09 12:59:38 +01:00
|
|
|
});
|
|
|
|
|
}
|
2019-10-18 09:25:14 +03:00
|
|
|
|
2019-12-09 12:59:38 +01:00
|
|
|
CMakeBuildConfiguration::~CMakeBuildConfiguration()
|
|
|
|
|
{
|
|
|
|
|
delete m_buildSystem;
|
2016-02-24 18:00:24 +01:00
|
|
|
}
|
|
|
|
|
|
2019-12-09 12:59:38 +01:00
|
|
|
|
2016-02-11 16:33:15 +01:00
|
|
|
QString CMakeBuildConfiguration::disabledReason() const
|
|
|
|
|
{
|
|
|
|
|
return error();
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-18 12:11:04 +01:00
|
|
|
QVariantMap CMakeBuildConfiguration::toMap() const
|
2009-12-08 12:21:11 +01:00
|
|
|
{
|
2010-01-18 12:11:04 +01:00
|
|
|
QVariantMap map(ProjectExplorer::BuildConfiguration::toMap());
|
2016-02-03 13:52:50 +01:00
|
|
|
const QStringList config
|
2017-09-28 11:32:39 +02:00
|
|
|
= Utils::transform(m_configurationForCMake, [](const CMakeConfigItem &i) { return i.toString(); });
|
2016-02-03 13:52:50 +01:00
|
|
|
map.insert(QLatin1String(CONFIGURATION_KEY), config);
|
2010-01-18 12:11:04 +01:00
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CMakeBuildConfiguration::fromMap(const QVariantMap &map)
|
|
|
|
|
{
|
2010-09-22 15:14:07 +02:00
|
|
|
if (!BuildConfiguration::fromMap(map))
|
|
|
|
|
return false;
|
|
|
|
|
|
2016-02-03 13:52:50 +01:00
|
|
|
const CMakeConfig conf
|
2016-04-08 14:11:57 +02:00
|
|
|
= Utils::filtered(Utils::transform(map.value(QLatin1String(CONFIGURATION_KEY)).toStringList(),
|
|
|
|
|
[](const QString &v) { return CMakeConfigItem::fromString(v); }),
|
|
|
|
|
[](const CMakeConfigItem &c) { return !c.isNull(); });
|
2016-02-03 13:52:50 +01:00
|
|
|
|
2019-08-06 09:28:56 +02:00
|
|
|
setConfigurationForCMake(conf);
|
2010-01-18 12:11:04 +01:00
|
|
|
|
2010-09-22 15:14:07 +02:00
|
|
|
return true;
|
2009-11-23 12:11:48 +01:00
|
|
|
}
|
2009-11-23 13:29:45 +01:00
|
|
|
|
2018-12-20 18:51:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-10-10 10:22:06 +02:00
|
|
|
|
2019-03-06 14:17:17 +02:00
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
FilePath CMakeBuildConfiguration::shadowBuildDirectory(const FilePath &projectFilePath,
|
2016-03-01 14:12:35 +01:00
|
|
|
const Kit *k,
|
|
|
|
|
const QString &bcName,
|
|
|
|
|
BuildConfiguration::BuildType buildType)
|
|
|
|
|
{
|
|
|
|
|
if (projectFilePath.isEmpty())
|
2019-05-28 13:49:26 +02:00
|
|
|
return FilePath();
|
2016-03-01 14:12:35 +01:00
|
|
|
|
|
|
|
|
const QString projectName = projectFilePath.parentDir().fileName();
|
2019-06-26 17:09:35 +02:00
|
|
|
ProjectMacroExpander expander(projectFilePath, projectName, k, bcName, buildType);
|
2016-03-01 14:12:35 +01:00
|
|
|
QDir projectDir = QDir(Project::projectDirectory(projectFilePath).toString());
|
2018-10-05 15:04:25 +02:00
|
|
|
QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
2018-10-23 16:44:34 +02:00
|
|
|
buildPath.replace(" ", "-");
|
2019-05-28 13:49:26 +02:00
|
|
|
return FilePath::fromUserInput(projectDir.absoluteFilePath(buildPath));
|
2016-03-01 14:12:35 +01:00
|
|
|
}
|
|
|
|
|
|
2016-11-14 15:18:25 +01:00
|
|
|
void CMakeBuildConfiguration::buildTarget(const QString &buildTarget)
|
|
|
|
|
{
|
2018-11-04 23:09:41 +01:00
|
|
|
auto cmBs = qobject_cast<CMakeBuildStep *>(Utils::findOrDefault(
|
2019-12-05 16:19:42 +01:00
|
|
|
buildSteps()->steps(),
|
2018-11-04 23:09:41 +01:00
|
|
|
[](const ProjectExplorer::BuildStep *bs) {
|
2016-11-14 15:18:25 +01:00
|
|
|
return bs->id() == Constants::CMAKE_BUILD_STEP_ID;
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
QString originalBuildTarget;
|
|
|
|
|
if (cmBs) {
|
|
|
|
|
originalBuildTarget = cmBs->buildTarget();
|
|
|
|
|
cmBs->setBuildTarget(buildTarget);
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-05 16:19:42 +01:00
|
|
|
BuildManager::buildList(buildSteps());
|
2016-11-14 15:18:25 +01:00
|
|
|
|
|
|
|
|
if (cmBs)
|
|
|
|
|
cmBs->setBuildTarget(originalBuildTarget);
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-28 11:32:39 +02:00
|
|
|
CMakeConfig CMakeBuildConfiguration::configurationFromCMake() const
|
2016-02-24 18:00:24 +01:00
|
|
|
{
|
2017-09-28 11:32:39 +02:00
|
|
|
return m_configurationFromCMake;
|
|
|
|
|
}
|
2016-02-24 18:00:24 +01:00
|
|
|
|
2017-09-28 11:32:39 +02:00
|
|
|
void CMakeBuildConfiguration::setConfigurationFromCMake(const CMakeConfig &config)
|
|
|
|
|
{
|
|
|
|
|
m_configurationFromCMake = config;
|
2016-02-24 18:00:24 +01:00
|
|
|
}
|
|
|
|
|
|
2017-09-28 11:32:39 +02:00
|
|
|
void CMakeBuildConfiguration::setConfigurationForCMake(const QList<ConfigModel::DataItem> &items)
|
|
|
|
|
{
|
2016-02-24 18:00:24 +01:00
|
|
|
const CMakeConfig newConfig = Utils::transform(items, [](const ConfigModel::DataItem &i) {
|
|
|
|
|
CMakeConfigItem ni;
|
|
|
|
|
ni.key = i.key.toUtf8();
|
|
|
|
|
ni.value = i.value.toUtf8();
|
|
|
|
|
ni.documentation = i.description.toUtf8();
|
|
|
|
|
ni.isAdvanced = i.isAdvanced;
|
2017-09-27 12:28:11 +02:00
|
|
|
ni.isUnset = i.isUnset;
|
2017-01-18 16:53:01 +01:00
|
|
|
ni.inCMakeCache = i.inCMakeCache;
|
2016-10-10 09:49:46 +10:00
|
|
|
ni.values = i.values;
|
2016-02-24 18:00:24 +01:00
|
|
|
switch (i.type) {
|
|
|
|
|
case CMakeProjectManager::ConfigModel::DataItem::BOOLEAN:
|
|
|
|
|
ni.type = CMakeConfigItem::BOOL;
|
|
|
|
|
break;
|
|
|
|
|
case CMakeProjectManager::ConfigModel::DataItem::FILE:
|
|
|
|
|
ni.type = CMakeConfigItem::FILEPATH;
|
|
|
|
|
break;
|
|
|
|
|
case CMakeProjectManager::ConfigModel::DataItem::DIRECTORY:
|
|
|
|
|
ni.type = CMakeConfigItem::PATH;
|
|
|
|
|
break;
|
|
|
|
|
case CMakeProjectManager::ConfigModel::DataItem::STRING:
|
|
|
|
|
ni.type = CMakeConfigItem::STRING;
|
|
|
|
|
break;
|
|
|
|
|
case CMakeProjectManager::ConfigModel::DataItem::UNKNOWN:
|
|
|
|
|
default:
|
|
|
|
|
ni.type = CMakeConfigItem::INTERNAL;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return ni;
|
|
|
|
|
});
|
|
|
|
|
|
2017-09-28 11:32:39 +02:00
|
|
|
const CMakeConfig config = configurationForCMake() + newConfig;
|
|
|
|
|
setConfigurationForCMake(config);
|
2019-10-18 09:25:14 +03:00
|
|
|
|
|
|
|
|
if (Utils::indexOf(newConfig, [](const CMakeConfigItem &item){
|
|
|
|
|
return item.key.startsWith("ANDROID_BUILD_ABI_");
|
|
|
|
|
}) != -1) {
|
|
|
|
|
// We always need to clean when we change the ANDROID_BUILD_ABI_ variables
|
|
|
|
|
QList<ProjectExplorer::BuildStepList *> stepLists;
|
|
|
|
|
const Core::Id clean = ProjectExplorer::Constants::BUILDSTEPS_CLEAN;
|
2019-12-05 16:19:42 +01:00
|
|
|
stepLists << cleanSteps();
|
2019-10-18 09:25:14 +03:00
|
|
|
BuildManager::buildLists(stepLists, QStringList() << ProjectExplorerPlugin::displayNameForStepId(clean));
|
|
|
|
|
}
|
2016-02-24 18:00:24 +01:00
|
|
|
}
|
|
|
|
|
|
2017-04-07 11:15:26 +02:00
|
|
|
void CMakeBuildConfiguration::clearError(ForceEnabledChanged fec)
|
2017-03-01 12:52:24 +01:00
|
|
|
{
|
|
|
|
|
if (!m_error.isEmpty()) {
|
|
|
|
|
m_error.clear();
|
2017-04-07 11:15:26 +02:00
|
|
|
fec = ForceEnabledChanged::True;
|
2017-03-01 12:52:24 +01:00
|
|
|
}
|
2019-10-08 12:53:23 +02:00
|
|
|
if (fec == ForceEnabledChanged::True) {
|
|
|
|
|
qCDebug(cmakeBuildConfigurationLog) << "Emitting enabledChanged signal";
|
2017-04-07 11:15:26 +02:00
|
|
|
emit enabledChanged();
|
2019-10-08 12:53:23 +02:00
|
|
|
}
|
2017-03-01 12:52:24 +01:00
|
|
|
}
|
|
|
|
|
|
2014-06-19 15:29:11 +02:00
|
|
|
void CMakeBuildConfiguration::emitBuildTypeChanged()
|
|
|
|
|
{
|
|
|
|
|
emit buildTypeChanged();
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-03 13:52:50 +01:00
|
|
|
static CMakeConfig removeDuplicates(const CMakeConfig &config)
|
|
|
|
|
{
|
|
|
|
|
CMakeConfig result;
|
|
|
|
|
// Remove duplicates (last value wins):
|
|
|
|
|
QSet<QByteArray> knownKeys;
|
|
|
|
|
for (int i = config.count() - 1; i >= 0; --i) {
|
|
|
|
|
const CMakeConfigItem &item = config.at(i);
|
|
|
|
|
if (knownKeys.contains(item.key))
|
|
|
|
|
continue;
|
|
|
|
|
result.append(item);
|
|
|
|
|
knownKeys.insert(item.key);
|
|
|
|
|
}
|
|
|
|
|
Utils::sort(result, CMakeConfigItem::sortOperator());
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-28 11:32:39 +02:00
|
|
|
void CMakeBuildConfiguration::setConfigurationForCMake(const CMakeConfig &config)
|
2015-09-10 16:17:38 +02:00
|
|
|
{
|
2019-03-06 14:17:17 +02:00
|
|
|
auto configs = removeDuplicates(config);
|
|
|
|
|
if (m_configurationForCMake.isEmpty())
|
2019-10-18 09:25:14 +03:00
|
|
|
m_configurationForCMake = removeDuplicates(m_initialConfiguration +
|
|
|
|
|
CMakeConfigurationKitAspect::configuration(target()->kit()) + configs);
|
2019-03-06 14:17:17 +02:00
|
|
|
else
|
|
|
|
|
m_configurationForCMake = configs;
|
2016-05-12 17:23:03 +02:00
|
|
|
|
|
|
|
|
const Kit *k = target()->kit();
|
2019-02-06 12:50:51 +01:00
|
|
|
CMakeConfig kitConfig = CMakeConfigurationKitAspect::configuration(k);
|
2016-05-12 17:23:03 +02:00
|
|
|
bool hasKitOverride = false;
|
2017-09-28 11:32:39 +02:00
|
|
|
foreach (const CMakeConfigItem &i, m_configurationForCMake) {
|
2016-05-12 17:23:03 +02:00
|
|
|
const QString b = CMakeConfigItem::expandedValueOf(k, i.key, kitConfig);
|
2017-09-27 12:28:11 +02:00
|
|
|
if (!b.isNull() && (i.expandedValue(k) != b || i.isUnset)) {
|
2016-05-12 17:23:03 +02:00
|
|
|
hasKitOverride = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (hasKitOverride)
|
2016-06-21 16:28:04 +02:00
|
|
|
setWarning(tr("CMake configuration set by the kit was overridden in the project."));
|
2016-05-12 17:23:03 +02:00
|
|
|
else
|
|
|
|
|
setWarning(QString());
|
2017-09-28 11:32:39 +02:00
|
|
|
|
|
|
|
|
emit configurationForCMakeChanged();
|
2015-09-10 16:17:38 +02:00
|
|
|
}
|
|
|
|
|
|
2017-09-28 11:32:39 +02:00
|
|
|
CMakeConfig CMakeBuildConfiguration::configurationForCMake() const
|
2015-09-10 16:17:38 +02:00
|
|
|
{
|
2019-02-06 12:50:51 +01:00
|
|
|
return removeDuplicates(CMakeConfigurationKitAspect::configuration(target()->kit()) + m_configurationForCMake);
|
2015-09-10 16:17:38 +02:00
|
|
|
}
|
|
|
|
|
|
2016-02-11 16:33:15 +01:00
|
|
|
void CMakeBuildConfiguration::setError(const QString &message)
|
|
|
|
|
{
|
2019-10-08 12:53:23 +02:00
|
|
|
qCDebug(cmakeBuildConfigurationLog) << "Setting error to" << message;
|
|
|
|
|
QTC_ASSERT(!message.isEmpty(), return );
|
|
|
|
|
|
2017-07-18 16:48:02 +02:00
|
|
|
const QString oldMessage = m_error;
|
2017-03-01 12:52:24 +01:00
|
|
|
if (m_error != message)
|
2016-12-02 17:32:31 +01:00
|
|
|
m_error = message;
|
2019-10-08 12:53:23 +02:00
|
|
|
if (oldMessage.isEmpty() != !message.isEmpty()) {
|
|
|
|
|
qCDebug(cmakeBuildConfigurationLog) << "Emitting enabledChanged signal";
|
2017-03-01 12:52:24 +01:00
|
|
|
emit enabledChanged();
|
2019-10-08 12:53:23 +02:00
|
|
|
}
|
2016-02-11 16:33:15 +01:00
|
|
|
emit errorOccured(m_error);
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-12 17:23:03 +02:00
|
|
|
void CMakeBuildConfiguration::setWarning(const QString &message)
|
|
|
|
|
{
|
|
|
|
|
if (m_warning == message)
|
|
|
|
|
return;
|
|
|
|
|
m_warning = message;
|
|
|
|
|
emit warningOccured(m_warning);
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-05 16:35:07 +02:00
|
|
|
|
2016-02-11 16:33:15 +01:00
|
|
|
QString CMakeBuildConfiguration::error() const
|
|
|
|
|
{
|
|
|
|
|
return m_error;
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-12 17:23:03 +02:00
|
|
|
QString CMakeBuildConfiguration::warning() const
|
|
|
|
|
{
|
|
|
|
|
return m_warning;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-08 18:02:50 +01:00
|
|
|
ProjectExplorer::NamedWidget *CMakeBuildConfiguration::createConfigWidget()
|
2009-11-26 14:43:27 +01:00
|
|
|
{
|
2012-11-08 17:35:59 +01:00
|
|
|
return new CMakeBuildSettingsWidget(this);
|
2009-11-26 14:43:27 +01:00
|
|
|
}
|
|
|
|
|
|
2010-01-07 18:17:24 +01:00
|
|
|
/*!
|
|
|
|
|
\class CMakeBuildConfigurationFactory
|
|
|
|
|
*/
|
|
|
|
|
|
ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup
This follow the rough pattern of recent *RunConfigurationFactory changes
for build and deploy configurations.
- Collapse the two lines of constructors similar to what
890c1906e6fb2ec did for RunConfigurations
* Deploy* was purely mechanical
* Build* ctors are split in connects() in the ctor body
to create "empty shell for clone" etc
and build step additions in initialize() functions which
are only used in the create() case.
-- Allows to collapse the shared 'ctor()' functions, too.
- Move FooBuildConfigurationFactory::create() implementations
to FooBuildConfiguration() constructor. That was a strange
and unneeded ping-pong between factories and objects, and
furthermore allows one level less of indirection (and for a
later, left out here, some reduction of the
FooBuildConfiguration interfaces that were only used to
accommodate the *Factory::create() functions.
- Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(),
but there wasn't one in the base classses. Have one there.
- Most canHandle() functions were checking simple restrictions on
e.g. project or target types, specify those by setters in the
constructors instead and check them in the base canHandle()
- clone() is generally replaced by a creation of a "shell object"
and a fromMap(source->toMap()), implemented in the base, there
are two cases left for Android and Qbs that needed(?) some extra
polish
- generally use canHandle() in base implementation, instead
of doing that in all Derived::canFoo()
- as a result, canCreate/create/canClone/clone reimplementations
are not needed anymore, keep the base implementation for
now (could be inlined into their only users later), but
de-virtualize them.
- Combine Ios{Preset,DSym}BuildStepFactory. There was only one
'dsym' build step they could create.
- Split the 'mangled' id into the ProjectConfiguration subtype
specific constant identifier, and a QString extraId() bit.
Only maintain the mangled id in saved settings.
- Make ProjectConfiguration::m_id a constant member, adapt
all constructors of derived classe.
Not done in this patch:
- Finish possible cosmetic changes on top
- Add a way to specify restrictions to supported Qt versions
(used in Android/Ios), as the base implementation does not
depend on the qtsupport plugin
- Combine the QList<X> availableFoo() + createFoo(X) function
pairs to somthing like a direct
QList<struct { X; std::function<X()>; }> fooCreators()
to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base)
pingpong
- Remove the *Factories from the global object pool
- Do something about priority(). Falling back to plain
qmake in android+qmake setup is not helpful.
Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-29 12:28:40 +01:00
|
|
|
CMakeBuildConfigurationFactory::CMakeBuildConfigurationFactory()
|
|
|
|
|
{
|
2019-08-05 16:35:07 +02:00
|
|
|
registerBuildConfiguration<CMakeBuildConfiguration>(
|
|
|
|
|
"CMakeProjectManager.CMakeBuildConfiguration");
|
2018-05-04 16:52:21 +02:00
|
|
|
|
ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup
This follow the rough pattern of recent *RunConfigurationFactory changes
for build and deploy configurations.
- Collapse the two lines of constructors similar to what
890c1906e6fb2ec did for RunConfigurations
* Deploy* was purely mechanical
* Build* ctors are split in connects() in the ctor body
to create "empty shell for clone" etc
and build step additions in initialize() functions which
are only used in the create() case.
-- Allows to collapse the shared 'ctor()' functions, too.
- Move FooBuildConfigurationFactory::create() implementations
to FooBuildConfiguration() constructor. That was a strange
and unneeded ping-pong between factories and objects, and
furthermore allows one level less of indirection (and for a
later, left out here, some reduction of the
FooBuildConfiguration interfaces that were only used to
accommodate the *Factory::create() functions.
- Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(),
but there wasn't one in the base classses. Have one there.
- Most canHandle() functions were checking simple restrictions on
e.g. project or target types, specify those by setters in the
constructors instead and check them in the base canHandle()
- clone() is generally replaced by a creation of a "shell object"
and a fromMap(source->toMap()), implemented in the base, there
are two cases left for Android and Qbs that needed(?) some extra
polish
- generally use canHandle() in base implementation, instead
of doing that in all Derived::canFoo()
- as a result, canCreate/create/canClone/clone reimplementations
are not needed anymore, keep the base implementation for
now (could be inlined into their only users later), but
de-virtualize them.
- Combine Ios{Preset,DSym}BuildStepFactory. There was only one
'dsym' build step they could create.
- Split the 'mangled' id into the ProjectConfiguration subtype
specific constant identifier, and a QString extraId() bit.
Only maintain the mangled id in saved settings.
- Make ProjectConfiguration::m_id a constant member, adapt
all constructors of derived classe.
Not done in this patch:
- Finish possible cosmetic changes on top
- Add a way to specify restrictions to supported Qt versions
(used in Android/Ios), as the base implementation does not
depend on the qtsupport plugin
- Combine the QList<X> availableFoo() + createFoo(X) function
pairs to somthing like a direct
QList<struct { X; std::function<X()>; }> fooCreators()
to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base)
pingpong
- Remove the *Factories from the global object pool
- Do something about priority(). Falling back to plain
qmake in android+qmake setup is not helpful.
Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-29 12:28:40 +01:00
|
|
|
setSupportedProjectType(CMakeProjectManager::Constants::CMAKEPROJECT_ID);
|
|
|
|
|
setSupportedProjectMimeTypeName(Constants::CMAKEPROJECTMIMETYPE);
|
|
|
|
|
}
|
2010-01-07 18:17:24 +01:00
|
|
|
|
2019-08-05 16:35:07 +02:00
|
|
|
CMakeBuildConfigurationFactory::BuildType CMakeBuildConfigurationFactory::buildTypeFromByteArray(
|
|
|
|
|
const QByteArray &in)
|
2017-02-07 16:23:36 +01:00
|
|
|
{
|
|
|
|
|
const QByteArray bt = in.toLower();
|
|
|
|
|
if (bt == "debug")
|
|
|
|
|
return BuildTypeDebug;
|
|
|
|
|
if (bt == "release")
|
|
|
|
|
return BuildTypeRelease;
|
|
|
|
|
if (bt == "relwithdebinfo")
|
|
|
|
|
return BuildTypeRelWithDebInfo;
|
|
|
|
|
if (bt == "minsizerel")
|
|
|
|
|
return BuildTypeMinSizeRel;
|
|
|
|
|
return BuildTypeNone;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-05 16:35:07 +02:00
|
|
|
BuildConfiguration::BuildType CMakeBuildConfigurationFactory::cmakeBuildTypeToBuildType(
|
|
|
|
|
const CMakeBuildConfigurationFactory::BuildType &in)
|
2017-02-07 16:23:36 +01:00
|
|
|
{
|
|
|
|
|
// Cover all common CMake build types
|
|
|
|
|
if (in == BuildTypeRelease || in == BuildTypeMinSizeRel)
|
|
|
|
|
return BuildConfiguration::Release;
|
|
|
|
|
else if (in == BuildTypeDebug)
|
|
|
|
|
return BuildConfiguration::Debug;
|
|
|
|
|
else if (in == BuildTypeRelWithDebInfo)
|
|
|
|
|
return BuildConfiguration::Profile;
|
|
|
|
|
else
|
|
|
|
|
return BuildConfiguration::Unknown;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-05 16:35:07 +02:00
|
|
|
QList<BuildInfo> CMakeBuildConfigurationFactory::availableBuilds(const Kit *k,
|
|
|
|
|
const FilePath &projectPath,
|
|
|
|
|
bool forSetup) const
|
2010-01-07 18:17:24 +01:00
|
|
|
{
|
2019-01-29 16:51:17 +01:00
|
|
|
QList<BuildInfo> result;
|
2010-01-07 18:17:24 +01:00
|
|
|
|
2019-06-27 10:22:13 +02:00
|
|
|
FilePath path = forSetup ? Project::projectDirectory(projectPath) : projectPath;
|
2013-08-13 10:52:57 +02:00
|
|
|
|
2019-08-26 09:58:37 +02:00
|
|
|
for (int type = BuildTypeDebug; type != BuildTypeLast; ++type) {
|
2019-06-27 10:22:13 +02:00
|
|
|
BuildInfo info = createBuildInfo(k, path.toString(), BuildType(type));
|
|
|
|
|
if (forSetup) {
|
2019-08-05 16:35:07 +02:00
|
|
|
info.buildDirectory = CMakeBuildConfiguration::shadowBuildDirectory(projectPath,
|
|
|
|
|
k,
|
2019-10-09 18:36:17 +02:00
|
|
|
info.typeName,
|
2019-08-05 16:35:07 +02:00
|
|
|
info.buildType);
|
2019-06-27 10:22:13 +02:00
|
|
|
}
|
2015-09-10 16:17:38 +02:00
|
|
|
result << info;
|
|
|
|
|
}
|
2013-07-22 15:53:57 +02:00
|
|
|
return result;
|
2010-01-18 12:11:04 +01:00
|
|
|
}
|
|
|
|
|
|
2019-01-29 16:51:17 +01:00
|
|
|
BuildInfo CMakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
|
|
|
|
const QString &sourceDir,
|
|
|
|
|
BuildType buildType) const
|
2013-07-22 15:53:57 +02:00
|
|
|
{
|
2019-01-29 16:51:17 +01:00
|
|
|
BuildInfo info(this);
|
|
|
|
|
info.kitId = k->id();
|
|
|
|
|
|
|
|
|
|
CMakeExtraBuildInfo extra;
|
|
|
|
|
extra.sourceDirectory = sourceDir;
|
2016-02-03 13:52:50 +01:00
|
|
|
|
|
|
|
|
CMakeConfigItem buildTypeItem;
|
2015-09-10 16:17:38 +02:00
|
|
|
switch (buildType) {
|
|
|
|
|
case BuildTypeNone:
|
2019-10-09 18:36:17 +02:00
|
|
|
info.typeName = "Build";
|
|
|
|
|
info.displayName = tr("Build");
|
|
|
|
|
info.buildType = BuildConfiguration::Unknown;
|
2015-09-10 16:17:38 +02:00
|
|
|
break;
|
|
|
|
|
case BuildTypeDebug:
|
2019-10-09 18:36:17 +02:00
|
|
|
info.typeName = "Debug";
|
|
|
|
|
info.displayName = tr("Debug");
|
2019-01-29 16:51:17 +01:00
|
|
|
info.buildType = BuildConfiguration::Debug;
|
2015-09-10 16:17:38 +02:00
|
|
|
break;
|
|
|
|
|
case BuildTypeRelease:
|
2019-10-09 18:36:17 +02:00
|
|
|
info.typeName = "Release";
|
|
|
|
|
info.displayName = tr("Release");
|
2019-01-29 16:51:17 +01:00
|
|
|
info.buildType = BuildConfiguration::Release;
|
2015-09-10 16:17:38 +02:00
|
|
|
break;
|
|
|
|
|
case BuildTypeMinSizeRel:
|
2019-10-09 18:36:17 +02:00
|
|
|
info.typeName = "MinSizeRel";
|
|
|
|
|
info.displayName = tr("Minimum Size Release");
|
2019-01-29 16:51:17 +01:00
|
|
|
info.buildType = BuildConfiguration::Release;
|
2015-09-10 16:17:38 +02:00
|
|
|
break;
|
|
|
|
|
case BuildTypeRelWithDebInfo:
|
2019-10-09 18:36:17 +02:00
|
|
|
info.typeName = "RelWithDebInfo";
|
|
|
|
|
info.displayName = tr("Release with Debug Information");
|
2019-01-29 16:51:17 +01:00
|
|
|
info.buildType = BuildConfiguration::Profile;
|
2015-09-10 16:17:38 +02:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
QTC_CHECK(false);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2013-07-22 15:53:57 +02:00
|
|
|
|
2019-10-09 18:36:17 +02:00
|
|
|
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", info.typeName.toUtf8())};
|
|
|
|
|
|
2016-02-03 13:52:50 +01:00
|
|
|
if (!buildTypeItem.isNull())
|
2019-01-29 16:51:17 +01:00
|
|
|
extra.configuration.append(buildTypeItem);
|
2016-02-03 13:52:50 +01:00
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
const QString sysRoot = SysRootKitAspect::sysRoot(k).toString();
|
2019-01-07 12:15:40 +01:00
|
|
|
if (!sysRoot.isEmpty()) {
|
2019-01-29 16:51:17 +01:00
|
|
|
extra.configuration.append(CMakeConfigItem("CMAKE_SYSROOT", sysRoot.toUtf8()));
|
2019-02-06 12:50:51 +01:00
|
|
|
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitAspect::toolChain(
|
2019-01-07 12:15:40 +01:00
|
|
|
k, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
|
|
|
|
if (tc) {
|
|
|
|
|
const QByteArray targetTriple = tc->originalTargetTriple().toUtf8();
|
2019-01-29 16:51:17 +01:00
|
|
|
extra.configuration.append(CMakeConfigItem("CMAKE_C_COMPILER_TARGET", targetTriple));
|
|
|
|
|
extra.configuration.append(CMakeConfigItem("CMAKE_CXX_COMPILER_TARGET ", targetTriple));
|
2019-01-07 12:15:40 +01:00
|
|
|
}
|
|
|
|
|
}
|
2019-01-29 16:51:17 +01:00
|
|
|
info.extraInfo = QVariant::fromValue(extra);
|
2019-01-07 12:15:40 +01:00
|
|
|
|
2013-07-22 15:53:57 +02:00
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-03 16:12:00 +01:00
|
|
|
ProjectExplorer::BuildConfiguration::BuildType CMakeBuildConfiguration::buildType() const
|
|
|
|
|
{
|
2017-02-07 16:23:36 +01:00
|
|
|
QByteArray cmakeBuildTypeName;
|
2013-08-16 17:45:16 +02:00
|
|
|
QFile cmakeCache(buildDirectory().toString() + QLatin1String("/CMakeCache.txt"));
|
2011-03-03 16:12:00 +01:00
|
|
|
if (cmakeCache.open(QIODevice::ReadOnly)) {
|
|
|
|
|
while (!cmakeCache.atEnd()) {
|
2012-11-21 23:54:06 +02:00
|
|
|
QByteArray line = cmakeCache.readLine();
|
2011-03-03 16:12:00 +01:00
|
|
|
if (line.startsWith("CMAKE_BUILD_TYPE")) {
|
Remove braces for single lines of conditions
#!/usr/bin/env ruby
Dir.glob('**/*.cpp') { |file|
# skip ast (excluding paste, astpath, and canv'ast'imer)
next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
s = File.read(file)
next if s.include?('qlalr')
orig = s.dup
s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
res = $&
if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
res
else
res.gsub!('} else', 'else')
res.gsub!(/\n +} *\n/m, "\n")
res.gsub(/ *{$/, '')
end
}
s.gsub!(/ *$/, '')
File.open(file, 'wb').write(s) if s != orig
}
Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-08 03:32:53 +02:00
|
|
|
if (int pos = line.indexOf('='))
|
2017-02-07 16:23:36 +01:00
|
|
|
cmakeBuildTypeName = line.mid(pos + 1).trimmed();
|
2011-03-03 16:12:00 +01:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
cmakeCache.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Cover all common CMake build types
|
2017-02-07 16:23:36 +01:00
|
|
|
const CMakeBuildConfigurationFactory::BuildType cmakeBuildType
|
2019-08-05 16:39:00 +02:00
|
|
|
= CMakeBuildConfigurationFactory::buildTypeFromByteArray(cmakeBuildTypeName);
|
2017-02-07 16:23:36 +01:00
|
|
|
return CMakeBuildConfigurationFactory::cmakeBuildTypeToBuildType(cmakeBuildType);
|
2011-03-03 16:12:00 +01:00
|
|
|
}
|
2012-10-02 17:46:12 +02:00
|
|
|
|
2019-10-25 09:55:32 +02:00
|
|
|
BuildSystem *CMakeBuildConfiguration::buildSystem() const
|
|
|
|
|
{
|
|
|
|
|
return m_buildSystem;
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-22 09:16:55 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace CMakeProjectManager
|