summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-01-11 13:53:20 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-01-12 23:00:43 (GMT)
commitca179f2afc6d8ab5e0df3e35255155c21a61b5f6 (patch)
treee09eaada69412b449fd7ba017581b9af6bd9e8c3 /Source
parent119791ae528aace81f6c209e05798c80d8926b3d (diff)
downloadCMake-ca179f2afc6d8ab5e0df3e35255155c21a61b5f6.zip
CMake-ca179f2afc6d8ab5e0df3e35255155c21a61b5f6.tar.gz
CMake-ca179f2afc6d8ab5e0df3e35255155c21a61b5f6.tar.bz2
Autogen: Generators: Use FileAbsentOrOlder for MOC tests
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGenerators.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index c766d54..d4997d5 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1121,10 +1121,13 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile,
const std::string mocFileRel =
this->AutogenBuildSubDir + subDirPrefix + mocFileName;
const std::string mocFileAbs = this->CurrentBinaryDir + mocFileRel;
- int sourceNewerThanMoc = 0;
- bool success = cmsys::SystemTools::FileTimeCompare(sourceFile, mocFileAbs,
- &sourceNewerThanMoc);
- if (this->GenerateAll || !success || sourceNewerThanMoc >= 0) {
+
+ bool generateMoc = this->GenerateAll;
+ // Test if the source file is newer that the build file
+ if (!generateMoc) {
+ generateMoc = FileAbsentOrOlder(mocFileAbs, sourceFile);
+ }
+ if (generateMoc) {
// Log
this->LogBold("Generating MOC source " + mocFileRel);