summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-06-19 18:42:32 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-06-19 18:42:32 (GMT)
commit8d198a71fc157343de56b0addcd987681639c127 (patch)
tree6d6065a49a2dbbfea03e60be4bf1c482057ad479
parentfbfddc70a452e3e2c9b6224cc27a3994bd9712f9 (diff)
parente4a2d5f9eeca03470192f0f0b4e3bc16ef33e084 (diff)
downloadCMake-8d198a71fc157343de56b0addcd987681639c127.zip
CMake-8d198a71fc157343de56b0addcd987681639c127.tar.gz
CMake-8d198a71fc157343de56b0addcd987681639c127.tar.bz2
Merge topic 'FailIfMocFails-13299'
e4a2d5f automoc: better error handling (#13299)
-rw-r--r--Source/cmQtAutomoc.cxx7
-rw-r--r--Source/cmake.cxx4
2 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index 113d678..65ecdf7 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -245,6 +245,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
bool cmQtAutomoc::Run(const char* targetDirectory)
{
+ bool success = true;
cmake cm;
cmGlobalGenerator* gg = this->CreateGlobalGenerator(&cm, targetDirectory);
cmMakefile* makefile = gg->GetCurrentLocalGenerator()->GetMakefile();
@@ -256,7 +257,7 @@ bool cmQtAutomoc::Run(const char* targetDirectory)
if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5")
{
- this->RunAutomoc();
+ success = this->RunAutomoc();
}
this->WriteOldMocDefinitionsFile(targetDirectory);
@@ -264,7 +265,7 @@ bool cmQtAutomoc::Run(const char* targetDirectory)
delete gg;
gg = NULL;
makefile = NULL;
- return true;
+ return success;
}
@@ -578,7 +579,7 @@ bool cmQtAutomoc::RunAutomoc()
if (this->RunMocFailed)
{
- std::cerr << "returning failed.."<< std::endl;
+ std::cerr << "moc failed..."<< std::endl;
return false;
}
outStream.flush();
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 2ffff42..451aec8 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1699,8 +1699,8 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
else if (args[1] == "cmake_automoc")
{
cmQtAutomoc automoc;
- automoc.Run(args[2].c_str());
- return 0;
+ bool automocSuccess = automoc.Run(args[2].c_str());
+ return automocSuccess ? 0 : 1;
}
#endif