|
@@ -42,6 +42,9 @@
|
|
std::string GetQtExecutableTargetName(
|
|
std::string GetQtExecutableTargetName(
|
|
const cmQtAutoGen::IntegerVersion& qtVersion, std::string const& executable)
|
|
const cmQtAutoGen::IntegerVersion& qtVersion, std::string const& executable)
|
|
{
|
|
{
|
|
|
|
+ if (qtVersion.Major == 6) {
|
|
|
|
+ return ("Qt6::" + executable);
|
|
|
|
+ }
|
|
if (qtVersion.Major == 5) {
|
|
if (qtVersion.Major == 5) {
|
|
return ("Qt5::" + executable);
|
|
return ("Qt5::" + executable);
|
|
}
|
|
}
|
|
@@ -504,7 +507,7 @@ bool cmQtAutoGenInitializer::InitMoc()
|
|
{
|
|
{
|
|
// We need to disable this until we have all implicit includes available.
|
|
// We need to disable this until we have all implicit includes available.
|
|
// See issue #18669.
|
|
// See issue #18669.
|
|
- // bool const appendImplicit = (this->QtVersion.Major == 5);
|
|
|
|
|
|
+ // bool const appendImplicit = (this->QtVersion.Major >= 5);
|
|
|
|
|
|
auto GetIncludeDirs =
|
|
auto GetIncludeDirs =
|
|
[this, localGen](std::string const& cfg) -> std::vector<std::string> {
|
|
[this, localGen](std::string const& cfg) -> std::vector<std::string> {
|
|
@@ -839,7 +842,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
|
|
|
|
|
|
// Process qrc files
|
|
// Process qrc files
|
|
if (!this->Rcc.Qrcs.empty()) {
|
|
if (!this->Rcc.Qrcs.empty()) {
|
|
- const bool QtV5 = (this->QtVersion.Major == 5);
|
|
|
|
|
|
+ const bool modernQt = (this->QtVersion.Major >= 5);
|
|
// Target rcc options
|
|
// Target rcc options
|
|
std::vector<std::string> optionsTarget;
|
|
std::vector<std::string> optionsTarget;
|
|
cmSystemTools::ExpandListArgument(
|
|
cmSystemTools::ExpandListArgument(
|
|
@@ -911,10 +914,10 @@ bool cmQtAutoGenInitializer::InitScanFiles()
|
|
std::vector<std::string> nameOpts;
|
|
std::vector<std::string> nameOpts;
|
|
nameOpts.emplace_back("-name");
|
|
nameOpts.emplace_back("-name");
|
|
nameOpts.emplace_back(std::move(name));
|
|
nameOpts.emplace_back(std::move(name));
|
|
- RccMergeOptions(opts, nameOpts, QtV5);
|
|
|
|
|
|
+ RccMergeOptions(opts, nameOpts, modernQt);
|
|
}
|
|
}
|
|
// Merge file option
|
|
// Merge file option
|
|
- RccMergeOptions(opts, qrc.Options, QtV5);
|
|
|
|
|
|
+ RccMergeOptions(opts, qrc.Options, modernQt);
|
|
qrc.Options = std::move(opts);
|
|
qrc.Options = std::move(opts);
|
|
}
|
|
}
|
|
// RCC resources
|
|
// RCC resources
|
|
@@ -1374,7 +1377,7 @@ static std::vector<cmQtAutoGenInitializer::IntegerVersion> GetKnownQtVersions(
|
|
|
|
|
|
std::vector<cmQtAutoGenInitializer::IntegerVersion> result;
|
|
std::vector<cmQtAutoGenInitializer::IntegerVersion> result;
|
|
for (const std::string& prefix :
|
|
for (const std::string& prefix :
|
|
- std::vector<std::string>({ "Qt5Core", "QT" })) {
|
|
|
|
|
|
+ std::vector<std::string>({ "Qt6Core", "Qt5Core", "QT" })) {
|
|
auto tmp = cmQtAutoGenInitializer::IntegerVersion(
|
|
auto tmp = cmQtAutoGenInitializer::IntegerVersion(
|
|
StringToInt(makefile->GetSafeDefinition(prefix + "_VERSION_MAJOR")),
|
|
StringToInt(makefile->GetSafeDefinition(prefix + "_VERSION_MAJOR")),
|
|
StringToInt(makefile->GetSafeDefinition(prefix + "_VERSION_MINOR")));
|
|
StringToInt(makefile->GetSafeDefinition(prefix + "_VERSION_MINOR")));
|
|
@@ -1427,7 +1430,7 @@ std::pair<bool, std::string> GetQtExecutable(
|
|
GetQtExecutableTargetName(qtVersion, executable);
|
|
GetQtExecutableTargetName(qtVersion, executable);
|
|
if (targetName.empty()) {
|
|
if (targetName.empty()) {
|
|
err = "The AUTOMOC, AUTOUIC and AUTORCC feature ";
|
|
err = "The AUTOMOC, AUTOUIC and AUTORCC feature ";
|
|
- err += "supports only Qt 4 and Qt 5";
|
|
|
|
|
|
+ err += "supports only Qt 4, Qt 5 and Qt 6.";
|
|
} else {
|
|
} else {
|
|
cmLocalGenerator* localGen = target->GetLocalGenerator();
|
|
cmLocalGenerator* localGen = target->GetLocalGenerator();
|
|
cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName);
|
|
cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName);
|
|
@@ -1510,7 +1513,7 @@ bool cmQtAutoGenInitializer::GetRccExecutable()
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
- if (this->QtVersion.Major == 5) {
|
|
|
|
|
|
+ if (this->QtVersion.Major == 5 || this->QtVersion.Major == 6) {
|
|
if (stdOut.find("--list") != std::string::npos) {
|
|
if (stdOut.find("--list") != std::string::npos) {
|
|
this->Rcc.ListOptions.push_back("--list");
|
|
this->Rcc.ListOptions.push_back("--list");
|
|
} else {
|
|
} else {
|