diff options
Diffstat (limited to 'Source/cmQtAutomoc.cxx')
-rw-r--r-- | Source/cmQtAutomoc.cxx | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index 65c7952..0d0d80c 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -119,11 +119,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) return; } - bool strictMode = (qtMajorVersion == "5"); - if (makefile->IsDefinitionSet("CMAKE_AUTOMOC_STRICT_MODE")) - { - strictMode = makefile->IsOn("CMAKE_AUTOMOC_STRICT_MODE"); - } + bool relaxedMode = makefile->IsOn("CMAKE_AUTOMOC_RELAXED_MODE"); // create a custom target for running automoc at buildtime: std::string automocTargetName = targetName; @@ -213,7 +209,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) makefile->AddDefinition("_moc_options", _moc_options.c_str()); makefile->AddDefinition("_moc_files", _moc_files.c_str()); makefile->AddDefinition("_moc_headers", _moc_headers.c_str()); - makefile->AddDefinition("_moc_strict_mode", strictMode ? "TRUE" : "FALSE"); + makefile->AddDefinition("_moc_relaxed_mode", relaxedMode ? "TRUE" : "FALSE"); const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT"); std::string inputFile = cmakeRoot; @@ -313,7 +309,7 @@ bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile, this->ProjectSourceDir = makefile->GetSafeDefinition("AM_CMAKE_SOURCE_DIR"); this->TargetName = makefile->GetSafeDefinition("AM_TARGET_NAME"); - this->StrictMode = makefile->IsOn("AM_STRICT_MODE"); + this->RelaxedMode = makefile->IsOn("AM_RELAXED_MODE"); return true; } @@ -509,7 +505,7 @@ bool cmQtAutomoc::RunAutomoc() { std::cout << "AUTOMOC: Checking " << absFilename << std::endl; } - if (this->StrictMode == false) + if (this->RelaxedMode) { this->ParseCppFile(absFilename, headerExtensions, includedMocs); } @@ -702,8 +698,9 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, "includes the moc file \"" << currentMoc << "\", but does not contain a Q_OBJECT macro. " "Running moc on " - << "\"" << headerToMoc << "\" ! Better include \"moc_" - << basename << ".cpp\" for a robust build.\n" + << "\"" << headerToMoc << "\" ! Include \"moc_" + << basename << ".cpp\" for a compatiblity with " + "strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n" << std::endl; } else @@ -712,8 +709,9 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, "includes the moc file \"" << currentMoc << "\" instead of \"moc_" << basename << ".cpp\". " "Running moc on " - << "\"" << headerToMoc << "\" ! Better include \"moc_" - << basename << ".cpp\" for a robust build.\n" + << "\"" << headerToMoc << "\" ! Include \"moc_" + << basename << ".cpp\" for compatiblity with " + "strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n" << std::endl; } } @@ -753,7 +751,8 @@ void cmQtAutomoc::ParseCppFile(const std::string& absFilename, "includes " << "\"" << ownMocUnderscoreFile << "\". Running moc on " << "\"" << absFilename << "\" ! Better include \"" - << scannedFileBasename << ".moc\" for a robust build.\n" + << scannedFileBasename << ".moc\" for compatiblity with " + "strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).\n" << std::endl; includedMocs[absFilename] = ownMocUnderscoreFile; includedMocs.erase(ownMocHeaderFile); |