diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-10-11 11:30:54 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-10-24 09:50:58 (GMT) |
commit | 7ce65c3c9738414213ae307005277c774daea669 (patch) | |
tree | 2eacf5e315f7b2f48bd427d372efd8c6637f0255 /Source/cmQtAutoGenerators.cxx | |
parent | 32771fc7ca959a90ef5e267831650323f3c0cf13 (diff) | |
download | CMake-7ce65c3c9738414213ae307005277c774daea669.zip CMake-7ce65c3c9738414213ae307005277c774daea669.tar.gz CMake-7ce65c3c9738414213ae307005277c774daea669.tar.bz2 |
Add extra checks for the AUTOMOC target property.
In an upcoming commit, this class will be used even if it is not set.
Diffstat (limited to 'Source/cmQtAutoGenerators.cxx')
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 4e75733..656bb0c 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -149,18 +149,22 @@ bool cmQtAutoGenerators::InitializeMocSourceFile(cmTarget* target) return false; } - std::string automocTargetName = target->GetName(); - automocTargetName += "_automoc"; - std::string mocCppFile = makefile->GetCurrentOutputDirectory(); - mocCppFile += "/"; - mocCppFile += automocTargetName; - mocCppFile += ".cpp"; - cmSourceFile* mocCppSource = makefile->GetOrCreateSource(mocCppFile.c_str(), - true); - makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", - mocCppFile.c_str(), false); - - target->AddSourceFile(mocCppSource); + if (target->GetPropertyAsBool("AUTOMOC")) + { + std::string automocTargetName = target->GetName(); + automocTargetName += "_automoc"; + std::string mocCppFile = makefile->GetCurrentOutputDirectory(); + mocCppFile += "/"; + mocCppFile += automocTargetName; + mocCppFile += ".cpp"; + cmSourceFile* mocCppSource = makefile->GetOrCreateSource( + mocCppFile.c_str(), + true); + makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", + mocCppFile.c_str(), false); + + target->AddSourceFile(mocCppSource); + } return true; } @@ -313,8 +317,11 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target) std::map<std::string, std::string> configIncludes; std::map<std::string, std::string> configDefines; - this->SetupAutoMocTarget(target, autogenTargetName, - configIncludes, configDefines); + if (target->GetPropertyAsBool("AUTOMOC")) + { + this->SetupAutoMocTarget(target, autogenTargetName, + configIncludes, configDefines); + } const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT"); std::string inputFile = cmakeRoot; |