From 52688bf7453cdb767e231f5fdc7d80ce79ae239d Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 13:41:14 +0100 Subject: Autogen: Generators: Sort methods by task --- Source/cmQtAutoGenerators.cxx | 236 ++++++++++++++++++++++-------------------- Source/cmQtAutoGenerators.h | 71 +++++++------ 2 files changed, 157 insertions(+), 150 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index f5c33fe..017fb04 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -27,6 +27,8 @@ #include #endif +// -- Static functions + static std::string findMatchingHeader( const std::string& absPath, const std::string& mocSubDir, const std::string& basename, @@ -95,6 +97,8 @@ static bool ListContains(const std::vector& list, return (std::find(list.begin(), list.end(), entry) != list.end()); } +// -- Class methods + cmQtAutoGenerators::cmQtAutoGenerators() : Verbose(cmsys::SystemTools::HasEnv("VERBOSE")) , ColorOutput(true) @@ -124,40 +128,6 @@ cmQtAutoGenerators::cmQtAutoGenerators() "[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]"); } -void cmQtAutoGenerators::MergeUicOptions( - std::vector& opts, const std::vector& fileOpts, - bool isQt5) -{ - static const char* valueOptions[] = { "tr", "translate", - "postfix", "generator", - "include", // Since Qt 5.3 - "g" }; - std::vector extraOpts; - for (std::vector::const_iterator it = fileOpts.begin(); - it != fileOpts.end(); ++it) { - std::vector::iterator existingIt = - std::find(opts.begin(), opts.end(), *it); - if (existingIt != opts.end()) { - const char* o = it->c_str(); - if (*o == '-') { - ++o; - } - if (isQt5 && *o == '-') { - ++o; - } - if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions), - cmStrCmp(*it)) != cmArrayEnd(valueOptions)) { - assert(existingIt + 1 != opts.end()); - *(existingIt + 1) = *(it + 1); - ++it; - } - } else { - extraOpts.push_back(*it); - } - } - opts.insert(opts.end(), extraOpts.begin(), extraOpts.end()); -} - bool cmQtAutoGenerators::Run(const std::string& targetDirectory, const std::string& config) { @@ -568,6 +538,60 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) } /** + * @brief Tests if the C++ content requires moc processing + * @return True if moc is required + */ +bool cmQtAutoGenerators::requiresMocing(const std::string& text, + std::string& macroName) +{ + // Run a simple check before an expensive regular expression check + if (strstr(text.c_str(), "Q_OBJECT") != CM_NULLPTR) { + if (this->RegExpQObject.find(text)) { + macroName = "Q_OBJECT"; + return true; + } + } + if (strstr(text.c_str(), "Q_GADGET") != CM_NULLPTR) { + if (this->RegExpQGadget.find(text)) { + macroName = "Q_GADGET"; + return true; + } + } + return false; +} + +/** + * @brief Tests if the file should be ignored for moc scanning + * @return True if the file should be ignored + */ +bool cmQtAutoGenerators::MocSkipTest(const std::string& absFilename) +{ + // Test if moc scanning is enabled + if (!this->MocExecutable.empty()) { + // Test if the file name is on the skip list + if (!ListContains(this->SkipMoc, absFilename)) { + return false; + } + } + return true; +} + +/** + * @brief Tests if the file name is in the skip list + */ +bool cmQtAutoGenerators::UicSkipTest(const std::string& absFilename) +{ + // Test if uic scanning is enabled + if (!this->UicExecutable.empty()) { + // Test if the file name is on the skip list + if (!ListContains(this->SkipUic, absFilename)) { + return false; + } + } + return true; +} + +/** * @return True on success */ bool cmQtAutoGenerators::ParseSourceFile( @@ -597,25 +621,6 @@ bool cmQtAutoGenerators::ParseSourceFile( return success; } -bool cmQtAutoGenerators::requiresMocing(const std::string& text, - std::string& macroName) -{ - // Run a simple check before an expensive regular expression check - if (strstr(text.c_str(), "Q_OBJECT") != CM_NULLPTR) { - if (this->RegExpQObject.find(text)) { - macroName = "Q_OBJECT"; - return true; - } - } - if (strstr(text.c_str(), "Q_GADGET") != CM_NULLPTR) { - if (this->RegExpQGadget.find(text)) { - macroName = "Q_GADGET"; - return true; - } - } - return false; -} - void cmQtAutoGenerators::ParseContentForUic( const std::string& absFilename, const std::string& contentsString, std::map >& includedUis) @@ -1104,6 +1109,40 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile, return false; } +void cmQtAutoGenerators::MergeUicOptions( + std::vector& opts, const std::vector& fileOpts, + bool isQt5) +{ + static const char* valueOptions[] = { "tr", "translate", + "postfix", "generator", + "include", // Since Qt 5.3 + "g" }; + std::vector extraOpts; + for (std::vector::const_iterator it = fileOpts.begin(); + it != fileOpts.end(); ++it) { + std::vector::iterator existingIt = + std::find(opts.begin(), opts.end(), *it); + if (existingIt != opts.end()) { + const char* o = it->c_str(); + if (*o == '-') { + ++o; + } + if (isQt5 && *o == '-') { + ++o; + } + if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions), + cmStrCmp(*it)) != cmArrayEnd(valueOptions)) { + assert(existingIt + 1 != opts.end()); + *(existingIt + 1) = *(it + 1); + ++it; + } + } else { + extraOpts.push_back(*it); + } + } + opts.insert(opts.end(), extraOpts.begin(), extraOpts.end()); +} + bool cmQtAutoGenerators::GenerateUiFiles( const std::map >& includedUis) { @@ -1365,67 +1404,6 @@ bool cmQtAutoGenerators::GenerateQrc(const std::string& qrcInputFile, return false; } -/** - * @brief Tests if the file should be ignored for moc scanning - * @return True if the file should be ignored - */ -bool cmQtAutoGenerators::MocSkipTest(const std::string& absFilename) -{ - // Test if moc scanning is enabled - if (!this->MocExecutable.empty()) { - // Test if the file name is on the skip list - if (!ListContains(this->SkipMoc, absFilename)) { - return false; - } - } - return true; -} - -/** - * @brief Tests if the file name is in the skip list - */ -bool cmQtAutoGenerators::UicSkipTest(const std::string& absFilename) -{ - // Test if uic scanning is enabled - if (!this->UicExecutable.empty()) { - // Test if the file name is on the skip list - if (!ListContains(this->SkipUic, absFilename)) { - return false; - } - } - return true; -} - -/** - * @brief Collects name collisions as output/input pairs - * @return True if there were collisions - */ -bool cmQtAutoGenerators::NameCollisionTest( - const std::map& genFiles, - std::multimap& collisions) -{ - typedef std::map::const_iterator Iter; - typedef std::map::value_type VType; - for (Iter ait = genFiles.begin(); ait != genFiles.end(); ++ait) { - bool first_match(true); - for (Iter bit = (++Iter(ait)); bit != genFiles.end(); ++bit) { - if (ait->second == bit->second) { - if (first_match) { - if (collisions.find(ait->second) != collisions.end()) { - // We already know of this collision from before - break; - } - collisions.insert(VType(ait->second, ait->first)); - first_match = false; - } - collisions.insert(VType(bit->second, bit->first)); - } - } - } - - return !collisions.empty(); -} - void cmQtAutoGenerators::LogErrorNameCollision( const std::string& message, const std::multimap& collisions) @@ -1485,6 +1463,36 @@ void cmQtAutoGenerators::LogCommand(const std::vector& command) } /** + * @brief Collects name collisions as output/input pairs + * @return True if there were collisions + */ +bool cmQtAutoGenerators::NameCollisionTest( + const std::map& genFiles, + std::multimap& collisions) +{ + typedef std::map::const_iterator Iter; + typedef std::map::value_type VType; + for (Iter ait = genFiles.begin(); ait != genFiles.end(); ++ait) { + bool first_match(true); + for (Iter bit = (++Iter(ait)); bit != genFiles.end(); ++bit) { + if (ait->second == bit->second) { + if (first_match) { + if (collisions.find(ait->second) != collisions.end()) { + // We already know of this collision from before + break; + } + collisions.insert(VType(ait->second, ait->first)); + first_match = false; + } + collisions.insert(VType(bit->second, bit->first)); + } + } + } + + return !collisions.empty(); +} + +/** * @brief Generates the parent directory of the given file on demand * @return True on success */ diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index d0c7066..18648e6 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -22,6 +22,7 @@ public: bool Run(const std::string& targetDirectory, const std::string& config); private: + // - Configuration bool ReadAutogenInfoFile(cmMakefile* makefile, const std::string& targetDirectory, const std::string& config); @@ -29,25 +30,16 @@ private: const std::string& targetDirectory); bool WriteOldMocDefinitionsFile(const std::string& targetDirectory); - std::string MakeCompileSettingsString(cmMakefile* makefile); + static std::string MakeCompileSettingsString(cmMakefile* makefile); + // - Init and run + void Init(); bool RunAutogen(cmMakefile* makefile); - bool GenerateMocFiles( - const std::map& includedMocs, - const std::map& notIncludedMocs); - bool GenerateMoc(const std::string& sourceFile, - const std::string& mocFileName, - const std::string& subDirPrefix); - - bool GenerateUiFiles( - const std::map >& includedUis); - bool GenerateUi(const std::string& realName, const std::string& uiInputFile, - const std::string& uiOutputFile); - - bool GenerateQrcFiles(); - bool GenerateQrc(const std::string& qrcInputFile, - const std::string& qrcOutputFile, bool unique_n); + // - Content analysis + bool requiresMocing(const std::string& text, std::string& macroName); + bool MocSkipTest(const std::string& absFilename); + bool UicSkipTest(const std::string& absFilename); bool ParseSourceFile( const std::string& absFilename, @@ -55,6 +47,7 @@ private: std::map& includedMocs, std::map >& includedUis, bool relaxed); + void SearchHeadersForSourceFile( const std::string& absFilename, const std::vector& headerExtensions, @@ -68,8 +61,6 @@ private: std::map& notIncludedMocs, std::map >& includedUis); - bool requiresMocing(const std::string& text, std::string& macroName); - void ParseContentForUic( const std::string& fileName, const std::string& contentsString, std::map >& includedUis); @@ -80,18 +71,31 @@ private: std::map& includedMocs, bool relaxed); - void ParseForUic( - const std::string& fileName, - std::map >& includedUis); - - void Init(); + // - Moc file generation + bool GenerateMocFiles( + const std::map& includedMocs, + const std::map& notIncludedMocs); + bool GenerateMoc(const std::string& sourceFile, + const std::string& mocFileName, + const std::string& subDirPrefix); - bool MocSkipTest(const std::string& absFilename); - bool UicSkipTest(const std::string& absFilename); + // - Uic file generation + static void MergeUicOptions(std::vector& opts, + const std::vector& fileOpts, + bool isQt5); + bool GenerateUiFiles( + const std::map >& includedUis); + bool GenerateUi(const std::string& realName, const std::string& uiInputFile, + const std::string& uiOutputFile); - bool NameCollisionTest(const std::map& genFiles, - std::multimap& collisions); + // - Qrc file generation + bool InputFilesNewerThanQrc(const std::string& qrcFile, + const std::string& rccOutput); + bool GenerateQrcFiles(); + bool GenerateQrc(const std::string& qrcInputFile, + const std::string& qrcOutputFile, bool unique_n); + // - Logging void LogErrorNameCollision( const std::string& message, const std::multimap& collisions); @@ -101,16 +105,11 @@ private: void LogError(const std::string& message); void LogCommand(const std::vector& command); + // - Utility + bool NameCollisionTest(const std::map& genFiles, + std::multimap& collisions); bool MakeParentDirectory(const std::string& filename); - - std::string JoinExts(const std::vector& lst); - - static void MergeUicOptions(std::vector& opts, - const std::vector& fileOpts, - bool isQt5); - - bool InputFilesNewerThanQrc(const std::string& qrcFile, - const std::string& rccOutput); + static std::string JoinExts(const std::vector& lst); // - Target names std::string OriginTargetName; -- cgit v0.12 From 6d333be14d23b9aaf4452189199134bd674ad395 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 13:47:26 +0100 Subject: Autogen: Generators: Static function upper case rename --- Source/cmQtAutoGenerators.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 017fb04..2c9310e 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -29,7 +29,7 @@ // -- Static functions -static std::string findMatchingHeader( +static std::string FindMatchingHeader( const std::string& absPath, const std::string& mocSubDir, const std::string& basename, const std::vector& headerExtensions) @@ -700,7 +700,7 @@ bool cmQtAutoGenerators::ParseContentForMoc( basename = basename.substr(4); const std::string mocSubDir = extractSubDir(scannedFileAbsPath, currentMoc); - const std::string headerToMoc = findMatchingHeader( + const std::string headerToMoc = FindMatchingHeader( scannedFileAbsPath, mocSubDir, basename, headerExtensions); if (!headerToMoc.empty()) { @@ -733,7 +733,7 @@ bool cmQtAutoGenerators::ParseContentForMoc( if (!requiresMoc || basename != scannedFileBasename) { const std::string mocSubDir = extractSubDir(scannedFileAbsPath, currentMoc); - const std::string headerToMoc = findMatchingHeader( + const std::string headerToMoc = FindMatchingHeader( scannedFileAbsPath, mocSubDir, basename, headerExtensions); if (!headerToMoc.empty()) { // This is for KDE4 compatibility: -- cgit v0.12 From 29112c9a695a8dce6486203d0415f17ac41d3a0b Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 13:47:43 +0100 Subject: Autogen: Generators: Static function upper case rename --- Source/cmQtAutoGenerators.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 2c9310e..57b9450 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -55,7 +55,7 @@ static std::string FindMatchingHeader( return header; } -static std::string extractSubDir(const std::string& absPath, +static std::string ExtractSubDir(const std::string& absPath, const std::string& currentMoc) { std::string subDir; @@ -699,7 +699,7 @@ bool cmQtAutoGenerators::ParseContentForMoc( // finding the correct header, so we need to remove the moc_ part basename = basename.substr(4); const std::string mocSubDir = - extractSubDir(scannedFileAbsPath, currentMoc); + ExtractSubDir(scannedFileAbsPath, currentMoc); const std::string headerToMoc = FindMatchingHeader( scannedFileAbsPath, mocSubDir, basename, headerExtensions); @@ -732,7 +732,7 @@ bool cmQtAutoGenerators::ParseContentForMoc( // Mode: Relaxed if (!requiresMoc || basename != scannedFileBasename) { const std::string mocSubDir = - extractSubDir(scannedFileAbsPath, currentMoc); + ExtractSubDir(scannedFileAbsPath, currentMoc); const std::string headerToMoc = FindMatchingHeader( scannedFileAbsPath, mocSubDir, basename, headerExtensions); if (!headerToMoc.empty()) { -- cgit v0.12 From 1491ab1c6626ed6a3b67e74b94fd18230e1bb4d4 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 13:51:31 +0100 Subject: Autogen: Generators: Make class static method a source static function --- Source/cmQtAutoGenerators.cxx | 71 +++++++++++++++++++++---------------------- Source/cmQtAutoGenerators.h | 3 -- 2 files changed, 35 insertions(+), 39 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 57b9450..ea55064 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -97,6 +97,40 @@ static bool ListContains(const std::vector& list, return (std::find(list.begin(), list.end(), entry) != list.end()); } +static void UicMergeOptions(std::vector& opts, + const std::vector& fileOpts, + bool isQt5) +{ + static const char* valueOptions[] = { "tr", "translate", + "postfix", "generator", + "include", // Since Qt 5.3 + "g" }; + std::vector extraOpts; + for (std::vector::const_iterator it = fileOpts.begin(); + it != fileOpts.end(); ++it) { + std::vector::iterator existingIt = + std::find(opts.begin(), opts.end(), *it); + if (existingIt != opts.end()) { + const char* o = it->c_str(); + if (*o == '-') { + ++o; + } + if (isQt5 && *o == '-') { + ++o; + } + if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions), + cmStrCmp(*it)) != cmArrayEnd(valueOptions)) { + assert(existingIt + 1 != opts.end()); + *(existingIt + 1) = *(it + 1); + ++it; + } + } else { + extraOpts.push_back(*it); + } + } + opts.insert(opts.end(), extraOpts.begin(), extraOpts.end()); +} + // -- Class methods cmQtAutoGenerators::cmQtAutoGenerators() @@ -1109,40 +1143,6 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile, return false; } -void cmQtAutoGenerators::MergeUicOptions( - std::vector& opts, const std::vector& fileOpts, - bool isQt5) -{ - static const char* valueOptions[] = { "tr", "translate", - "postfix", "generator", - "include", // Since Qt 5.3 - "g" }; - std::vector extraOpts; - for (std::vector::const_iterator it = fileOpts.begin(); - it != fileOpts.end(); ++it) { - std::vector::iterator existingIt = - std::find(opts.begin(), opts.end(), *it); - if (existingIt != opts.end()) { - const char* o = it->c_str(); - if (*o == '-') { - ++o; - } - if (isQt5 && *o == '-') { - ++o; - } - if (std::find_if(cmArrayBegin(valueOptions), cmArrayEnd(valueOptions), - cmStrCmp(*it)) != cmArrayEnd(valueOptions)) { - assert(existingIt + 1 != opts.end()); - *(existingIt + 1) = *(it + 1); - ++it; - } - } else { - extraOpts.push_back(*it); - } - } - opts.insert(opts.end(), extraOpts.begin(), extraOpts.end()); -} - bool cmQtAutoGenerators::GenerateUiFiles( const std::map >& includedUis) { @@ -1235,8 +1235,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName, if (optionIt != this->UicOptions.end()) { std::vector fileOpts; cmSystemTools::ExpandListArgument(optionIt->second, fileOpts); - cmQtAutoGenerators::MergeUicOptions(opts, fileOpts, - this->QtMajorVersion == "5"); + UicMergeOptions(opts, fileOpts, this->QtMajorVersion == "5"); } command.insert(command.end(), opts.begin(), opts.end()); diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 18648e6..ed17dcd 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -80,9 +80,6 @@ private: const std::string& subDirPrefix); // - Uic file generation - static void MergeUicOptions(std::vector& opts, - const std::vector& fileOpts, - bool isQt5); bool GenerateUiFiles( const std::map >& includedUis); bool GenerateUi(const std::string& realName, const std::string& uiInputFile, -- cgit v0.12 From 6c55755bdd54c2d474e2c8fe4c9d078e10404f26 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 13:56:13 +0100 Subject: Autogen: Generators: Make class static method a source static function --- Source/cmQtAutoGenerators.cxx | 40 ++++++++++++++++++++-------------------- Source/cmQtAutoGenerators.h | 1 - 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index ea55064..73afdc1 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -97,6 +97,25 @@ static bool ListContains(const std::vector& list, return (std::find(list.begin(), list.end(), entry) != list.end()); } +static std::string JoinExts(const std::vector& lst) +{ + if (lst.empty()) { + return ""; + } + + std::string result; + std::string separator = ","; + for (std::vector::const_iterator it = lst.begin(); + it != lst.end(); ++it) { + if (it != lst.begin()) { + result += separator; + } + result += '.' + (*it); + } + result.erase(result.end() - 1); + return result; +} + static void UicMergeOptions(std::vector& opts, const std::vector& fileOpts, bool isQt5) @@ -749,7 +768,7 @@ bool cmQtAutoGenerators::ParseContentForMoc( err << "AutoMoc: Error: " << absFilename << "\n" << "The file includes the moc file \"" << currentMoc << "\", but could not find header \"" << basename << '{' - << this->JoinExts(headerExtensions) << "}\" "; + << JoinExts(headerExtensions) << "}\" "; if (mocSubDir.empty()) { err << "in " << scannedFileAbsPath << "\n"; } else { @@ -1509,22 +1528,3 @@ bool cmQtAutoGenerators::MakeParentDirectory(const std::string& filename) } return success; } - -std::string cmQtAutoGenerators::JoinExts(const std::vector& lst) -{ - if (lst.empty()) { - return ""; - } - - std::string result; - std::string separator = ","; - for (std::vector::const_iterator it = lst.begin(); - it != lst.end(); ++it) { - if (it != lst.begin()) { - result += separator; - } - result += '.' + (*it); - } - result.erase(result.end() - 1); - return result; -} diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index ed17dcd..b9d670a 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -106,7 +106,6 @@ private: bool NameCollisionTest(const std::map& genFiles, std::multimap& collisions); bool MakeParentDirectory(const std::string& filename); - static std::string JoinExts(const std::vector& lst); // - Target names std::string OriginTargetName; -- cgit v0.12 From 95e4cfc5947fb5a324f6dad50cff8d71f928aba8 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 14:05:41 +0100 Subject: Autogen: Generators: Simplify (and fix) JoinExts function --- Source/cmQtAutoGenerators.cxx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 73afdc1..f3fa047 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -99,20 +99,18 @@ static bool ListContains(const std::vector& list, static std::string JoinExts(const std::vector& lst) { - if (lst.empty()) { - return ""; - } - std::string result; - std::string separator = ","; - for (std::vector::const_iterator it = lst.begin(); - it != lst.end(); ++it) { - if (it != lst.begin()) { - result += separator; + if (!lst.empty()) { + const std::string separator = ","; + for (std::vector::const_iterator it = lst.begin(); + it != lst.end(); ++it) { + if (it != lst.begin()) { + result += separator; + } + result += '.'; + result += *it; } - result += '.' + (*it); } - result.erase(result.end() - 1); return result; } -- cgit v0.12 From 119791ae528aace81f6c209e05798c80d8926b3d Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 14:45:04 +0100 Subject: Autogen: Generators: Introduce FileAbsentOrOlder function --- Source/cmQtAutoGenerators.cxx | 54 ++++++++++++++++++++++++------------------- Source/cmQtAutoGenerators.h | 2 -- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index f3fa047..c766d54 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -91,6 +91,19 @@ static std::string ReadAll(const std::string& filename) return stream.str(); } +/** + * @brief Tests if buildFile doesn't exist or is older than sourceFile + * @return True if buildFile doesn't exist or is older than sourceFile + */ +static bool FileAbsentOrOlder(const std::string& buildFile, + const std::string& sourceFile) +{ + int result = 0; + bool success = + cmsys::SystemTools::FileTimeCompare(buildFile, sourceFile, &result); + return (!success || (result <= 0)); +} + static bool ListContains(const std::vector& list, const std::string& entry) { @@ -1284,22 +1297,6 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName, return false; } -bool cmQtAutoGenerators::InputFilesNewerThanQrc(const std::string& qrcFile, - const std::string& rccOutput) -{ - std::vector const& files = this->RccInputs[qrcFile]; - for (std::vector::const_iterator it = files.begin(); - it != files.end(); ++it) { - int inputNewerThanQrc = 0; - bool success = - cmsys::SystemTools::FileTimeCompare(*it, rccOutput, &inputNewerThanQrc); - if (!success || inputNewerThanQrc >= 0) { - return true; - } - } - return false; -} - bool cmQtAutoGenerators::GenerateQrcFiles() { // generate single map with input / output names @@ -1361,14 +1358,23 @@ bool cmQtAutoGenerators::GenerateQrc(const std::string& qrcInputFile, const std::string qrcBuildFile = this->CurrentBinaryDir + qrcOutputFile; - int sourceNewerThanQrc = 0; - bool generateQrc = !cmsys::SystemTools::FileTimeCompare( - qrcInputFile, qrcBuildFile, &sourceNewerThanQrc); - generateQrc = generateQrc || (sourceNewerThanQrc >= 0); - generateQrc = - generateQrc || this->InputFilesNewerThanQrc(qrcInputFile, qrcBuildFile); - - if (this->GenerateAll || generateQrc) { + bool generateQrc = this->GenerateAll; + // Test if the resources list file is newer than build file + if (!generateQrc) { + generateQrc = FileAbsentOrOlder(qrcBuildFile, qrcInputFile); + } + // Test if any resource file is newer than the build file + if (!generateQrc) { + const std::vector& files = this->RccInputs[qrcInputFile]; + for (std::vector::const_iterator it = files.begin(); + it != files.end(); ++it) { + if (FileAbsentOrOlder(qrcBuildFile, *it)) { + generateQrc = true; + break; + } + } + } + if (generateQrc) { { std::string msg = "Generating RCC source "; msg += qrcOutputFile; diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index b9d670a..3223c6d 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -86,8 +86,6 @@ private: const std::string& uiOutputFile); // - Qrc file generation - bool InputFilesNewerThanQrc(const std::string& qrcFile, - const std::string& rccOutput); bool GenerateQrcFiles(); bool GenerateQrc(const std::string& qrcInputFile, const std::string& qrcOutputFile, bool unique_n); -- cgit v0.12 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 From 06430919f4b903ba256ce158caf223f515faa8a4 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 14:56:44 +0100 Subject: Autogen: Generators: Use FileAbsentOrOlder for UIC tests --- Source/cmQtAutoGenerators.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index d4997d5..645ecc0 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1246,10 +1246,12 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName, this->AutogenBuildSubDir + "include/" + uiOutputFile; const std::string uicFileAbs = this->CurrentBinaryDir + uicFileRel; - int sourceNewerThanUi = 0; - bool success = cmsys::SystemTools::FileTimeCompare(uiInputFile, uicFileAbs, - &sourceNewerThanUi); - if (this->GenerateAll || !success || sourceNewerThanUi >= 0) { + bool generateUic = this->GenerateAll; + // Test if the source file is newer that the build file + if (!generateUic) { + generateUic = FileAbsentOrOlder(uicFileAbs, uiInputFile); + } + if (generateUic) { // Log this->LogBold("Generating UIC header " + uicFileRel); -- cgit v0.12 From edf0b8a52bd4db8557adaf11d7096f7982c373aa Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 15:08:24 +0100 Subject: Autogen: Generators: Rename GenerateFoo methods to FooGenerate --- Source/cmQtAutoGenerators.cxx | 38 +++++++++++++++++++------------------- Source/cmQtAutoGenerators.h | 21 +++++++++++---------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 645ecc0..c088f43 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -583,17 +583,17 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) // Generate files if (!this->MocExecutable.empty()) { - if (!this->GenerateMocFiles(includedMocs, notIncludedMocs)) { + if (!this->MocGenerateAll(includedMocs, notIncludedMocs)) { return false; } } if (!this->UicExecutable.empty()) { - if (!this->GenerateUiFiles(includedUis)) { + if (!this->UicGenerateAll(includedUis)) { return false; } } if (!this->RccExecutable.empty()) { - if (!this->GenerateQrcFiles()) { + if (!this->QrcGenerateAll()) { return false; } } @@ -990,7 +990,7 @@ void cmQtAutoGenerators::ParseHeaders( } } -bool cmQtAutoGenerators::GenerateMocFiles( +bool cmQtAutoGenerators::MocGenerateAll( const std::map& includedMocs, const std::map& notIncludedMocs) { @@ -1020,7 +1020,7 @@ bool cmQtAutoGenerators::GenerateMocFiles( for (std::map::const_iterator it = includedMocs.begin(); it != includedMocs.end(); ++it) { - if (!this->GenerateMoc(it->first, it->second, subDirPrefix)) { + if (!this->MocGenerateFile(it->first, it->second, subDirPrefix)) { if (this->RunMocFailed) { return false; } @@ -1035,7 +1035,7 @@ bool cmQtAutoGenerators::GenerateMocFiles( for (std::map::const_iterator it = notIncludedMocs.begin(); it != notIncludedMocs.end(); ++it) { - if (this->GenerateMoc(it->first, it->second, subDirPrefix)) { + if (this->MocGenerateFile(it->first, it->second, subDirPrefix)) { automocCppChanged = true; } else { if (this->RunMocFailed) { @@ -1114,9 +1114,9 @@ bool cmQtAutoGenerators::GenerateMocFiles( /** * @return True if a moc file was created. False may indicate an error. */ -bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile, - const std::string& mocFileName, - const std::string& subDirPrefix) +bool cmQtAutoGenerators::MocGenerateFile(const std::string& sourceFile, + const std::string& mocFileName, + const std::string& subDirPrefix) { const std::string mocFileRel = this->AutogenBuildSubDir + subDirPrefix + mocFileName; @@ -1176,7 +1176,7 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile, return false; } -bool cmQtAutoGenerators::GenerateUiFiles( +bool cmQtAutoGenerators::UicGenerateAll( const std::map >& includedUis) { // single map with input / output names @@ -1224,7 +1224,7 @@ bool cmQtAutoGenerators::GenerateUiFiles( for (std::map::const_iterator sit = it->second.begin(); sit != it->second.end(); ++sit) { - if (!this->GenerateUi(it->first, sit->first, sit->second)) { + if (!this->UicGenerateFile(it->first, sit->first, sit->second)) { if (this->RunUicFailed) { return false; } @@ -1238,9 +1238,9 @@ bool cmQtAutoGenerators::GenerateUiFiles( /** * @return True if a uic file was created. False may indicate an error. */ -bool cmQtAutoGenerators::GenerateUi(const std::string& realName, - const std::string& uiInputFile, - const std::string& uiOutputFile) +bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName, + const std::string& uiInputFile, + const std::string& uiOutputFile) { const std::string uicFileRel = this->AutogenBuildSubDir + "include/" + uiOutputFile; @@ -1302,7 +1302,7 @@ bool cmQtAutoGenerators::GenerateUi(const std::string& realName, return false; } -bool cmQtAutoGenerators::GenerateQrcFiles() +bool cmQtAutoGenerators::QrcGenerateAll() { // generate single map with input / output names std::map qrcGenMap; @@ -1335,7 +1335,7 @@ bool cmQtAutoGenerators::GenerateQrcFiles() qrcGenMap.begin(); si != qrcGenMap.end(); ++si) { bool unique = FileNameIsUnique(si->first, qrcGenMap); - if (!this->GenerateQrc(si->first, si->second, unique)) { + if (!this->QrcGenerateFile(si->first, si->second, unique)) { if (this->RunRccFailed) { return false; } @@ -1347,9 +1347,9 @@ bool cmQtAutoGenerators::GenerateQrcFiles() /** * @return True if a rcc file was created. False may indicate an error. */ -bool cmQtAutoGenerators::GenerateQrc(const std::string& qrcInputFile, - const std::string& qrcOutputFile, - bool unique_n) +bool cmQtAutoGenerators::QrcGenerateFile(const std::string& qrcInputFile, + const std::string& qrcOutputFile, + bool unique_n) { std::string symbolName = cmsys::SystemTools::GetFilenameWithoutLastExtension(qrcInputFile); diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 3223c6d..c2be22c 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -72,23 +72,24 @@ private: bool relaxed); // - Moc file generation - bool GenerateMocFiles( + bool MocGenerateAll( const std::map& includedMocs, const std::map& notIncludedMocs); - bool GenerateMoc(const std::string& sourceFile, - const std::string& mocFileName, - const std::string& subDirPrefix); + bool MocGenerateFile(const std::string& sourceFile, + const std::string& mocFileName, + const std::string& subDirPrefix); // - Uic file generation - bool GenerateUiFiles( + bool UicGenerateAll( const std::map >& includedUis); - bool GenerateUi(const std::string& realName, const std::string& uiInputFile, - const std::string& uiOutputFile); + bool UicGenerateFile(const std::string& realName, + const std::string& uiInputFile, + const std::string& uiOutputFile); // - Qrc file generation - bool GenerateQrcFiles(); - bool GenerateQrc(const std::string& qrcInputFile, - const std::string& qrcOutputFile, bool unique_n); + bool QrcGenerateAll(); + bool QrcGenerateFile(const std::string& qrcInputFile, + const std::string& qrcOutputFile, bool unique_n); // - Logging void LogErrorNameCollision( -- cgit v0.12 From 2b400b242101fd8b7a46073412830278aa3cc9ec Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 15:12:41 +0100 Subject: Autogen: Generators: Move moc/uic/rcc executable test to generate method --- Source/cmQtAutoGenerators.cxx | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index c088f43..4f5af3a 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -582,20 +582,14 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) notIncludedMocs, includedUis); // Generate files - if (!this->MocExecutable.empty()) { - if (!this->MocGenerateAll(includedMocs, notIncludedMocs)) { - return false; - } + if (!this->MocGenerateAll(includedMocs, notIncludedMocs)) { + return false; } - if (!this->UicExecutable.empty()) { - if (!this->UicGenerateAll(includedUis)) { - return false; - } + if (!this->UicGenerateAll(includedUis)) { + return false; } - if (!this->RccExecutable.empty()) { - if (!this->QrcGenerateAll()) { - return false; - } + if (!this->QrcGenerateAll()) { + return false; } return true; @@ -994,6 +988,10 @@ bool cmQtAutoGenerators::MocGenerateAll( const std::map& includedMocs, const std::map& notIncludedMocs) { + if (this->MocExecutable.empty()) { + return true; + } + // look for name collisions { std::multimap collisions; @@ -1179,6 +1177,10 @@ bool cmQtAutoGenerators::MocGenerateFile(const std::string& sourceFile, bool cmQtAutoGenerators::UicGenerateAll( const std::map >& includedUis) { + if (this->UicExecutable.empty()) { + return true; + } + // single map with input / output names std::map > uiGenMap; std::map testMap; @@ -1304,6 +1306,10 @@ bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName, bool cmQtAutoGenerators::QrcGenerateAll() { + if (this->RccExecutable.empty()) { + return true; + } + // generate single map with input / output names std::map qrcGenMap; for (std::vector::const_iterator si = this->RccSources.begin(); -- cgit v0.12 From 597124ba8e409edc28cbf8f2a55150d2913a50e3 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 20:27:15 +0100 Subject: Autogen: Generators: Add function to read makefile definitions config aware --- Source/cmQtAutoGenerators.cxx | 104 +++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 57 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 4f5af3a..8d525dc 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -29,6 +29,22 @@ // -- Static functions +static std::string GetConfigDefinition(cmMakefile* makefile, + const std::string& key, + const std::string& config) +{ + std::string keyConf = key; + if (!config.empty()) { + keyConf += "_"; + keyConf += config; + } + const char* valueConf = makefile->GetDefinition(keyConf); + if (valueConf != CM_NULLPTR) { + return valueConf; + } + return makefile->GetSafeDefinition(key); +} + static std::string FindMatchingHeader( const std::string& absPath, const std::string& mocSubDir, const std::string& basename, @@ -269,55 +285,30 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( // - Moc cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition("AM_SKIP_MOC"), this->SkipMoc); - { - std::string compileDefsPropOrig = "AM_MOC_COMPILE_DEFINITIONS"; - std::string compileDefsProp = compileDefsPropOrig; - if (!config.empty()) { - compileDefsProp += "_"; - compileDefsProp += config; - } - const char* compileDefs = makefile->GetDefinition(compileDefsProp); - this->MocCompileDefinitionsStr = compileDefs - ? compileDefs - : makefile->GetSafeDefinition(compileDefsPropOrig); - } - { - std::string includesPropOrig = "AM_MOC_INCLUDES"; - std::string includesProp = includesPropOrig; - if (!config.empty()) { - includesProp += "_"; - includesProp += config; - } - const char* includes = makefile->GetDefinition(includesProp); - this->MocIncludesStr = - includes ? includes : makefile->GetSafeDefinition(includesPropOrig); - } + this->MocCompileDefinitionsStr = + GetConfigDefinition(makefile, "AM_MOC_COMPILE_DEFINITIONS", config); + this->MocIncludesStr = + GetConfigDefinition(makefile, "AM_MOC_INCLUDES", config); this->MocOptionsStr = makefile->GetSafeDefinition("AM_MOC_OPTIONS"); // - Uic cmSystemTools::ExpandListArgument(makefile->GetSafeDefinition("AM_SKIP_UIC"), this->SkipUic); + cmSystemTools::ExpandListArgument( + GetConfigDefinition(makefile, "AM_UIC_TARGET_OPTIONS", config), + this->UicTargetOptions); { - const char* uicOptionsFiles = - makefile->GetSafeDefinition("AM_UIC_OPTIONS_FILES"); - std::string uicOptionsPropOrig = "AM_UIC_TARGET_OPTIONS"; - std::string uicOptionsProp = uicOptionsPropOrig; - if (!config.empty()) { - uicOptionsProp += "_"; - uicOptionsProp += config; - } - const char* uicTargetOptions = makefile->GetSafeDefinition(uicOptionsProp); - cmSystemTools::ExpandListArgument( - uicTargetOptions ? uicTargetOptions - : makefile->GetSafeDefinition(uicOptionsPropOrig), - this->UicTargetOptions); - const char* uicOptionsOptions = - makefile->GetSafeDefinition("AM_UIC_OPTIONS_OPTIONS"); std::vector uicFilesVec; - cmSystemTools::ExpandListArgument(uicOptionsFiles, uicFilesVec); std::vector uicOptionsVec; - cmSystemTools::ExpandListArgument(uicOptionsOptions, uicOptionsVec); + cmSystemTools::ExpandListArgument( + makefile->GetSafeDefinition("AM_UIC_OPTIONS_FILES"), uicFilesVec); + cmSystemTools::ExpandListArgument( + makefile->GetSafeDefinition("AM_UIC_OPTIONS_OPTIONS"), uicOptionsVec); if (uicFilesVec.size() != uicOptionsVec.size()) { + std::ostringstream err; + err << "AutoGen: Error: Uic files/options lists size missmatch in: " + << filename << std::endl; + this->LogError(err.str()); return false; } for (std::vector::iterator fileIt = uicFilesVec.begin(), @@ -329,20 +320,20 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( } // - Rcc + cmSystemTools::ExpandListArgument( + makefile->GetSafeDefinition("AM_RCC_SOURCES"), this->RccSources); { - std::string rccSources = makefile->GetSafeDefinition("AM_RCC_SOURCES"); - cmSystemTools::ExpandListArgument(rccSources, this->RccSources); - } - { - const char* rccOptionsFiles = - makefile->GetSafeDefinition("AM_RCC_OPTIONS_FILES"); - const char* rccOptionsOptions = - makefile->GetSafeDefinition("AM_RCC_OPTIONS_OPTIONS"); std::vector rccFilesVec; - cmSystemTools::ExpandListArgument(rccOptionsFiles, rccFilesVec); std::vector rccOptionsVec; - cmSystemTools::ExpandListArgument(rccOptionsOptions, rccOptionsVec); + cmSystemTools::ExpandListArgument( + makefile->GetSafeDefinition("AM_RCC_OPTIONS_FILES"), rccFilesVec); + cmSystemTools::ExpandListArgument( + makefile->GetSafeDefinition("AM_RCC_OPTIONS_OPTIONS"), rccOptionsVec); if (rccFilesVec.size() != rccOptionsVec.size()) { + std::ostringstream err; + err << "AutoGen: Error: RCC files/options lists size missmatch in: " + << filename << std::endl; + this->LogError(err.str()); return false; } for (std::vector::iterator fileIt = rccFilesVec.begin(), @@ -351,10 +342,11 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( cmSystemTools::ReplaceString(*optionIt, "@list_sep@", ";"); this->RccOptions[*fileIt] = *optionIt; } - - const char* rccInputs = makefile->GetSafeDefinition("AM_RCC_INPUTS"); + } + { std::vector rccInputLists; - cmSystemTools::ExpandListArgument(rccInputs, rccInputLists); + cmSystemTools::ExpandListArgument( + makefile->GetSafeDefinition("AM_RCC_INPUTS"), rccInputLists); // qrc files in the end of the list may have been empty if (rccInputLists.size() < this->RccSources.size()) { @@ -362,19 +354,17 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( } if (this->RccSources.size() != rccInputLists.size()) { std::ostringstream err; - err << "AutoGen: RCC sources lists size missmatch in: " << filename; - err << std::endl; + err << "AutoGen: Error: RCC sources/inputs lists size missmatch in: " + << filename << std::endl; this->LogError(err.str()); return false; } - for (std::vector::iterator fileIt = this->RccSources.begin(), inputIt = rccInputLists.begin(); fileIt != this->RccSources.end(); ++fileIt, ++inputIt) { cmSystemTools::ReplaceString(*inputIt, "@list_sep@", ";"); std::vector rccInputFiles; cmSystemTools::ExpandListArgument(*inputIt, rccInputFiles); - this->RccInputs[*fileIt] = rccInputFiles; } } -- cgit v0.12 From 9f47d32697686265bc2c5a708d2b53e2337f3f10 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 22:34:24 +0100 Subject: Autogen: Generators: Save the MOC settings that were actually used --- Source/cmQtAutoGenerators.cxx | 99 +++++++++++++++++++++++-------------------- Source/cmQtAutoGenerators.h | 12 +++--- 2 files changed, 59 insertions(+), 52 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 8d525dc..db35fa6 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -27,6 +27,10 @@ #include #endif +// -- Static variables + +static const char* MocOldSettingsKey = "AM_MOC_OLD_SETTINGS"; + // -- Static functions static std::string GetConfigDefinition(cmMakefile* makefile, @@ -45,6 +49,14 @@ static std::string GetConfigDefinition(cmMakefile* makefile, return makefile->GetSafeDefinition(key); } +static std::string MocOldSettingsFile(const std::string& targetDirectory) +{ + std::string filename(cmSystemTools::CollapseFullPath(targetDirectory)); + cmSystemTools::ConvertToUnixSlashes(filename); + filename += "/AutomocOldSettings.cmake"; + return filename; +} + static std::string FindMatchingHeader( const std::string& absPath, const std::string& mocSubDir, const std::string& basename, @@ -227,15 +239,20 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory, if (!this->ReadAutogenInfoFile(mf.get(), targetDirectory, config)) { return false; } - this->ReadOldMocDefinitionsFile(mf.get(), targetDirectory); + // Read old settings + this->ReadOldMocSettingsFile(mf.get(), targetDirectory); + // Init and run this->Init(); - if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5") { if (!this->RunAutogen(mf.get())) { return false; } } - return this->WriteOldMocDefinitionsFile(targetDirectory); + // Write latest settings + if (!this->WriteOldMocSettingsFile(targetDirectory)) { + return false; + } + return true; } bool cmQtAutoGenerators::ReadAutogenInfoFile( @@ -369,9 +386,6 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( } } - // - Settings - this->CurrentCompileSettingsStr = this->MakeCompileSettingsString(makefile); - // - Flags this->IncludeProjectDirsBefore = makefile->IsOn("AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE"); @@ -380,58 +394,58 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( return true; } -std::string cmQtAutoGenerators::MakeCompileSettingsString(cmMakefile* makefile) +std::string cmQtAutoGenerators::MocCurrentSettingsString() { - std::string s; - s += makefile->GetSafeDefinition("AM_MOC_COMPILE_DEFINITIONS"); - s += " ~~~ "; - s += makefile->GetSafeDefinition("AM_MOC_INCLUDES"); - s += " ~~~ "; - s += makefile->GetSafeDefinition("AM_MOC_OPTIONS"); - s += " ~~~ "; - s += makefile->IsOn("AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE") ? "TRUE" - : "FALSE"; - s += " ~~~ "; - - return s; + std::string res; + res += this->MocCompileDefinitionsStr; + res += " ~~~ "; + res += this->MocIncludesStr; + res += " ~~~ "; + res += this->MocOptionsStr; + res += " ~~~ "; + res += this->IncludeProjectDirsBefore ? "TRUE" : "FALSE"; + res += " ~~~ "; + return res; } -void cmQtAutoGenerators::ReadOldMocDefinitionsFile( +void cmQtAutoGenerators::ReadOldMocSettingsFile( cmMakefile* makefile, const std::string& targetDirectory) { - std::string filename(cmSystemTools::CollapseFullPath(targetDirectory)); - cmSystemTools::ConvertToUnixSlashes(filename); - filename += "/AutomocOldMocDefinitions.cmake"; - + // Compose current settings string + this->MocSettingsString = this->MocCurrentSettingsString(); + // Read old settings + const std::string filename = MocOldSettingsFile(targetDirectory); if (makefile->ReadListFile(filename.c_str())) { - this->OldCompileSettingsStr = - makefile->GetSafeDefinition("AM_OLD_COMPILE_SETTINGS"); + std::string oldSettings = makefile->GetSafeDefinition(MocOldSettingsKey); + if (oldSettings != this->MocSettingsString) { + // If settings changed everything needs to be re-generated. + this->GenerateAll = true; + // Remove old file in case processing gets aborted before + // writing the current settings in the end. + cmSystemTools::RemoveFile(filename); + } + } else { + // If the file could not be read everything needs to be re-generated. + this->GenerateAll = true; } } -bool cmQtAutoGenerators::WriteOldMocDefinitionsFile( +bool cmQtAutoGenerators::WriteOldMocSettingsFile( const std::string& targetDirectory) { bool success = true; - - std::string filename(cmSystemTools::CollapseFullPath(targetDirectory)); - cmSystemTools::ConvertToUnixSlashes(filename); - filename += "/AutomocOldMocDefinitions.cmake"; - - { + if (!this->MocExecutable.empty()) { + const std::string filename = MocOldSettingsFile(targetDirectory); cmsys::ofstream outfile; outfile.open(filename.c_str(), std::ios::trunc); - if (outfile) { - outfile << "set(AM_OLD_COMPILE_SETTINGS " - << cmOutputConverter::EscapeForCMake( - this->CurrentCompileSettingsStr) + if ((success = static_cast(outfile))) { + outfile << "set(" << MocOldSettingsKey << " " + << cmOutputConverter::EscapeForCMake(this->MocSettingsString) << ")\n"; success = outfile.good(); - } else { - success = false; + outfile.close(); } } - return success; } @@ -517,11 +531,6 @@ void cmQtAutoGenerators::Init() bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) { - // If settings changed everything needs to be re-generated. - if (this->OldCompileSettingsStr != this->CurrentCompileSettingsStr) { - this->GenerateAll = true; - } - // the program goes through all .cpp files to see which moc files are // included. It is not really interesting how the moc file is named, but // what file the moc is created from. Once a moc is included the same moc diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index c2be22c..a26cfbc 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -26,11 +26,11 @@ private: bool ReadAutogenInfoFile(cmMakefile* makefile, const std::string& targetDirectory, const std::string& config); - void ReadOldMocDefinitionsFile(cmMakefile* makefile, - const std::string& targetDirectory); - bool WriteOldMocDefinitionsFile(const std::string& targetDirectory); - static std::string MakeCompileSettingsString(cmMakefile* makefile); + std::string MocCurrentSettingsString(); + void ReadOldMocSettingsFile(cmMakefile* makefile, + const std::string& targetDirectory); + bool WriteOldMocSettingsFile(const std::string& targetDirectory); // - Init and run void Init(); @@ -133,6 +133,7 @@ private: std::list MocIncludes; std::list MocDefinitions; std::vector MocOptions; + std::string MocSettingsString; // - Uic std::vector SkipUic; std::vector UicTargetOptions; @@ -141,9 +142,6 @@ private: std::vector RccSources; std::map RccOptions; std::map > RccInputs; - // - Settings - std::string CurrentCompileSettingsStr; - std::string OldCompileSettingsStr; // - Utility cmFilePathChecksum fpathCheckSum; cmsys::RegularExpression RegExpQObject; -- cgit v0.12 From 721997a7a23f0cfa5c9e096cc3768625a51f359d Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 22:48:01 +0100 Subject: Autogen: Generators: Dedicated generateAll variables for MOC/UIC/RCC --- Source/cmQtAutoGenerators.cxx | 14 ++++++++------ Source/cmQtAutoGenerators.h | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index db35fa6..1d7e910 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -197,7 +197,9 @@ cmQtAutoGenerators::cmQtAutoGenerators() , RunMocFailed(false) , RunUicFailed(false) , RunRccFailed(false) - , GenerateAll(false) + , GenerateMocAll(false) + , GenerateUicAll(false) + , GenerateRccAll(false) { std::string colorEnv; @@ -419,14 +421,14 @@ void cmQtAutoGenerators::ReadOldMocSettingsFile( std::string oldSettings = makefile->GetSafeDefinition(MocOldSettingsKey); if (oldSettings != this->MocSettingsString) { // If settings changed everything needs to be re-generated. - this->GenerateAll = true; + this->GenerateMocAll = true; // Remove old file in case processing gets aborted before // writing the current settings in the end. cmSystemTools::RemoveFile(filename); } } else { // If the file could not be read everything needs to be re-generated. - this->GenerateAll = true; + this->GenerateMocAll = true; } } @@ -1119,7 +1121,7 @@ bool cmQtAutoGenerators::MocGenerateFile(const std::string& sourceFile, this->AutogenBuildSubDir + subDirPrefix + mocFileName; const std::string mocFileAbs = this->CurrentBinaryDir + mocFileRel; - bool generateMoc = this->GenerateAll; + bool generateMoc = this->GenerateMocAll; // Test if the source file is newer that the build file if (!generateMoc) { generateMoc = FileAbsentOrOlder(mocFileAbs, sourceFile); @@ -1247,7 +1249,7 @@ bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName, this->AutogenBuildSubDir + "include/" + uiOutputFile; const std::string uicFileAbs = this->CurrentBinaryDir + uicFileRel; - bool generateUic = this->GenerateAll; + bool generateUic = this->GenerateUicAll; // Test if the source file is newer that the build file if (!generateUic) { generateUic = FileAbsentOrOlder(uicFileAbs, uiInputFile); @@ -1368,7 +1370,7 @@ bool cmQtAutoGenerators::QrcGenerateFile(const std::string& qrcInputFile, const std::string qrcBuildFile = this->CurrentBinaryDir + qrcOutputFile; - bool generateQrc = this->GenerateAll; + bool generateQrc = this->GenerateRccAll; // Test if the resources list file is newer than build file if (!generateQrc) { generateQrc = FileAbsentOrOlder(qrcBuildFile, qrcInputFile); diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index a26cfbc..3427be6 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -155,7 +155,9 @@ private: bool RunMocFailed; bool RunUicFailed; bool RunRccFailed; - bool GenerateAll; + bool GenerateMocAll; + bool GenerateUicAll; + bool GenerateRccAll; bool MocRelaxedMode; }; -- cgit v0.12 From d7d2cb48c69e2a9da72a8baf188f02b81ec9c34f Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 11 Jan 2017 23:04:45 +0100 Subject: Autogen: Generators: Save the UIC/RCC settings that were actually used --- Source/cmQtAutoGenerators.cxx | 137 +++++++++++++++++++++++++++++++++--------- Source/cmQtAutoGenerators.h | 12 ++-- 2 files changed, 118 insertions(+), 31 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 1d7e910..2a038b9 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -30,6 +30,8 @@ // -- Static variables static const char* MocOldSettingsKey = "AM_MOC_OLD_SETTINGS"; +static const char* UicOldSettingsKey = "AM_UIC_OLD_SETTINGS"; +static const char* RccOldSettingsKey = "AM_RCC_OLD_SETTINGS"; // -- Static functions @@ -49,11 +51,11 @@ static std::string GetConfigDefinition(cmMakefile* makefile, return makefile->GetSafeDefinition(key); } -static std::string MocOldSettingsFile(const std::string& targetDirectory) +static std::string OldSettingsFile(const std::string& targetDirectory) { std::string filename(cmSystemTools::CollapseFullPath(targetDirectory)); cmSystemTools::ConvertToUnixSlashes(filename); - filename += "/AutomocOldSettings.cmake"; + filename += "/AutogenOldSettings.cmake"; return filename; } @@ -138,6 +140,21 @@ static bool ListContains(const std::vector& list, return (std::find(list.begin(), list.end(), entry) != list.end()); } +static std::string JoinOptions(const std::map& opts) +{ + std::string result; + for (std::map::const_iterator it = opts.begin(); + it != opts.end(); ++it) { + if (it != opts.begin()) { + result += "%%%"; + } + result += it->first; + result += "==="; + result += it->second; + } + return result; +} + static std::string JoinExts(const std::vector& lst) { std::string result; @@ -242,7 +259,7 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory, return false; } // Read old settings - this->ReadOldMocSettingsFile(mf.get(), targetDirectory); + this->OldSettingsReadFile(mf.get(), targetDirectory); // Init and run this->Init(); if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5") { @@ -251,7 +268,7 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory, } } // Write latest settings - if (!this->WriteOldMocSettingsFile(targetDirectory)) { + if (!this->OldSettingsWriteFile(targetDirectory)) { return false; } return true; @@ -396,7 +413,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( return true; } -std::string cmQtAutoGenerators::MocCurrentSettingsString() +std::string cmQtAutoGenerators::MocSettingsStringCompose() { std::string res; res += this->MocCompileDefinitionsStr; @@ -410,42 +427,108 @@ std::string cmQtAutoGenerators::MocCurrentSettingsString() return res; } -void cmQtAutoGenerators::ReadOldMocSettingsFile( +std::string cmQtAutoGenerators::UicSettingsStringCompose() +{ + std::string res; + res += cmJoin(this->UicTargetOptions, "@osep@"); + res += " ~~~ "; + res += JoinOptions(this->UicOptions); + res += " ~~~ "; + return res; +} + +std::string cmQtAutoGenerators::RccSettingsStringCompose() +{ + std::string res; + res += JoinOptions(this->RccOptions); + res += " ~~~ "; + return res; +} + +void cmQtAutoGenerators::OldSettingsReadFile( cmMakefile* makefile, const std::string& targetDirectory) { - // Compose current settings string - this->MocSettingsString = this->MocCurrentSettingsString(); - // Read old settings - const std::string filename = MocOldSettingsFile(targetDirectory); - if (makefile->ReadListFile(filename.c_str())) { - std::string oldSettings = makefile->GetSafeDefinition(MocOldSettingsKey); - if (oldSettings != this->MocSettingsString) { - // If settings changed everything needs to be re-generated. + if (!this->MocExecutable.empty() || !this->UicExecutable.empty() || + !this->RccExecutable.empty()) { + // Compose current settings strings + this->MocSettingsString = this->MocSettingsStringCompose(); + this->UicSettingsString = this->UicSettingsStringCompose(); + this->RccSettingsString = this->RccSettingsStringCompose(); + + // Read old settings + const std::string filename = OldSettingsFile(targetDirectory); + if (makefile->ReadListFile(filename.c_str())) { + if (!this->MocExecutable.empty()) { + const std::string sol = makefile->GetSafeDefinition(MocOldSettingsKey); + if (sol != this->MocSettingsString) { + this->GenerateMocAll = true; + } + } + if (!this->UicExecutable.empty()) { + const std::string sol = makefile->GetSafeDefinition(UicOldSettingsKey); + if (sol != this->UicSettingsString) { + this->GenerateUicAll = true; + } + } + if (!this->RccExecutable.empty()) { + const std::string sol = makefile->GetSafeDefinition(RccOldSettingsKey); + if (sol != this->RccSettingsString) { + this->GenerateRccAll = true; + } + } + // In case any setting changed remove the old settings file. + // This triggers a full rebuild on the next run if the current + // build is aborted before writing the current settings in the end. + if (this->GenerateMocAll || this->GenerateUicAll || + this->GenerateRccAll) { + cmSystemTools::RemoveFile(filename); + } + } else { + // If the file could not be read re-generate everythiung. this->GenerateMocAll = true; - // Remove old file in case processing gets aborted before - // writing the current settings in the end. - cmSystemTools::RemoveFile(filename); + this->GenerateUicAll = true; + this->GenerateRccAll = true; } - } else { - // If the file could not be read everything needs to be re-generated. - this->GenerateMocAll = true; } } -bool cmQtAutoGenerators::WriteOldMocSettingsFile( +bool cmQtAutoGenerators::OldSettingsWriteFile( const std::string& targetDirectory) { bool success = true; - if (!this->MocExecutable.empty()) { - const std::string filename = MocOldSettingsFile(targetDirectory); + // Only write if any setting changed + if (this->GenerateMocAll || this->GenerateUicAll || this->GenerateRccAll) { + const std::string filename = OldSettingsFile(targetDirectory); cmsys::ofstream outfile; outfile.open(filename.c_str(), std::ios::trunc); - if ((success = static_cast(outfile))) { - outfile << "set(" << MocOldSettingsKey << " " - << cmOutputConverter::EscapeForCMake(this->MocSettingsString) - << ")\n"; + if (outfile) { + if (!this->MocExecutable.empty()) { + outfile << "set(" << MocOldSettingsKey << " " + << cmOutputConverter::EscapeForCMake(this->MocSettingsString) + << ")\n"; + } + if (!this->UicExecutable.empty()) { + outfile << "set(" << UicOldSettingsKey << " " + << cmOutputConverter::EscapeForCMake(this->UicSettingsString) + << ")\n"; + } + if (!this->RccExecutable.empty()) { + outfile << "set(" << RccOldSettingsKey << " " + << cmOutputConverter::EscapeForCMake(this->RccSettingsString) + << ")\n"; + } success = outfile.good(); outfile.close(); + } else { + success = false; + // Remove old settings file to trigger full rebuild on next run + cmSystemTools::RemoveFile(filename); + { + std::ostringstream err; + err << "AutoGen: Error: Writing old settings file failed: " << filename + << std::endl; + this->LogError(err.str()); + } } } return success; diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 3427be6..3720a00 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -27,10 +27,12 @@ private: const std::string& targetDirectory, const std::string& config); - std::string MocCurrentSettingsString(); - void ReadOldMocSettingsFile(cmMakefile* makefile, - const std::string& targetDirectory); - bool WriteOldMocSettingsFile(const std::string& targetDirectory); + std::string MocSettingsStringCompose(); + std::string UicSettingsStringCompose(); + std::string RccSettingsStringCompose(); + void OldSettingsReadFile(cmMakefile* makefile, + const std::string& targetDirectory); + bool OldSettingsWriteFile(const std::string& targetDirectory); // - Init and run void Init(); @@ -138,10 +140,12 @@ private: std::vector SkipUic; std::vector UicTargetOptions; std::map UicOptions; + std::string UicSettingsString; // - Rcc std::vector RccSources; std::map RccOptions; std::map > RccInputs; + std::string RccSettingsString; // - Utility cmFilePathChecksum fpathCheckSum; cmsys::RegularExpression RegExpQObject; -- cgit v0.12 From f27c5852b0d1e37fb27bd1da1e7295b5f1fc963d Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Thu, 12 Jan 2017 00:49:58 +0100 Subject: Autogen: Initializer: Add old settings file to clean files --- Source/cmQtAutoGeneratorInitializer.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 6d4c302..825eba0 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -674,6 +674,14 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( const std::string qtMajorVersion = GetQtMajorVersion(target); std::vector autogenOutputFiles; + // Remove old settings on cleanup + { + std::string fname = GetAutogenTargetFilesDir(target); + fname += "/AutogenOldSettings.cmake"; + makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", fname.c_str(), + false); + } + // Create autogen target build directory and add it to the clean files cmSystemTools::MakeDirectory(autogenBuildDir); makefile->AppendProperty("ADDITIONAL_MAKE_CLEAN_FILES", -- cgit v0.12 From f24e1d37cef95145927d14d186e1615fca23a75b Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Thu, 12 Jan 2017 23:51:01 +0100 Subject: Autogen: Generators: Fix clang-tidy readability-else-after-return --- Source/cmQtAutoGenerators.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 2a038b9..06decf8 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -918,7 +918,11 @@ bool cmQtAutoGenerators::ParseContentForMoc( } } else { // Mode: Strict - if (basename != scannedFileBasename) { + if (basename == scannedFileBasename) { + // Include self + fileToMoc = absFilename; + ownDotMocIncluded = true; + } else { // Don't allow FOO.moc include other than self in strict mode std::ostringstream err; err << "AutoMoc: Error: " << absFilename << "\n" @@ -929,10 +933,6 @@ bool cmQtAutoGenerators::ParseContentForMoc( << ".moc\" to run moc on this source file.\n"; this->LogError(err.str()); return false; - } else { - // Include self - fileToMoc = absFilename; - ownDotMocIncluded = true; } } if (!fileToMoc.empty()) { -- cgit v0.12 From 3f86032bdab94e219d053c10b7e55eba9c06e562 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Thu, 12 Jan 2017 23:54:20 +0100 Subject: Autogen: Generators: Rename requiresMocing method --- Source/cmQtAutoGenerators.cxx | 8 ++++---- Source/cmQtAutoGenerators.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 06decf8..4979997 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -683,8 +683,8 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) * @brief Tests if the C++ content requires moc processing * @return True if moc is required */ -bool cmQtAutoGenerators::requiresMocing(const std::string& text, - std::string& macroName) +bool cmQtAutoGenerators::MocRequired(const std::string& text, + std::string& macroName) { // Run a simple check before an expensive regular expression check if (strstr(text.c_str(), "Q_OBJECT") != CM_NULLPTR) { @@ -812,7 +812,7 @@ bool cmQtAutoGenerators::ParseContentForMoc( cmsys::SystemTools::GetFilenameWithoutLastExtension(absFilename); std::string macroName; - const bool requiresMoc = this->requiresMocing(contentsString, macroName); + const bool requiresMoc = this->MocRequired(contentsString, macroName); bool ownDotMocIncluded = false; bool ownMocUnderscoreIncluded = false; std::string ownMocUnderscoreFile; @@ -1053,7 +1053,7 @@ void cmQtAutoGenerators::ParseHeaders( this->LogInfo(err.str()); } std::string macroName; - if (this->requiresMocing(contents, macroName)) { + if (this->MocRequired(contents, macroName)) { notIncludedMocs[headerName] = fpathCheckSum.getPart(headerName) + "/moc_" + cmsys::SystemTools::GetFilenameWithoutLastExtension(headerName) + diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 3720a00..7891eb9 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -39,7 +39,7 @@ private: bool RunAutogen(cmMakefile* makefile); // - Content analysis - bool requiresMocing(const std::string& text, std::string& macroName); + bool MocRequired(const std::string& text, std::string& macroName); bool MocSkipTest(const std::string& absFilename); bool UicSkipTest(const std::string& absFilename); -- cgit v0.12 From bb670d9625e670a0e87ec048e44db39b9d2b336f Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Thu, 12 Jan 2017 23:58:39 +0100 Subject: Autogen: Generators: Remove space --- Source/cmQtAutoGenerators.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 4979997..c84fe4f 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -585,7 +585,6 @@ void cmQtAutoGenerators::Init() if (this->IncludeProjectDirsBefore) { const std::string binDir = "-I" + this->ProjectBinaryDir; - const std::string srcDir = "-I" + this->ProjectSourceDir; std::list sortedMocIncludes; -- cgit v0.12