diff options
author | Alex Neundorf <neundorf@kde.org> | 2011-12-13 21:11:47 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2011-12-13 21:11:47 (GMT) |
commit | 96fc5d5d0701c98a5029469c8a9dcc6aa6576278 (patch) | |
tree | a9de1452d820e43e9e548d2b77feb8f86eb21d98 /Source | |
parent | 3c101429a4e563f4c711cae84317806284784eb6 (diff) | |
download | CMake-96fc5d5d0701c98a5029469c8a9dcc6aa6576278.zip CMake-96fc5d5d0701c98a5029469c8a9dcc6aa6576278.tar.gz CMake-96fc5d5d0701c98a5029469c8a9dcc6aa6576278.tar.bz2 |
automoc: default to strict mode, use CMAKE_AUTOMOC_RELAXED_MODE
automoc now defaults to strict mode, also with Qt4, i.e. it behaves as
the documentation says by default. I also inverted the switch
CMAKE_AUTOMOC_STRICT_MODE to CMAKE_AUTOMOC_RELAXED_MODE.
Docs and test adapted accordingly.
Alex
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmDocumentVariables.cxx | 9 | ||||
-rw-r--r-- | Source/cmQtAutomoc.cxx | 12 | ||||
-rw-r--r-- | Source/cmQtAutomoc.h | 2 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 2 |
4 files changed, 10 insertions, 15 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index a0632a2..fe29df9 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -508,16 +508,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Variables That Change Behavior"); cm->DefineProperty - ("CMAKE_AUTOMOC_STRICT_MODE", cmProperty::VARIABLE, + ("CMAKE_AUTOMOC_RELAXED_MODE", cmProperty::VARIABLE, "Switch between strict and relaxed automoc mode.", - "When TRUE, automoc behaves exactly as described in the documentation " + "By default, automoc behaves exactly as described in the documentation " "of the AUTOMOC target property. " - "When set to FALSE, it accepts more input and tries to find the correct " + "When set to TRUE, it accepts more input and tries to find the correct " "input file for moc even if it differs from the documented behaviour. " "In this mode it e.g. also checks whether a header file is intended to " "be processed by moc when a \"foo.moc\" file has been included.\n" - "When using Qt4, CMAKE_AUTOMOC_STRICT_MODE is initialized to FALSE. " - "It also has to be set to FALSE for KDE4 compatibility.", + "Relaxed mode has to be enabled for KDE4 compatibility.", false, "Variables That Change Behavior"); diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index 65c7952..0b97436 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); } diff --git a/Source/cmQtAutomoc.h b/Source/cmQtAutomoc.h index a31f36a..8cbbac1 100644 --- a/Source/cmQtAutomoc.h +++ b/Source/cmQtAutomoc.h @@ -85,7 +85,7 @@ private: bool ColorOutput; bool RunMocFailed; bool GenerateAll; - bool StrictMode; + bool RelaxedMode; }; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index fc3c1c9..6a937b8 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -162,7 +162,7 @@ void cmTarget::DefineProperties(cmake *cm) "CMAKE_AUTOMOC if it is set when a target is created.\n" "Additional command line options for moc can be set via the " "AUTOMOC_MOC_OPTIONS property.\n" - "By setting the CMAKE_AUTOMOC_STRICT_MODE variable to FALSE the rules " + "By setting the CMAKE_AUTOMOC_RELAXED_MODE variable to TRUE the rules " "for searching the files which will be processed by moc can be relaxed. " "See the documentation for this variable for more details."); |