Add extra checks for the AUTOMOC target property.
In an upcoming commit, this class will be used even if it is not set.
This commit is contained in:
parent
32771fc7ca
commit
7ce65c3c97
|
@ -149,18 +149,22 @@ bool cmQtAutoGenerators::InitializeMocSourceFile(cmTarget* target)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string automocTargetName = target->GetName();
|
if (target->GetPropertyAsBool("AUTOMOC"))
|
||||||
automocTargetName += "_automoc";
|
{
|
||||||
std::string mocCppFile = makefile->GetCurrentOutputDirectory();
|
std::string automocTargetName = target->GetName();
|
||||||
mocCppFile += "/";
|
automocTargetName += "_automoc";
|
||||||
mocCppFile += automocTargetName;
|
std::string mocCppFile = makefile->GetCurrentOutputDirectory();
|
||||||
mocCppFile += ".cpp";
|
mocCppFile += "/";
|
||||||
cmSourceFile* mocCppSource = makefile->GetOrCreateSource(mocCppFile.c_str(),
|
mocCppFile += automocTargetName;
|
||||||
true);
|
mocCppFile += ".cpp";
|
||||||
makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
|
cmSourceFile* mocCppSource = makefile->GetOrCreateSource(
|
||||||
mocCppFile.c_str(), false);
|
mocCppFile.c_str(),
|
||||||
|
true);
|
||||||
|
makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES",
|
||||||
|
mocCppFile.c_str(), false);
|
||||||
|
|
||||||
target->AddSourceFile(mocCppSource);
|
target->AddSourceFile(mocCppSource);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,8 +317,11 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget* target)
|
||||||
std::map<std::string, std::string> configIncludes;
|
std::map<std::string, std::string> configIncludes;
|
||||||
std::map<std::string, std::string> configDefines;
|
std::map<std::string, std::string> configDefines;
|
||||||
|
|
||||||
this->SetupAutoMocTarget(target, autogenTargetName,
|
if (target->GetPropertyAsBool("AUTOMOC"))
|
||||||
configIncludes, configDefines);
|
{
|
||||||
|
this->SetupAutoMocTarget(target, autogenTargetName,
|
||||||
|
configIncludes, configDefines);
|
||||||
|
}
|
||||||
|
|
||||||
const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
|
const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT");
|
||||||
std::string inputFile = cmakeRoot;
|
std::string inputFile = cmakeRoot;
|
||||||
|
|
Loading…
Reference in New Issue