forked from qt-creator/qt-creator
CMakePM: Add include presets support
Fixes: QTCREATORBUG-28894 Change-Id: I9359cb85c230f2db02f08427af9832f168a32c41 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -208,12 +208,51 @@ void CMakeProject::readPresets()
|
|||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::function<void(Internal::PresetsData & presetData, Utils::FilePaths & inclueStack)>
|
||||||
|
resolveIncludes = [&](Internal::PresetsData &presetData, Utils::FilePaths &includeStack) {
|
||||||
|
if (presetData.include) {
|
||||||
|
for (const QString &path : presetData.include.value()) {
|
||||||
|
Utils::FilePath includePath = Utils::FilePath::fromUserInput(path);
|
||||||
|
if (!includePath.isAbsolutePath())
|
||||||
|
includePath = presetData.fileDir.resolvePath(path);
|
||||||
|
|
||||||
|
Internal::PresetsData includeData = parsePreset(includePath);
|
||||||
|
if (includeData.include) {
|
||||||
|
if (includeStack.contains(includePath)) {
|
||||||
|
TaskHub::addTask(BuildSystemTask(
|
||||||
|
Task::TaskType::Warning,
|
||||||
|
Tr::tr("Attempt to include %1 which was already parsed.")
|
||||||
|
.arg(includePath.path()),
|
||||||
|
Utils::FilePath(),
|
||||||
|
-1));
|
||||||
|
TaskHub::requestPopup();
|
||||||
|
} else {
|
||||||
|
resolveIncludes(includeData, includeStack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
presetData.configurePresets = includeData.configurePresets
|
||||||
|
+ presetData.configurePresets;
|
||||||
|
presetData.buildPresets = includeData.buildPresets + presetData.buildPresets;
|
||||||
|
|
||||||
|
includeStack << includePath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const Utils::FilePath cmakePresetsJson = projectDirectory().pathAppended("CMakePresets.json");
|
const Utils::FilePath cmakePresetsJson = projectDirectory().pathAppended("CMakePresets.json");
|
||||||
const Utils::FilePath cmakeUserPresetsJson = projectDirectory().pathAppended("CMakeUserPresets.json");
|
const Utils::FilePath cmakeUserPresetsJson = projectDirectory().pathAppended("CMakeUserPresets.json");
|
||||||
|
|
||||||
Internal::PresetsData cmakePresetsData = parsePreset(cmakePresetsJson);
|
Internal::PresetsData cmakePresetsData = parsePreset(cmakePresetsJson);
|
||||||
Internal::PresetsData cmakeUserPresetsData = parsePreset(cmakeUserPresetsJson);
|
Internal::PresetsData cmakeUserPresetsData = parsePreset(cmakeUserPresetsJson);
|
||||||
|
|
||||||
|
// resolve the include
|
||||||
|
Utils::FilePaths includeStack = {cmakePresetsJson};
|
||||||
|
resolveIncludes(cmakePresetsData, includeStack);
|
||||||
|
|
||||||
|
includeStack = {cmakeUserPresetsJson};
|
||||||
|
resolveIncludes(cmakeUserPresetsData, includeStack);
|
||||||
|
|
||||||
m_presetsData = combinePresets(cmakePresetsData, cmakeUserPresetsData);
|
m_presetsData = combinePresets(cmakePresetsData, cmakeUserPresetsData);
|
||||||
setupBuildPresets(m_presetsData);
|
setupBuildPresets(m_presetsData);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ static void expandAllButEnv(const PresetsDetails::ConfigurePreset &preset,
|
|||||||
value.replace("${sourceDirName}", sourceDirectory.fileName());
|
value.replace("${sourceDirName}", sourceDirectory.fileName());
|
||||||
|
|
||||||
value.replace("${presetName}", preset.name);
|
value.replace("${presetName}", preset.name);
|
||||||
|
value.replace("${fileDir}", preset.fileDir.path());
|
||||||
if (preset.generator)
|
if (preset.generator)
|
||||||
value.replace("${generator}", preset.generator.value());
|
value.replace("${generator}", preset.generator.value());
|
||||||
|
|
||||||
@@ -51,6 +52,7 @@ static void expandAllButEnv(const PresetsDetails::BuildPreset &preset,
|
|||||||
value.replace("${dollar}", "$");
|
value.replace("${dollar}", "$");
|
||||||
|
|
||||||
value.replace("${sourceDir}", sourceDirectory.toString());
|
value.replace("${sourceDir}", sourceDirectory.toString());
|
||||||
|
value.replace("${fileDir}", preset.fileDir.path());
|
||||||
value.replace("${sourceParentDir}", sourceDirectory.parentDir().toString());
|
value.replace("${sourceParentDir}", sourceDirectory.parentDir().toString());
|
||||||
value.replace("${sourceDirName}", sourceDirectory.fileName());
|
value.replace("${sourceDirName}", sourceDirectory.fileName());
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,22 @@ bool parseCMakeMinimumRequired(const QJsonValue &jsonValue, QVersionNumber &vers
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::optional<QStringList> parseInclude(const QJsonValue &jsonValue)
|
||||||
|
{
|
||||||
|
std::optional<QStringList> includes;
|
||||||
|
|
||||||
|
if (!jsonValue.isUndefined()) {
|
||||||
|
if (jsonValue.isArray()) {
|
||||||
|
includes = QStringList();
|
||||||
|
const QJsonArray includeArray = jsonValue.toArray();
|
||||||
|
for (const QJsonValue &includeValue : includeArray)
|
||||||
|
includes.value() << includeValue.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return includes;
|
||||||
|
}
|
||||||
|
|
||||||
std::optional<PresetsDetails::Condition> parseCondition(const QJsonValue &jsonValue)
|
std::optional<PresetsDetails::Condition> parseCondition(const QJsonValue &jsonValue)
|
||||||
{
|
{
|
||||||
std::optional<PresetsDetails::Condition> condition;
|
std::optional<PresetsDetails::Condition> condition;
|
||||||
@@ -133,7 +149,8 @@ std::optional<PresetsDetails::Condition> parseCondition(const QJsonValue &jsonVa
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool parseConfigurePresets(const QJsonValue &jsonValue,
|
bool parseConfigurePresets(const QJsonValue &jsonValue,
|
||||||
QList<PresetsDetails::ConfigurePreset> &configurePresets)
|
QList<PresetsDetails::ConfigurePreset> &configurePresets,
|
||||||
|
const Utils::FilePath &fileDir)
|
||||||
{
|
{
|
||||||
// The whole section is optional
|
// The whole section is optional
|
||||||
if (jsonValue.isUndefined())
|
if (jsonValue.isUndefined())
|
||||||
@@ -151,6 +168,7 @@ bool parseConfigurePresets(const QJsonValue &jsonValue,
|
|||||||
PresetsDetails::ConfigurePreset preset;
|
PresetsDetails::ConfigurePreset preset;
|
||||||
|
|
||||||
preset.name = object.value("name").toString();
|
preset.name = object.value("name").toString();
|
||||||
|
preset.fileDir = fileDir;
|
||||||
preset.hidden = object.value("hidden").toBool();
|
preset.hidden = object.value("hidden").toBool();
|
||||||
|
|
||||||
QJsonValue inherits = object.value("inherits");
|
QJsonValue inherits = object.value("inherits");
|
||||||
@@ -291,7 +309,8 @@ bool parseConfigurePresets(const QJsonValue &jsonValue,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool parseBuildPresets(const QJsonValue &jsonValue,
|
bool parseBuildPresets(const QJsonValue &jsonValue,
|
||||||
QList<PresetsDetails::BuildPreset> &buildPresets)
|
QList<PresetsDetails::BuildPreset> &buildPresets,
|
||||||
|
const Utils::FilePath &fileDir)
|
||||||
{
|
{
|
||||||
// The whole section is optional
|
// The whole section is optional
|
||||||
if (jsonValue.isUndefined())
|
if (jsonValue.isUndefined())
|
||||||
@@ -309,6 +328,7 @@ bool parseBuildPresets(const QJsonValue &jsonValue,
|
|||||||
PresetsDetails::BuildPreset preset;
|
PresetsDetails::BuildPreset preset;
|
||||||
|
|
||||||
preset.name = object.value("name").toString();
|
preset.name = object.value("name").toString();
|
||||||
|
preset.fileDir = fileDir;
|
||||||
preset.hidden = object.value("hidden").toBool();
|
preset.hidden = object.value("hidden").toBool();
|
||||||
|
|
||||||
QJsonValue inherits = object.value("inherits");
|
QJsonValue inherits = object.value("inherits");
|
||||||
@@ -416,6 +436,8 @@ bool PresetsParser::parse(const Utils::FilePath &jsonFile, QString &errorMessage
|
|||||||
|
|
||||||
QJsonObject root = jsonDoc.object();
|
QJsonObject root = jsonDoc.object();
|
||||||
|
|
||||||
|
m_presetsData.fileDir = jsonFile.parentDir();
|
||||||
|
|
||||||
if (!parseVersion(root.value("version"), m_presetsData.version)) {
|
if (!parseVersion(root.value("version"), m_presetsData.version)) {
|
||||||
errorMessage = Tr::tr("Invalid \"version\" in file \"%1\".").arg(jsonFile.fileName());
|
errorMessage = Tr::tr("Invalid \"version\" in file \"%1\".").arg(jsonFile.fileName());
|
||||||
return false;
|
return false;
|
||||||
@@ -426,14 +448,21 @@ bool PresetsParser::parse(const Utils::FilePath &jsonFile, QString &errorMessage
|
|||||||
m_presetsData.cmakeMinimimRequired);
|
m_presetsData.cmakeMinimimRequired);
|
||||||
|
|
||||||
// optional
|
// optional
|
||||||
if (!parseConfigurePresets(root.value("configurePresets"), m_presetsData.configurePresets)) {
|
m_presetsData.include = parseInclude(root.value("include"));
|
||||||
|
|
||||||
|
// optional
|
||||||
|
if (!parseConfigurePresets(root.value("configurePresets"),
|
||||||
|
m_presetsData.configurePresets,
|
||||||
|
jsonFile.parentDir())) {
|
||||||
errorMessage
|
errorMessage
|
||||||
= Tr::tr("Invalid \"configurePresets\" section in %1 file").arg(jsonFile.fileName());
|
= Tr::tr("Invalid \"configurePresets\" section in %1 file").arg(jsonFile.fileName());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// optional
|
// optional
|
||||||
if (!parseBuildPresets(root.value("buildPresets"), m_presetsData.buildPresets)) {
|
if (!parseBuildPresets(root.value("buildPresets"),
|
||||||
|
m_presetsData.buildPresets,
|
||||||
|
jsonFile.parentDir())) {
|
||||||
errorMessage
|
errorMessage
|
||||||
= Tr::tr("Invalid \"buildPresets\" section in %1 file").arg(jsonFile.fileName());
|
= Tr::tr("Invalid \"buildPresets\" section in %1 file").arg(jsonFile.fileName());
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ public:
|
|||||||
void inheritFrom(const ConfigurePreset &other);
|
void inheritFrom(const ConfigurePreset &other);
|
||||||
|
|
||||||
QString name;
|
QString name;
|
||||||
|
Utils::FilePath fileDir;
|
||||||
std::optional<bool> hidden = false;
|
std::optional<bool> hidden = false;
|
||||||
std::optional<QStringList> inherits;
|
std::optional<QStringList> inherits;
|
||||||
std::optional<Condition> condition;
|
std::optional<Condition> condition;
|
||||||
@@ -115,6 +116,7 @@ public:
|
|||||||
void inheritFrom(const BuildPreset &other);
|
void inheritFrom(const BuildPreset &other);
|
||||||
|
|
||||||
QString name;
|
QString name;
|
||||||
|
Utils::FilePath fileDir;
|
||||||
std::optional<bool> hidden = false;
|
std::optional<bool> hidden = false;
|
||||||
std::optional<QStringList> inherits;
|
std::optional<QStringList> inherits;
|
||||||
std::optional<Condition> condition;
|
std::optional<Condition> condition;
|
||||||
@@ -140,6 +142,8 @@ public:
|
|||||||
int version = 0;
|
int version = 0;
|
||||||
QVersionNumber cmakeMinimimRequired;
|
QVersionNumber cmakeMinimimRequired;
|
||||||
QHash<QString, QString> vendor;
|
QHash<QString, QString> vendor;
|
||||||
|
std::optional<QStringList> include;
|
||||||
|
Utils::FilePath fileDir;
|
||||||
QList<PresetsDetails::ConfigurePreset> configurePresets;
|
QList<PresetsDetails::ConfigurePreset> configurePresets;
|
||||||
QList<PresetsDetails::BuildPreset> buildPresets;
|
QList<PresetsDetails::BuildPreset> buildPresets;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,92 +1,14 @@
|
|||||||
{
|
{
|
||||||
"version": 3,
|
"version": 4,
|
||||||
"cmakeMinimumRequired": {
|
"cmakeMinimumRequired": {
|
||||||
"major": 3,
|
"major": 3,
|
||||||
"minor": 21,
|
"minor": 23,
|
||||||
"patch": 0
|
"patch": 0
|
||||||
},
|
},
|
||||||
|
"include": [
|
||||||
|
"mingw.json", "msvc.json"
|
||||||
|
],
|
||||||
"configurePresets": [
|
"configurePresets": [
|
||||||
{
|
|
||||||
"name": "mingw",
|
|
||||||
"displayName": "MinGW 11.2.0",
|
|
||||||
"generator": "Ninja",
|
|
||||||
"installDir": "../inst-${presetName}",
|
|
||||||
"cacheVariables": {
|
|
||||||
"CMAKE_PREFIX_PATH": "$env{SYSTEMDRIVE}/Qt/6.4.2/mingw_64"
|
|
||||||
},
|
|
||||||
"condition": {
|
|
||||||
"type": "equals",
|
|
||||||
"lhs": "${hostSystemName}",
|
|
||||||
"rhs": "Windows"
|
|
||||||
},
|
|
||||||
"environment": {
|
|
||||||
"PATH": "$env{SYSTEMDRIVE}/Qt/Tools/mingw1120_64/bin;$penv{PATH}"
|
|
||||||
},
|
|
||||||
"debug" : {
|
|
||||||
"find" : true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mingw-make",
|
|
||||||
"binaryDir": "${sourceDir}/build-${presetName}-release",
|
|
||||||
"displayName": "MinGW 11.2.0 Makefiles",
|
|
||||||
"generator": "MinGW Makefiles",
|
|
||||||
"inherits" : "mingw",
|
|
||||||
"cacheVariables": {
|
|
||||||
"CMAKE_BUILD_TYPE": "Release",
|
|
||||||
"CMAKE_PREFIX_PATH": "$env{SystemDrive}/Qt/6.4.2/mingw_64"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "visualc",
|
|
||||||
"displayName": "Visual C++ 2019 x64",
|
|
||||||
"generator": "Visual Studio 16 2019",
|
|
||||||
"binaryDir": "${sourceDir}/build-${presetName}",
|
|
||||||
"architecture" : {
|
|
||||||
"value": "x64"
|
|
||||||
},
|
|
||||||
"toolchainFile" : "../cmakepresets/msvc-toolchain.cmake",
|
|
||||||
"condition" : {
|
|
||||||
"type": "not",
|
|
||||||
"condition": {
|
|
||||||
"type": "notEquals",
|
|
||||||
"lhs": "${hostSystemName}",
|
|
||||||
"rhs": "$env{HOST_SYSTEM_NAME}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"environment" : {
|
|
||||||
"HOST_SYSTEM_NAME": "Windows",
|
|
||||||
"QT_VERSION": "6.4.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "visualc-ninja",
|
|
||||||
"displayName": "Visual C++ 2019 x64 Ninja",
|
|
||||||
"generator": "Ninja",
|
|
||||||
"binaryDir": "${sourceDir}/build-${presetName}",
|
|
||||||
"toolchainFile" : "c:/Qt/6.4.2/msvc2019_64/lib/cmake/Qt6/qt.toolchain.cmake",
|
|
||||||
"cacheVariables": {
|
|
||||||
"CMAKE_BUILD_TYPE": "Release"
|
|
||||||
},
|
|
||||||
"condition": {
|
|
||||||
"type": "equals",
|
|
||||||
"lhs": "${hostSystemName}",
|
|
||||||
"rhs": "Windows"
|
|
||||||
},
|
|
||||||
"environment" : {
|
|
||||||
"VCToolsVersion": "14.29.30133",
|
|
||||||
"WindowsSDKVersion" : "10.0.22000.0",
|
|
||||||
"VCArch": "x64",
|
|
||||||
"VCToolsInstallDir": "$env{ProgramFiles(x86)}/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/$env{VCToolsVersion}",
|
|
||||||
"WindowsSdkDir" : "$env{ProgramFiles(x86)}/Windows Kits/10",
|
|
||||||
"WindowsSdkIncVerDir": "$env{WindowsSdkDir}/Include/$env{WindowsSDKVersion}",
|
|
||||||
"WindowsSdkLibVerDir": "$env{WindowsSdkDir}/Lib/$env{WindowsSDKVersion}",
|
|
||||||
|
|
||||||
"INCLUDE": "$env{VCToolsInstallDir}/ATLMFC/include;$env{VCToolsInstallDir}/include;$env{WindowsSdkIncVerDir}/ucrt;$env{WindowsSdkIncVerDir}/shared;$env{WindowsSdkIncVerDir}/um;$env{WindowsSdkIncVerDir}/winrt;$env{WindowsSdkIncVerDir}/cppwinrt",
|
|
||||||
"LIB": "$env{VCToolsInstallDir}/ATLMFC/lib/$env{VCArch};$env{VCToolsInstallDir}/lib/$env{VCArch};$env{WindowsSdkLibVerDir}/ucrt/$env{VCArch};$env{WindowsSdkLibVerDir}/um/$env{VCArch}",
|
|
||||||
"PATH": "$env{VCToolsInstallDir}/bin/HostX64/$env{VCArch};$env{WindowsSdkDir}/bin/$env{WindowsSDKVersion}/$env{VCArch};$penv{PATH}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "linux-gcc",
|
"name": "linux-gcc",
|
||||||
"displayName": "Linux GCC",
|
"displayName": "Linux GCC",
|
||||||
@@ -99,39 +21,5 @@
|
|||||||
"rhs": "Linux"
|
"rhs": "Linux"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"buildPresets": [
|
|
||||||
{
|
|
||||||
"name": "mingw",
|
|
||||||
"displayName": "MinGW default",
|
|
||||||
"configurePreset": "mingw",
|
|
||||||
"targets": "${sourceDirName}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mingw-verbose",
|
|
||||||
"inherits": "mingw",
|
|
||||||
"displayName": "MinGW verbose",
|
|
||||||
"verbose": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "mingw-make",
|
|
||||||
"displayName": "MinGW make 4 CPUs",
|
|
||||||
"configurePreset": "mingw-make",
|
|
||||||
"jobs": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "visualc-debug",
|
|
||||||
"configurePreset": "visualc",
|
|
||||||
"configuration": "Debug"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "visualc-relwithdebinfo",
|
|
||||||
"inherits": "visualc-debug",
|
|
||||||
"configuration": "RelWithDebInfo"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "visualc-ninja",
|
|
||||||
"configurePreset": "visualc-ninja"
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
61
tests/manual/cmakepresets/mingw.json
Normal file
61
tests/manual/cmakepresets/mingw.json
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"version": 4,
|
||||||
|
"cmakeMinimumRequired": {
|
||||||
|
"major": 3,
|
||||||
|
"minor": 23,
|
||||||
|
"patch": 0
|
||||||
|
},
|
||||||
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"name": "mingw",
|
||||||
|
"displayName": "MinGW 11.2.0",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"installDir": "../inst-${presetName}",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_PREFIX_PATH": "$env{SYSTEMDRIVE}/Qt/6.4.2/mingw_64"
|
||||||
|
},
|
||||||
|
"condition": {
|
||||||
|
"type": "equals",
|
||||||
|
"lhs": "${hostSystemName}",
|
||||||
|
"rhs": "Windows"
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"PATH": "$env{SYSTEMDRIVE}/Qt/Tools/mingw1120_64/bin;$penv{PATH}"
|
||||||
|
},
|
||||||
|
"debug" : {
|
||||||
|
"find" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mingw-make",
|
||||||
|
"binaryDir": "${sourceDir}/build-${presetName}-release",
|
||||||
|
"displayName": "MinGW 11.2.0 Makefiles",
|
||||||
|
"generator": "MinGW Makefiles",
|
||||||
|
"inherits" : "mingw",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release",
|
||||||
|
"CMAKE_PREFIX_PATH": "$env{SystemDrive}/Qt/6.4.2/mingw_64"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"buildPresets": [
|
||||||
|
{
|
||||||
|
"name": "mingw",
|
||||||
|
"displayName": "MinGW default",
|
||||||
|
"configurePreset": "mingw",
|
||||||
|
"targets": "${sourceDirName}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mingw-verbose",
|
||||||
|
"inherits": "mingw",
|
||||||
|
"displayName": "MinGW verbose",
|
||||||
|
"verbose": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "mingw-make",
|
||||||
|
"displayName": "MinGW make 4 CPUs",
|
||||||
|
"configurePreset": "mingw-make",
|
||||||
|
"jobs": 4
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
76
tests/manual/cmakepresets/msvc.json
Normal file
76
tests/manual/cmakepresets/msvc.json
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
"version": 4,
|
||||||
|
"cmakeMinimumRequired": {
|
||||||
|
"major": 3,
|
||||||
|
"minor": 23,
|
||||||
|
"patch": 0
|
||||||
|
},
|
||||||
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"name": "visualc",
|
||||||
|
"displayName": "Visual C++ 2019 x64",
|
||||||
|
"generator": "Visual Studio 16 2019",
|
||||||
|
"binaryDir": "${sourceDir}/build-${presetName}",
|
||||||
|
"architecture" : {
|
||||||
|
"value": "x64"
|
||||||
|
},
|
||||||
|
"toolchainFile" : "../cmakepresets/msvc-toolchain.cmake",
|
||||||
|
"condition" : {
|
||||||
|
"type": "not",
|
||||||
|
"condition": {
|
||||||
|
"type": "notEquals",
|
||||||
|
"lhs": "${hostSystemName}",
|
||||||
|
"rhs": "$env{HOST_SYSTEM_NAME}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"environment" : {
|
||||||
|
"HOST_SYSTEM_NAME": "Windows",
|
||||||
|
"QT_VERSION": "6.4.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "visualc-ninja",
|
||||||
|
"displayName": "Visual C++ 2019 x64 Ninja",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/build-${presetName}",
|
||||||
|
"toolchainFile" : "c:/Qt/6.4.2/msvc2019_64/lib/cmake/Qt6/qt.toolchain.cmake",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
|
},
|
||||||
|
"condition": {
|
||||||
|
"type": "equals",
|
||||||
|
"lhs": "${hostSystemName}",
|
||||||
|
"rhs": "Windows"
|
||||||
|
},
|
||||||
|
"environment" : {
|
||||||
|
"VCToolsVersion": "14.29.30133",
|
||||||
|
"WindowsSDKVersion" : "10.0.22000.0",
|
||||||
|
"VCArch": "x64",
|
||||||
|
"VCToolsInstallDir": "$env{ProgramFiles(x86)}/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/$env{VCToolsVersion}",
|
||||||
|
"WindowsSdkDir" : "$env{ProgramFiles(x86)}/Windows Kits/10",
|
||||||
|
"WindowsSdkIncVerDir": "$env{WindowsSdkDir}/Include/$env{WindowsSDKVersion}",
|
||||||
|
"WindowsSdkLibVerDir": "$env{WindowsSdkDir}/Lib/$env{WindowsSDKVersion}",
|
||||||
|
|
||||||
|
"INCLUDE": "$env{VCToolsInstallDir}/ATLMFC/include;$env{VCToolsInstallDir}/include;$env{WindowsSdkIncVerDir}/ucrt;$env{WindowsSdkIncVerDir}/shared;$env{WindowsSdkIncVerDir}/um;$env{WindowsSdkIncVerDir}/winrt;$env{WindowsSdkIncVerDir}/cppwinrt",
|
||||||
|
"LIB": "$env{VCToolsInstallDir}/ATLMFC/lib/$env{VCArch};$env{VCToolsInstallDir}/lib/$env{VCArch};$env{WindowsSdkLibVerDir}/ucrt/$env{VCArch};$env{WindowsSdkLibVerDir}/um/$env{VCArch}",
|
||||||
|
"PATH": "$env{VCToolsInstallDir}/bin/HostX64/$env{VCArch};$env{WindowsSdkDir}/bin/$env{WindowsSDKVersion}/$env{VCArch};$penv{PATH}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"buildPresets": [
|
||||||
|
{
|
||||||
|
"name": "visualc-debug",
|
||||||
|
"configurePreset": "visualc",
|
||||||
|
"configuration": "Debug"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "visualc-relwithdebinfo",
|
||||||
|
"inherits": "visualc-debug",
|
||||||
|
"configuration": "RelWithDebInfo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "visualc-ninja",
|
||||||
|
"configurePreset": "visualc-ninja"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user