From ca179f2afc6d8ab5e0df3e35255155c21a61b5f6 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 14:53:20 +0100 Subject: Autogen: Generators: Use FileAbsentOrOlder for MOC tests --- Source/cmQtAutoGenerators.cxx | 11 +++++++---- 1 file 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); -- cgit v0.12