summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/AutogenInfo.cmake.in1
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx3
-rw-r--r--Source/cmQtAutoGeneratorMocUic.cxx19
-rw-r--r--Source/cmQtAutoGeneratorMocUic.h3
4 files changed, 9 insertions, 17 deletions
diff --git a/Modules/AutogenInfo.cmake.in b/Modules/AutogenInfo.cmake.in
index 8fa3684..9a4a06d 100644
--- a/Modules/AutogenInfo.cmake.in
+++ b/Modules/AutogenInfo.cmake.in
@@ -12,7 +12,6 @@ set(AM_HEADERS @_headers@)
set(AM_SETTINGS_FILE @_settings_file@)
# Qt environment
set(AM_QT_VERSION_MAJOR @_qt_version_major@)
-set(AM_QT_VERSION_MINOR @_qt_version_minor@)
set(AM_QT_MOC_EXECUTABLE @_qt_moc_executable@)
set(AM_QT_UIC_EXECUTABLE @_qt_uic_executable@)
# MOC settings
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index a2c9b42..d9a5a9a 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -899,10 +899,9 @@ void cmQtAutoGeneratorInitializer::SetupCustomTargets()
AddDefinitionEscaped(makefile, "_multi_config",
cmQtAutoGen::MultiConfigName(this->MultiConfig));
AddDefinitionEscaped(makefile, "_build_dir", this->DirBuild);
- AddDefinitionEscaped(makefile, "_qt_version_major", this->QtVersionMajor);
- AddDefinitionEscaped(makefile, "_qt_version_minor", this->QtVersionMinor);
if (this->MocEnabled || this->UicEnabled) {
+ AddDefinitionEscaped(makefile, "_qt_version_major", this->QtVersionMajor);
AddDefinitionEscaped(makefile, "_settings_file",
this->AutogenSettingsFile);
AddDefinitionEscaped(makefile, "_sources", this->Sources);
diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx
index 1956a89..0de02b5 100644
--- a/Source/cmQtAutoGeneratorMocUic.cxx
+++ b/Source/cmQtAutoGeneratorMocUic.cxx
@@ -49,6 +49,7 @@ static bool ListContains(std::vector<std::string> const& list,
cmQtAutoGeneratorMocUic::cmQtAutoGeneratorMocUic()
: MultiConfig(cmQtAutoGen::WRAP)
, IncludeProjectDirsBefore(false)
+ , QtVersionMajor(4)
, MocSettingsChanged(false)
, MocPredefsChanged(false)
, MocRelaxedMode(false)
@@ -163,19 +164,13 @@ bool cmQtAutoGeneratorMocUic::InitInfoFile(cmMakefile* makefile)
}
// - Qt environment
- this->QtMajorVersion = InfoGet("AM_QT_VERSION_MAJOR");
- this->QtMinorVersion = InfoGet("AM_QT_VERSION_MINOR");
+ if (!cmSystemTools::StringToULong(InfoGet("AM_QT_VERSION_MAJOR"),
+ &this->QtVersionMajor)) {
+ this->QtVersionMajor = 4;
+ }
this->MocExecutable = InfoGet("AM_QT_MOC_EXECUTABLE");
this->UicExecutable = InfoGet("AM_QT_UIC_EXECUTABLE");
- // Check Qt version
- if ((this->QtMajorVersion != "4") && (this->QtMajorVersion != "5")) {
- this->LogFileError(cmQtAutoGen::GEN, this->GetInfoFile(),
- "Unsupported Qt version: " +
- cmQtAutoGen::Quoted(this->QtMajorVersion));
- return false;
- }
-
// - Moc
if (this->MocEnabled()) {
this->MocSkipList = InfoGetList("AM_MOC_SKIP");
@@ -203,7 +198,7 @@ bool cmQtAutoGeneratorMocUic::InitInfoFile(cmMakefile* makefile)
std::vector<std::string> const mocDependFilters =
InfoGetList("AM_MOC_DEPEND_FILTERS");
// Insert Q_PLUGIN_METADATA dependency filter
- if (this->QtMajorVersion != "4") {
+ if (this->QtVersionMajor != 4) {
this->MocDependFilterPush("Q_PLUGIN_METADATA",
"[\n][ \t]*Q_PLUGIN_METADATA[ \t]*\\("
"[^\\)]*FILE[ \t]*\"([^\"]+)\"");
@@ -1686,7 +1681,7 @@ bool cmQtAutoGeneratorMocUic::UicGenerateFile(const UicJob& uicJob)
auto optionIt = this->UicOptions.find(uicJob.SourceFile);
if (optionIt != this->UicOptions.end()) {
cmQtAutoGen::UicMergeOptions(allOpts, optionIt->second,
- (this->QtMajorVersion == "5"));
+ (this->QtVersionMajor == 5));
}
cmd.insert(cmd.end(), allOpts.begin(), allOpts.end());
}
diff --git a/Source/cmQtAutoGeneratorMocUic.h b/Source/cmQtAutoGeneratorMocUic.h
index a03270b..d510939 100644
--- a/Source/cmQtAutoGeneratorMocUic.h
+++ b/Source/cmQtAutoGeneratorMocUic.h
@@ -154,8 +154,7 @@ private:
std::string AutogenBuildDir;
std::string AutogenIncludeDir;
// -- Qt environment
- std::string QtMajorVersion;
- std::string QtMinorVersion;
+ unsigned long QtVersionMajor;
std::string MocExecutable;
std::string UicExecutable;
// -- File lists