Commit 8d198a71 authored by David Cole's avatar David Cole Committed by Kitware Robot

Merge topic 'FailIfMocFails-13299'

e4a2d5f9 automoc: better error handling (#13299)
parents fbfddc70 e4a2d5f9
...@@ -245,6 +245,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) ...@@ -245,6 +245,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
bool cmQtAutomoc::Run(const char* targetDirectory) bool cmQtAutomoc::Run(const char* targetDirectory)
{ {
bool success = true;
cmake cm; cmake cm;
cmGlobalGenerator* gg = this->CreateGlobalGenerator(&cm, targetDirectory); cmGlobalGenerator* gg = this->CreateGlobalGenerator(&cm, targetDirectory);
cmMakefile* makefile = gg->GetCurrentLocalGenerator()->GetMakefile(); cmMakefile* makefile = gg->GetCurrentLocalGenerator()->GetMakefile();
...@@ -256,7 +257,7 @@ bool cmQtAutomoc::Run(const char* targetDirectory) ...@@ -256,7 +257,7 @@ bool cmQtAutomoc::Run(const char* targetDirectory)
if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5") if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5")
{ {
this->RunAutomoc(); success = this->RunAutomoc();
} }
this->WriteOldMocDefinitionsFile(targetDirectory); this->WriteOldMocDefinitionsFile(targetDirectory);
...@@ -264,7 +265,7 @@ bool cmQtAutomoc::Run(const char* targetDirectory) ...@@ -264,7 +265,7 @@ bool cmQtAutomoc::Run(const char* targetDirectory)
delete gg; delete gg;
gg = NULL; gg = NULL;
makefile = NULL; makefile = NULL;
return true; return success;
} }
...@@ -578,7 +579,7 @@ bool cmQtAutomoc::RunAutomoc() ...@@ -578,7 +579,7 @@ bool cmQtAutomoc::RunAutomoc()
if (this->RunMocFailed) if (this->RunMocFailed)
{ {
std::cerr << "returning failed.."<< std::endl; std::cerr << "moc failed..."<< std::endl;
return false; return false;
} }
outStream.flush(); outStream.flush();
......
...@@ -1699,8 +1699,8 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args) ...@@ -1699,8 +1699,8 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
else if (args[1] == "cmake_automoc") else if (args[1] == "cmake_automoc")
{ {
cmQtAutomoc automoc; cmQtAutomoc automoc;
automoc.Run(args[2].c_str()); bool automocSuccess = automoc.Run(args[2].c_str());
return 0; return automocSuccess ? 0 : 1;
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment