mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 06:59:01 -06:00
Merge topic 'uic-options-merge-qt6'
2a31167955 AUTOUIC: Fix merging of --blah options not being detected for Qt6
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6588
This commit is contained in:
@@ -24,7 +24,8 @@
|
||||
/// @arg valueOpts list of options that accept a value
|
||||
void MergeOptions(std::vector<std::string>& baseOpts,
|
||||
std::vector<std::string> const& newOpts,
|
||||
std::initializer_list<cm::string_view> valueOpts, bool isQt5)
|
||||
std::initializer_list<cm::string_view> valueOpts,
|
||||
bool isQt5OrLater)
|
||||
{
|
||||
if (newOpts.empty()) {
|
||||
return;
|
||||
@@ -47,7 +48,7 @@ void MergeOptions(std::vector<std::string>& baseOpts,
|
||||
auto oit = newOpt.begin();
|
||||
if (*oit == '-') {
|
||||
++oit;
|
||||
if (isQt5 && (*oit == '-')) {
|
||||
if (isQt5OrLater && (*oit == '-')) {
|
||||
++oit;
|
||||
}
|
||||
optName.assign(oit, newOpt.end());
|
||||
@@ -204,24 +205,24 @@ std::string cmQtAutoGen::AppendFilenameSuffix(cm::string_view filename,
|
||||
|
||||
void cmQtAutoGen::UicMergeOptions(std::vector<std::string>& baseOpts,
|
||||
std::vector<std::string> const& newOpts,
|
||||
bool isQt5)
|
||||
bool isQt5OrLater)
|
||||
{
|
||||
static std::initializer_list<cm::string_view> const valueOpts = {
|
||||
"tr", "translate", "postfix", "generator",
|
||||
"include", // Since Qt 5.3
|
||||
"g"
|
||||
};
|
||||
MergeOptions(baseOpts, newOpts, valueOpts, isQt5);
|
||||
MergeOptions(baseOpts, newOpts, valueOpts, isQt5OrLater);
|
||||
}
|
||||
|
||||
void cmQtAutoGen::RccMergeOptions(std::vector<std::string>& baseOpts,
|
||||
std::vector<std::string> const& newOpts,
|
||||
bool isQt5)
|
||||
bool isQt5OrLater)
|
||||
{
|
||||
static std::initializer_list<cm::string_view> const valueOpts = {
|
||||
"name", "root", "compress", "threshold"
|
||||
};
|
||||
MergeOptions(baseOpts, newOpts, valueOpts, isQt5);
|
||||
MergeOptions(baseOpts, newOpts, valueOpts, isQt5OrLater);
|
||||
}
|
||||
|
||||
static void RccListParseContent(std::string const& content,
|
||||
|
||||
@@ -93,12 +93,12 @@ public:
|
||||
/// @brief Merges newOpts into baseOpts
|
||||
static void UicMergeOptions(std::vector<std::string>& baseOpts,
|
||||
std::vector<std::string> const& newOpts,
|
||||
bool isQt5);
|
||||
bool isQt5OrLater);
|
||||
|
||||
/// @brief Merges newOpts into baseOpts
|
||||
static void RccMergeOptions(std::vector<std::string>& baseOpts,
|
||||
std::vector<std::string> const& newOpts,
|
||||
bool isQt5);
|
||||
bool isQt5OrLater);
|
||||
|
||||
/** @class RccLister
|
||||
* @brief Lists files in qrc resource files
|
||||
|
||||
@@ -2083,7 +2083,7 @@ void cmQtAutoMocUicT::JobCompileUicT::Process()
|
||||
auto optionIt = this->UicConst().UiFiles.find(sourceFile);
|
||||
if (optionIt != this->UicConst().UiFiles.end()) {
|
||||
UicMergeOptions(allOpts, optionIt->second.Options,
|
||||
(this->BaseConst().QtVersion.Major == 5));
|
||||
(this->BaseConst().QtVersion.Major >= 5));
|
||||
}
|
||||
cm::append(cmd, allOpts);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user