forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/7.0'
Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri Change-Id: Ic02df53b880d0861d9d9ea0df3e0d381ae99f350
This commit is contained in:
@@ -1739,14 +1739,14 @@ const QStringList InitialCMakeArgumentsAspect::allValues() const
|
||||
void InitialCMakeArgumentsAspect::setAllValues(const QString &values, QStringList &additionalOptions)
|
||||
{
|
||||
QStringList arguments = values.split('\n', Qt::SkipEmptyParts);
|
||||
QString cmakeGenerator;
|
||||
for (QString &arg: arguments) {
|
||||
if (arg.startsWith("-G")) {
|
||||
const QString strDash(" - ");
|
||||
const int idxDash = arg.indexOf(strDash);
|
||||
if (idxDash > 0) {
|
||||
// -GCodeBlocks - Ninja
|
||||
QString generator = "-DCMAKE_GENERATOR:STRING=" + arg.mid(idxDash + strDash.length());
|
||||
arguments.append(generator);
|
||||
cmakeGenerator = "-DCMAKE_GENERATOR:STRING=" + arg.mid(idxDash + strDash.length());
|
||||
|
||||
arg = arg.left(idxDash);
|
||||
arg.replace("-G", "-DCMAKE_EXTRA_GENERATOR:STRING=");
|
||||
@@ -1761,6 +1761,9 @@ void InitialCMakeArgumentsAspect::setAllValues(const QString &values, QStringLis
|
||||
if (arg.startsWith("-T"))
|
||||
arg.replace("-T", "-DCMAKE_GENERATOR_TOOLSET:STRING=");
|
||||
}
|
||||
if (!cmakeGenerator.isEmpty())
|
||||
arguments.append(cmakeGenerator);
|
||||
|
||||
m_cmakeConfiguration = CMakeConfig::fromArguments(arguments, additionalOptions);
|
||||
for (CMakeConfigItem &ci : m_cmakeConfiguration)
|
||||
ci.isInitial = true;
|
||||
|
||||
@@ -234,7 +234,7 @@ FilePath CMakeTool::qchFilePath() const
|
||||
|
||||
FilePath CMakeTool::cmakeExecutable(const FilePath &path)
|
||||
{
|
||||
if (HostOsInfo::isMacHost()) {
|
||||
if (path.osType() == OsTypeMac) {
|
||||
const QString executableString = path.toString();
|
||||
const int appIndex = executableString.lastIndexOf(".app");
|
||||
const int appCutIndex = appIndex + 4;
|
||||
@@ -251,7 +251,7 @@ FilePath CMakeTool::cmakeExecutable(const FilePath &path)
|
||||
|
||||
const FilePath resolvedPath = path.canonicalPath();
|
||||
// Evil hack to make snap-packages of CMake work. See QTCREATORBUG-23376
|
||||
if (HostOsInfo::isLinuxHost() && resolvedPath.fileName() == "snap")
|
||||
if (path.osType() == OsTypeLinux && resolvedPath.fileName() == "snap")
|
||||
return path;
|
||||
|
||||
return resolvedPath;
|
||||
|
||||
@@ -239,9 +239,10 @@ CMakeToolSettingsAccessor::cmakeTools(const QVariantMap &data, bool fromSdk) con
|
||||
|
||||
const QVariantMap dbMap = data.value(key).toMap();
|
||||
auto item = std::make_unique<CMakeTool>(dbMap, fromSdk);
|
||||
if (item->isAutoDetected() && !item->cmakeExecutable().isExecutableFile()) {
|
||||
qWarning() << QString::fromLatin1("CMakeTool \"%1\" (%2) dropped since the command is not executable.")
|
||||
.arg(item->cmakeExecutable().toUserOutput(), item->id().toString());
|
||||
const FilePath cmakeExecutable = item->cmakeExecutable();
|
||||
if (item->isAutoDetected() && !cmakeExecutable.needsDevice() && !cmakeExecutable.isExecutableFile()) {
|
||||
qWarning() << QString("CMakeTool \"%1\" (%2) dropped since the command is not executable.")
|
||||
.arg(cmakeExecutable.toUserOutput(), item->id().toString());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user