diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-01-11 13:53:20 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-01-12 23:00:43 (GMT) |
commit | ca179f2afc6d8ab5e0df3e35255155c21a61b5f6 (patch) | |
tree | e09eaada69412b449fd7ba017581b9af6bd9e8c3 /Source | |
parent | 119791ae528aace81f6c209e05798c80d8926b3d (diff) | |
download | CMake-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.cxx | 11 |
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); |