This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, master has been updated via 80362f7e31233c2525f47a954084b89e320c38fa (commit) via 2455d735a1fe4c9068515ff0795ebb3f45b8e739 (commit) via 96b202fad52fe89a9b1c736c26d25df8c38e5d21 (commit) via fd79ace021f39a580b350ad16d7abcc0563392ed (commit) via 97d25404f38cbcf35f1a793b90f926f54f4b0d59 (commit) via d040459679371a234cb24ebed3701cd464cc5fc5 (commit) via 7c5f5f1a209952828ddce26827b96ab9b9143949 (commit) via 1d5ed679ced9126f7cf686dd614e02b473d16b5e (commit) via e4a235653fbe27120f518b2a97af95d2b9831309 (commit) via 9d9e17fa21bc184d0f11ee73e8bdcd40910d719e (commit) via 65290169f277a5759226929cf457f45610f89d92 (commit) via 344a6d8448d16e2d28a318e4809ea0ff2a544c0d (commit) via 5965a589154e64ba3997c28a718652f54a84c631 (commit) via 46ba6abe498f1fd6cd286213ab7a4a9dfa6f15fb (commit) via 5d1671324bbcf0826b32c4c1691ae0f1041430ed (commit) via 99d50d2b25d20ffe34bb081fb386b39612d938d7 (commit) via 44b8debff4fb2fff6f784c0e5dd4fcb78f113d21 (commit) via 73bedfea3871235ba842979625053f706d9dcd49 (commit) via e6c606c7ba0ab1f9649de6a93aed5f98237276db (commit) via 8d090ff253eff158cf6cbf63d8b7c2189a03f39c (commit) via a8a9577e468b92f690b72e1ed03891a2df0cd2f9 (commit) via bf955e58f7b44d0371ff224738cff25274202ba4 (commit) via b44659f5e8c66d9a4fc8345f083530442ea240c1 (commit) via 7284b15f8c9bb20618e5286b41ff2f13245dfb9c (commit) via e99dd765b750e666975837143986237f2e33138a (commit) via d921e8eb6c0ae7e8ad2db1f599de1d5c08dd92ea (commit) via 41a97653861596b2ead1a078eccee876abec735d (commit) via a5d85a31d954e6f6ee03bf2ac1f91d90da3e5164 (commit) via a28894e4d412000a4b9850fe9f41c7b1c1499a8d (commit) via 765822add7896f256078006191b2629bcf778849 (commit) via 0d0995b7f8bc3ca6b88e8794ab03b0c7a1c2a8ca (commit) via 44963b509b08b59081bbe3f0a55e806fa2c3152b (commit) via 3f677f207653b33ff55d82e4d03653e146df3910 (commit) via b799ca42b8a2fdf7d92a75c0edc3292934a3926a (commit) via 7d6090aec41770414c4f8b9fd78823f1322381d8 (commit) via aecba65241ae837759472f1104442d299b42d571 (commit) from dc6632b9da0b804e6c00b71f06b26f561475858d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=80362f7e31233c2525f47a954084b89e320c38fa commit 80362f7e31233c2525f47a954084b89e320c38fa Merge: 2455d73 97d2540 Author: Brad King <brad.k...@kitware.com> AuthorDate: Mon Apr 24 13:49:03 2017 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Mon Apr 24 09:49:08 2017 -0400 Merge topic 'autogen_once' 97d25404 Autogen: Use FileWrite to write the settings file d0404596 Autogen: Save the hash of the old settings string only 7c5f5f1a Autogen: Generate moc_predefs.h only on demand 1d5ed679 Autogen: Uppercase function name e4a23565 Autogen: New QuotedCommand function for logging 9d9e17fa Autogen: Use FileDiffers and FileWrite for AUTOMOC 65290169 Autogen: Add FileDiffers and FileWrite methods 344a6d84 Autogen: MakeParentDirectory logPrefix parameter ... Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !747 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2455d735a1fe4c9068515ff0795ebb3f45b8e739 commit 2455d735a1fe4c9068515ff0795ebb3f45b8e739 Merge: 96b202f 5d16713 Author: Brad King <brad.k...@kitware.com> AuthorDate: Mon Apr 24 13:46:13 2017 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Mon Apr 24 09:46:16 2017 -0400 Merge topic 'eq-delete' 5d167132 cmConfigure: provide macros CM_EQ_DELETE and CM_DISABLE_COPY Acked-by: Kitware Robot <kwro...@kitware.com> Reviewed-by: Craig Scott <craig.sc...@crascit.com> Merge-request: !746 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96b202fad52fe89a9b1c736c26d25df8c38e5d21 commit 96b202fad52fe89a9b1c736c26d25df8c38e5d21 Merge: fd79ace 99d50d2 Author: Brad King <brad.k...@kitware.com> AuthorDate: Mon Apr 24 13:45:41 2017 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Mon Apr 24 09:45:49 2017 -0400 Merge topic 'clazy-2' 99d50d2b cmLinkLineComputer: make noncopyable 44b8debf cmGlobalGenerator::DirectoryContent: remove custom copy ctor 73bedfea cmTargetDepend: pass by value e6c606c7 cmGeneratorTarget::SourceFileFlags: remove custom copy ctor 8d090ff2 cmLinkImplItem: remove custom copy ctor a8a9577e cmLinkItem: remove custom copy ctor bf955e58 cmComputeLinkInformation::Item: remove custom copy ctor b44659f5 cmCryptoHash: make noncopyable ... Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !745 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fd79ace021f39a580b350ad16d7abcc0563392ed commit fd79ace021f39a580b350ad16d7abcc0563392ed Merge: dc6632b a28894e Author: Brad King <brad.k...@kitware.com> AuthorDate: Mon Apr 24 13:45:31 2017 +0000 Commit: Kitware Robot <kwro...@kitware.com> CommitDate: Mon Apr 24 09:45:34 2017 -0400 Merge topic 'clazy' a28894e4 cmCommandArgumentParserHelper: make noncopyable 765822ad cmake: pass cmStateSnapshot by const ref 0d0995b7 cmListFileArgument: remove custom copy ctor 44963b50 cmLocaleRAII: make noncopyable 3f677f20 cmGraphEdge: remove custom copy ctor b799ca42 cmAlgorithms: pass std::string by const ref 7d6090ae cmSystemTools::SaveRestoreEnvironment: make noncopyable aecba652 cmCLocaleEnvironmentScope: make noncopyable Acked-by: Kitware Robot <kwro...@kitware.com> Merge-request: !744 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=97d25404f38cbcf35f1a793b90f926f54f4b0d59 commit 97d25404f38cbcf35f1a793b90f926f54f4b0d59 Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Sat Apr 22 15:12:45 2017 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Sat Apr 22 15:12:45 2017 +0200 Autogen: Use FileWrite to write the settings file diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index b15fb8c..eec1fc6 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -102,12 +102,15 @@ inline static bool SettingsMatch(cmMakefile* makefile, const char* key, return (value == makefile->GetSafeDefinition(key)); } -static void SettingWrite(std::ostream& ostr, const char* key, - const std::string& value) +static void SettingAppend(std::string& str, const char* key, + const std::string& value) { if (!value.empty()) { - ostr << "set(" << key << " " << cmOutputConverter::EscapeForCMake(value) - << ")\n"; + str += "set("; + str += key; + str += " "; + str += cmOutputConverter::EscapeForCMake(value); + str += ")\n"; } } @@ -575,22 +578,21 @@ bool cmQtAutoGenerators::SettingsFileWrite() // Only write if any setting changed if (this->AnySettingsChanged()) { if (this->Verbose) { - this->LogInfo("AutoGen: Writing settings file " + this->SettingsFile); - } - cmsys::ofstream outfile; - outfile.open(this->SettingsFile.c_str(), std::ios::trunc); - if (outfile) { - SettingWrite(outfile, SettingsKeyMoc, this->SettingsStringMoc); - SettingWrite(outfile, SettingsKeyUic, this->SettingsStringUic); - SettingWrite(outfile, SettingsKeyRcc, this->SettingsStringRcc); - success = outfile.good(); - outfile.close(); - } else { - success = false; - // Remove old settings file to trigger full rebuild on next run + this->LogInfo("AutoGen: Writing settings file " + + Quoted(this->SettingsFile)); + } + // Compose settings file content + std::string settings; + SettingAppend(settings, SettingsKeyMoc, this->SettingsStringMoc); + SettingAppend(settings, SettingsKeyUic, this->SettingsStringUic); + SettingAppend(settings, SettingsKeyRcc, this->SettingsStringRcc); + // Write settings file + if (!this->FileWrite("AutoGen", this->SettingsFile, settings)) { + this->LogError("AutoGen: Error: Could not write old settings file " + + Quoted(this->SettingsFile)); + // Remove old settings file to trigger a full rebuild on the next run cmSystemTools::RemoveFile(this->SettingsFile); - this->LogError("AutoGen: Error: Writing old settings file failed: " + - this->SettingsFile); + success = false; } } return success; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d040459679371a234cb24ebed3701cd464cc5fc5 commit d040459679371a234cb24ebed3701cd464cc5fc5 Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Sat Apr 22 14:54:34 2017 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Sat Apr 22 14:54:34 2017 +0200 Autogen: Save the hash of the old settings string only diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 8e592b0..b15fb8c 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -15,6 +15,7 @@ #include <utility> #include "cmAlgorithms.h" +#include "cmCryptoHash.h" #include "cmFilePathChecksum.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" @@ -31,9 +32,9 @@ // -- Static variables -static const char* SettingsKeyMoc = "AM_MOC_OLD_SETTINGS"; -static const char* SettingsKeyUic = "AM_UIC_OLD_SETTINGS"; -static const char* SettingsKeyRcc = "AM_RCC_OLD_SETTINGS"; +static const char* SettingsKeyMoc = "AM_MOC_SETTINGS_HASH"; +static const char* SettingsKeyUic = "AM_UIC_SETTINGS_HASH"; +static const char* SettingsKeyRcc = "AM_RCC_SETTINGS_HASH"; // -- Static functions @@ -511,30 +512,36 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile) { // Compose current settings strings - if (this->MocEnabled()) { - std::string& str = this->SettingsStringMoc; - str += JoinOptionsList(this->MocDefinitions); - str += " ~~~ "; - str += JoinOptionsList(this->MocIncludePaths); - str += " ~~~ "; - str += JoinOptionsList(this->MocOptions); - str += " ~~~ "; - str += this->IncludeProjectDirsBefore ? "TRUE" : "FALSE"; - str += " ~~~ "; - str += JoinOptionsList(this->MocPredefsCmd); - str += " ~~~ "; - } - if (this->UicEnabled()) { - std::string& str = this->SettingsStringUic; - str += JoinOptionsList(this->UicTargetOptions); - str += " ~~~ "; - str += JoinOptionsMap(this->UicOptions); - str += " ~~~ "; - } - if (this->RccEnabled()) { - std::string& str = this->SettingsStringRcc; - str += JoinOptionsMap(this->RccOptions); - str += " ~~~ "; + { + cmCryptoHash crypt(cmCryptoHash::AlgoSHA256); + if (this->MocEnabled()) { + std::string str; + str += JoinOptionsList(this->MocDefinitions); + str += " ~~~ "; + str += JoinOptionsList(this->MocIncludePaths); + str += " ~~~ "; + str += JoinOptionsList(this->MocOptions); + str += " ~~~ "; + str += this->IncludeProjectDirsBefore ? "TRUE" : "FALSE"; + str += " ~~~ "; + str += JoinOptionsList(this->MocPredefsCmd); + str += " ~~~ "; + this->SettingsStringMoc = crypt.HashString(str); + } + if (this->UicEnabled()) { + std::string str; + str += JoinOptionsList(this->UicTargetOptions); + str += " ~~~ "; + str += JoinOptionsMap(this->UicOptions); + str += " ~~~ "; + this->SettingsStringUic = crypt.HashString(str); + } + if (this->RccEnabled()) { + std::string str; + str += JoinOptionsMap(this->RccOptions); + str += " ~~~ "; + this->SettingsStringRcc = crypt.HashString(str); + } } // Read old settings https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c5f5f1a209952828ddce26827b96ab9b9143949 commit 7c5f5f1a209952828ddce26827b96ab9b9143949 Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Sat Apr 22 14:39:50 2017 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Sat Apr 22 14:39:50 2017 +0200 Autogen: Generate moc_predefs.h only on demand diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 12acf1a..8e592b0 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -248,6 +248,7 @@ cmQtAutoGenerators::cmQtAutoGenerators() : Verbose(cmsys::SystemTools::HasEnv("VERBOSE")) , ColorOutput(true) , MocSettingsChanged(false) + , MocPredefsChanged(false) , MocRunFailed(false) , UicSettingsChanged(false) , UicRunFailed(false) @@ -520,6 +521,8 @@ void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile) str += " ~~~ "; str += this->IncludeProjectDirsBefore ? "TRUE" : "FALSE"; str += " ~~~ "; + str += JoinOptionsList(this->MocPredefsCmd); + str += " ~~~ "; } if (this->UicEnabled()) { std::string& str = this->SettingsStringUic; @@ -1186,40 +1189,48 @@ bool cmQtAutoGenerators::MocGenerateAll( // Generate moc_predefs if (!this->MocPredefsCmd.empty()) { - this->LogBold("Generating MOC predefs " + this->MocPredefsFileRel); + if (this->MocSettingsChanged || + FileAbsentOrOlder(this->MocPredefsFileAbs, this->SettingsFile)) { + this->LogBold("Generating MOC predefs " + this->MocPredefsFileRel); - std::string output; - { - std::vector<std::string> cmd = this->MocPredefsCmd; - // Add includes - cmd.insert(cmd.end(), this->MocIncludes.begin(), - this->MocIncludes.end()); - // Add definitions - for (std::vector<std::string>::const_iterator it = - this->MocDefinitions.begin(); - it != this->MocDefinitions.end(); ++it) { - cmd.push_back("-D" + (*it)); + std::string output; + { + // Compose command + std::vector<std::string> cmd = this->MocPredefsCmd; + // Add includes + cmd.insert(cmd.end(), this->MocIncludes.begin(), + this->MocIncludes.end()); + // Add definitions + for (std::vector<std::string>::const_iterator it = + this->MocDefinitions.begin(); + it != this->MocDefinitions.end(); ++it) { + cmd.push_back("-D" + (*it)); #ifdef _WIN32 - cmd.push_back("-DWIN32"); + cmd.push_back("-DWIN32"); #endif - } - // Add options - cmd.insert(cmd.end(), this->MocOptions.begin(), this->MocOptions.end()); - if (!this->RunCommand(cmd, output, false)) { - { - std::ostringstream ost; - ost << "AutoMoc: Error: moc predefs generation command failed\n"; - ost << "AutoMoc: Command:\n" << QuotedCommand(cmd) << "\n"; - ost << "AutoMoc: Command output:\n" << output << "\n"; - this->LogError(ost.str()); } - return false; + // Add options + cmd.insert(cmd.end(), this->MocOptions.begin(), + this->MocOptions.end()); + // Execute command + if (!this->RunCommand(cmd, output, false)) { + { + std::ostringstream ost; + ost << "AutoMoc: Error: moc predefs generation command failed\n"; + ost << "AutoMoc: Command:\n" << QuotedCommand(cmd) << "\n"; + ost << "AutoMoc: Command output:\n" << output << "\n"; + this->LogError(ost.str()); + } + return false; + } } - } - - if (this->FileDiffers(this->MocPredefsFileAbs, output)) { - if (!this->FileWrite("AutoMoc", this->MocPredefsFileAbs, output)) { - return false; + // (Re)write predefs file only on demand + if (this->FileDiffers(this->MocPredefsFileAbs, output)) { + if (this->FileWrite("AutoMoc", this->MocPredefsFileAbs, output)) { + this->MocPredefsChanged = true; + } else { + return false; + } } } } @@ -1300,7 +1311,7 @@ bool cmQtAutoGenerators::MocGenerateFile( const std::map<std::string, std::set<std::string> >& mocDepends) { bool mocGenerated = false; - bool generateMoc = this->MocSettingsChanged; + bool generateMoc = this->MocSettingsChanged || this->MocPredefsChanged; const std::string mocFileRel = this->AutogenBuildSubDir + subDir + mocFileName; diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index df43b33..987110f 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -186,6 +186,7 @@ private: std::string SettingsStringRcc; // -- Moc bool MocSettingsChanged; + bool MocPredefsChanged; bool MocRelaxedMode; bool MocRunFailed; std::string MocCppFilenameRel; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1d5ed679ced9126f7cf686dd614e02b473d16b5e commit 1d5ed679ced9126f7cf686dd614e02b473d16b5e Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Sat Apr 22 14:25:32 2017 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Sat Apr 22 14:28:13 2017 +0200 Autogen: Uppercase function name diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 0831766..12acf1a 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -110,7 +110,7 @@ static void SettingWrite(std::ostream& ostr, const char* key, } } -std::string subDirPrefix(const std::string& fileName) +static std::string SubDirPrefix(const std::string& fileName) { std::string res(cmsys::SystemTools::GetFilenamePath(fileName)); if (!res.empty()) { @@ -766,7 +766,7 @@ void cmQtAutoGenerators::MocFindDepends( // regular expression check if (contentText.find(filter.key) != std::string::npos) { // Run regular expression check loop - const std::string sourcePath = subDirPrefix(absFilename); + const std::string sourcePath = SubDirPrefix(absFilename); const char* contentChars = contentText.c_str(); while (filter.regExp.find(contentChars)) { // Evaluate match @@ -886,7 +886,7 @@ bool cmQtAutoGenerators::MocParseSourceContent( this->LogInfo("AutoMoc: Checking " + absFilename); } - const std::string scannedFileAbsPath = subDirPrefix(absFilename); + const std::string scannedFileAbsPath = SubDirPrefix(absFilename); const std::string scannedFileBasename = cmsys::SystemTools::GetFilenameWithoutLastExtension(absFilename); @@ -905,7 +905,7 @@ bool cmQtAutoGenerators::MocParseSourceContent( while (this->MocRegExpInclude.find(contentChars)) { const std::string incString = this->MocRegExpInclude.match(1); // Basename of the moc include - const std::string incSubDir(subDirPrefix(incString)); + const std::string incSubDir(SubDirPrefix(incString)); const std::string incBasename = cmsys::SystemTools::GetFilenameWithoutLastExtension(incString); @@ -1091,7 +1091,7 @@ void cmQtAutoGenerators::SearchHeadersForSourceFile( { std::string basepaths[2]; { - std::string bpath = subDirPrefix(absFilename); + std::string bpath = SubDirPrefix(absFilename); bpath += cmsys::SystemTools::GetFilenameWithoutLastExtension(absFilename); // search for default header files and private header files basepaths[0] = bpath; @@ -1389,7 +1389,7 @@ bool cmQtAutoGenerators::UicFindIncludedFile(std::string& absFile, bool success = false; // Search in vicinity of the source { - std::string testPath = subDirPrefix(sourceFile); + std::string testPath = SubDirPrefix(sourceFile); testPath += includeString; if (cmsys::SystemTools::FileExists(testPath.c_str())) { absFile = cmsys::SystemTools::GetRealPath(testPath); @@ -1435,7 +1435,7 @@ bool cmQtAutoGenerators::UicGenerateAll( for (std::vector<std::string>::const_iterator uit = sourceIncs.begin(); uit != sourceIncs.end(); ++uit) { // Remove ui_ from the begin filename by substr() - const std::string uiBasePath = subDirPrefix(*uit); + const std::string uiBasePath = SubDirPrefix(*uit); const std::string uiBaseName = cmsys::SystemTools::GetFilenameWithoutLastExtension(*uit).substr(3); const std::string searchFileName = uiBasePath + uiBaseName + ".ui"; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e4a235653fbe27120f518b2a97af95d2b9831309 commit e4a235653fbe27120f518b2a97af95d2b9831309 Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Sat Apr 22 14:23:51 2017 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Sat Apr 22 14:28:13 2017 +0200 Autogen: New QuotedCommand function for logging diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 972daf6..0831766 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -42,6 +42,25 @@ inline static std::string Quoted(const std::string& text) return cmQtAutoGeneratorCommon::Quoted(text); } +static std::string QuotedCommand(const std::vector<std::string>& command) +{ + std::string res; + for (std::vector<std::string>::const_iterator cit = command.begin(); + cit != command.end(); ++cit) { + if (!res.empty()) { + res.push_back(' '); + } + const std::string cesc = Quoted(*cit); + if (cit->empty() || (cesc.size() > (cit->size() + 2)) || + (cesc.find(' ') != std::string::npos)) { + res += cesc; + } else { + res += *cit; + } + } + return res; +} + static void InfoGet(cmMakefile* makefile, const char* key, std::string& value) { value = makefile->GetSafeDefinition(key); @@ -1190,7 +1209,7 @@ bool cmQtAutoGenerators::MocGenerateAll( { std::ostringstream ost; ost << "AutoMoc: Error: moc predefs generation command failed\n"; - ost << "AutoMoc: Command:\n" << cmJoin(cmd, " ") << "\n"; + ost << "AutoMoc: Command:\n" << QuotedCommand(cmd) << "\n"; ost << "AutoMoc: Command output:\n" << output << "\n"; this->LogError(ost.str()); } @@ -1348,7 +1367,7 @@ bool cmQtAutoGenerators::MocGenerateFile( std::ostringstream ost; ost << "AutoMoc: Error: moc process failed for\n"; ost << Quoted(mocFileRel) << "\n"; - ost << "AutoMoc: Command:\n" << cmJoin(cmd, " ") << "\n"; + ost << "AutoMoc: Command:\n" << QuotedCommand(cmd) << "\n"; ost << "AutoMoc: Command output:\n" << output << "\n"; this->LogError(ost.str()); } @@ -1519,7 +1538,7 @@ bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName, ost << "AutoUic: Error: uic process failed for\n"; ost << Quoted(uicFileRel) << " needed by\n"; ost << Quoted(realName) << "\n"; - ost << "AutoUic: Command:\n" << cmJoin(cmd, " ") << "\n"; + ost << "AutoUic: Command:\n" << QuotedCommand(cmd) << "\n"; ost << "AutoUic: Command output:\n" << output << "\n"; this->LogError(ost.str()); } @@ -1665,7 +1684,7 @@ bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile, std::ostringstream ost; ost << "AutoRcc: Error: rcc process failed for\n"; ost << Quoted(rccOutputFile) << "\n"; - ost << "AutoRcc: Command:\n" << cmJoin(cmd, " ") << "\n"; + ost << "AutoRcc: Command:\n" << QuotedCommand(cmd) << "\n"; ost << "AutoRcc: Command output:\n" << output << "\n"; this->LogError(ost.str()); } @@ -1745,23 +1764,6 @@ void cmQtAutoGenerators::LogError(const std::string& message) const } } -void cmQtAutoGenerators::LogCommand( - const std::vector<std::string>& command) const -{ - std::vector<std::string> cmdEscaped; - typedef std::vector<std::string>::const_iterator Iter; - for (Iter cit = command.begin(); cit != command.end(); ++cit) { - const std::string cesc = Quoted(*cit); - if ((cesc.size() > (cit->size() + 2)) || - (cesc.find(' ') != std::string::npos)) { - cmdEscaped.push_back(cesc); - } else { - cmdEscaped.push_back(*cit); - } - } - this->LogInfo(cmJoin(cmdEscaped, " ")); -} - /** * @brief Collects name collisions as output/input pairs * @return True if there were collisions @@ -1881,7 +1883,7 @@ bool cmQtAutoGenerators::RunCommand(const std::vector<std::string>& command, { // Log command if (this->Verbose) { - this->LogCommand(command); + this->LogInfo(QuotedCommand(command)); } // Execute command int retVal = 0; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9d9e17fa21bc184d0f11ee73e8bdcd40910d719e commit 9d9e17fa21bc184d0f11ee73e8bdcd40910d719e Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Sat Apr 22 13:58:41 2017 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Sat Apr 22 14:08:57 2017 +0200 Autogen: Use FileDiffers and FileWrite for AUTOMOC diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index e907779..972daf6 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1146,54 +1146,7 @@ bool cmQtAutoGenerators::MocGenerateAll( return true; } - // Generate moc_predefs - if (!this->MocPredefsCmd.empty()) { - if (!this->MakeParentDirectory("AutoMoc", this->MocPredefsFileAbs)) { - this->LogError("AutoMoc: Error creating directory for " + - this->MocPredefsFileRel); - return false; - } - this->LogBold("Generating MOC predefs " + this->MocPredefsFileRel); - - std::vector<std::string> cmd = this->MocPredefsCmd; - cmd.insert(cmd.end(), this->MocIncludes.begin(), this->MocIncludes.end()); - for (std::vector<std::string>::const_iterator it = - this->MocDefinitions.begin(); - it != this->MocDefinitions.end(); ++it) { - cmd.push_back("-D" + (*it)); - } - cmd.insert(cmd.end(), this->MocOptions.begin(), this->MocOptions.end()); - - std::string output; - bool moc_predefsGenerated = this->RunCommand(cmd, output, false); - if (!moc_predefsGenerated) { - return false; - } - - // actually write the file - cmsys::ofstream outfile; - outfile.open(this->MocPredefsFileAbs.c_str(), std::ios::trunc); - if (!outfile) { - moc_predefsGenerated = false; - this->LogError("AutoMoc: Error opening " + this->MocPredefsFileRel); - } else { - outfile << output; - // Check for write errors - if (!outfile.good()) { - moc_predefsGenerated = false; - this->LogError("AutoMoc: Error writing " + this->MocPredefsFileRel); - } - } - - if (!moc_predefsGenerated) { - return false; - } - } - - bool mocCompFileGenerated = false; - bool mocCompChanged = false; - - // look for name collisions + // Look for name collisions { std::multimap<std::string, std::string> collisions; // Test merged map of included and notIncluded @@ -1211,6 +1164,47 @@ bool cmQtAutoGenerators::MocGenerateAll( return false; } } + + // Generate moc_predefs + if (!this->MocPredefsCmd.empty()) { + this->LogBold("Generating MOC predefs " + this->MocPredefsFileRel); + + std::string output; + { + std::vector<std::string> cmd = this->MocPredefsCmd; + // Add includes + cmd.insert(cmd.end(), this->MocIncludes.begin(), + this->MocIncludes.end()); + // Add definitions + for (std::vector<std::string>::const_iterator it = + this->MocDefinitions.begin(); + it != this->MocDefinitions.end(); ++it) { + cmd.push_back("-D" + (*it)); +#ifdef _WIN32 + cmd.push_back("-DWIN32"); +#endif + } + // Add options + cmd.insert(cmd.end(), this->MocOptions.begin(), this->MocOptions.end()); + if (!this->RunCommand(cmd, output, false)) { + { + std::ostringstream ost; + ost << "AutoMoc: Error: moc predefs generation command failed\n"; + ost << "AutoMoc: Command:\n" << cmJoin(cmd, " ") << "\n"; + ost << "AutoMoc: Command output:\n" << output << "\n"; + this->LogError(ost.str()); + } + return false; + } + } + + if (this->FileDiffers(this->MocPredefsFileAbs, output)) { + if (!this->FileWrite("AutoMoc", this->MocPredefsFileAbs, output)) { + return false; + } + } + } + // Generate moc files that are included by source files. { const std::string subDir = "include/"; @@ -1224,7 +1218,9 @@ bool cmQtAutoGenerators::MocGenerateAll( } } } + // Generate moc files that are _not_ included by source files. + bool mocCompFileGenerated = false; { const std::string subDir; for (std::map<std::string, std::string>::const_iterator it = @@ -1259,37 +1255,11 @@ bool cmQtAutoGenerators::MocGenerateAll( automocSource = ost.str(); } - // Check if the content of moc_compilation.cpp changed - { - std::string oldContents; - if (ReadAll(oldContents, this->MocCppFilenameAbs)) { - mocCompChanged = (oldContents != automocSource); - } else { - mocCompChanged = true; - } - } - - bool success = true; - if (mocCompChanged) { + if (this->FileDiffers(this->MocCppFilenameAbs, automocSource)) { // Actually write moc_compilation.cpp this->LogBold("Generating MOC compilation " + this->MocCppFilenameRel); - - // Make sure the parent directory exists - success = this->MakeParentDirectory("AutoMoc", this->MocCppFilenameAbs); - if (success) { - cmsys::ofstream outfile; - outfile.open(this->MocCppFilenameAbs.c_str(), std::ios::trunc); - if (!outfile) { - success = false; - this->LogError("AutoMoc: Error opening " + this->MocCppFilenameAbs); - } else { - outfile << automocSource; - // Check for write errors - if (!outfile.good()) { - success = false; - this->LogError("AutoMoc: Error writing " + this->MocCppFilenameAbs); - } - } + if (!this->FileWrite("AutoMoc", this->MocCppFilenameAbs, automocSource)) { + return false; } } else if (mocCompFileGenerated) { // Only touch moc_compilation.cpp @@ -1299,7 +1269,7 @@ bool cmQtAutoGenerators::MocGenerateAll( cmSystemTools::Touch(this->MocCppFilenameAbs, false); } - return success; + return true; } /** @@ -1344,6 +1314,7 @@ bool cmQtAutoGenerators::MocGenerateFile( // Compose moc command std::vector<std::string> cmd; cmd.push_back(this->MocExecutable); + // Add includes cmd.insert(cmd.end(), this->MocIncludes.begin(), this->MocIncludes.end()); // Add definitions @@ -1352,14 +1323,16 @@ bool cmQtAutoGenerators::MocGenerateFile( it != this->MocDefinitions.end(); ++it) { cmd.push_back("-D" + (*it)); } +#ifdef _WIN32 + cmd.push_back("-DWIN32"); +#endif + // Add options cmd.insert(cmd.end(), this->MocOptions.begin(), this->MocOptions.end()); + // Add predefs include if (!this->MocPredefsFileAbs.empty()) { cmd.push_back("--include"); cmd.push_back(this->MocPredefsFileAbs); } -#ifdef _WIN32 - cmd.push_back("-DWIN32"); -#endif cmd.push_back("-o"); cmd.push_back(mocFileAbs); cmd.push_back(sourceFile); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=65290169f277a5759226929cf457f45610f89d92 commit 65290169f277a5759226929cf457f45610f89d92 Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Sat Apr 22 13:36:35 2017 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Sat Apr 22 14:01:18 2017 +0200 Autogen: Add FileDiffers and FileWrite methods diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index a42db11..e907779 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1856,6 +1856,49 @@ bool cmQtAutoGenerators::MakeParentDirectory(const char* logPrefix, return success; } +bool cmQtAutoGenerators::FileDiffers(const std::string& filename, + const std::string& content) +{ + bool differs = true; + { + std::string oldContents; + if (ReadAll(oldContents, filename)) { + differs = (oldContents != content); + } + } + return differs; +} + +bool cmQtAutoGenerators::FileWrite(const char* logPrefix, + const std::string& filename, + const std::string& content) +{ + std::string error; + // Make sure the parent directory exists + if (this->MakeParentDirectory(logPrefix, filename)) { + cmsys::ofstream outfile; + outfile.open(filename.c_str(), std::ios::trunc); + if (outfile) { + outfile << content; + // Check for write errors + if (!outfile.good()) { + error = logPrefix; + error += ": Error writing "; + error += Quoted(filename); + } + } else { + error = logPrefix; + error = ": Error opening "; + error += Quoted(filename); + } + } + if (!error.empty()) { + this->LogError(error); + return false; + } + return true; +} + /** * @brief Runs a command and returns true on success * @return True on success diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 7419cdc..df43b33 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -143,6 +143,10 @@ private: const char* baseSuffix) const; bool MakeParentDirectory(const char* logPrefix, const std::string& filename) const; + bool FileDiffers(const std::string& filename, const std::string& content); + bool FileWrite(const char* logPrefix, const std::string& filename, + const std::string& content); + bool RunCommand(const std::vector<std::string>& command, std::string& output, bool verbose = true) const; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=344a6d8448d16e2d28a318e4809ea0ff2a544c0d commit 344a6d8448d16e2d28a318e4809ea0ff2a544c0d Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Sat Apr 22 13:30:28 2017 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Sat Apr 22 13:30:28 2017 +0200 Autogen: MakeParentDirectory logPrefix parameter diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 89b90b2..a42db11 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1148,7 +1148,7 @@ bool cmQtAutoGenerators::MocGenerateAll( // Generate moc_predefs if (!this->MocPredefsCmd.empty()) { - if (!this->MakeParentDirectory(this->MocPredefsFileAbs)) { + if (!this->MakeParentDirectory("AutoMoc", this->MocPredefsFileAbs)) { this->LogError("AutoMoc: Error creating directory for " + this->MocPredefsFileRel); return false; @@ -1275,7 +1275,7 @@ bool cmQtAutoGenerators::MocGenerateAll( this->LogBold("Generating MOC compilation " + this->MocCppFilenameRel); // Make sure the parent directory exists - success = this->MakeParentDirectory(this->MocCppFilenameAbs); + success = this->MakeParentDirectory("AutoMoc", this->MocCppFilenameAbs); if (success) { cmsys::ofstream outfile; outfile.open(this->MocCppFilenameAbs.c_str(), std::ios::trunc); @@ -1340,7 +1340,7 @@ bool cmQtAutoGenerators::MocGenerateFile( this->LogBold("Generating MOC source " + mocFileRel); // Make sure the parent directory exists - if (this->MakeParentDirectory(mocFileAbs)) { + if (this->MakeParentDirectory("AutoMoc", mocFileAbs)) { // Compose moc command std::vector<std::string> cmd; cmd.push_back(this->MocExecutable); @@ -1516,7 +1516,7 @@ bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName, this->LogBold("Generating UIC header " + uicFileRel); // Make sure the parent directory exists - if (this->MakeParentDirectory(uicFileAbs)) { + if (this->MakeParentDirectory("AutoUic", uicFileAbs)) { // Compose uic command std::vector<std::string> cmd; cmd.push_back(this->UicExecutable); @@ -1654,7 +1654,7 @@ bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile, this->LogBold("Generating RCC source " + rccOutputFile); // Make sure the parent directory exists - if (this->MakeParentDirectory(rccBuildFile)) { + if (this->MakeParentDirectory("AutoRcc", rccBuildFile)) { // Compose symbol name std::string symbolName = cmsys::SystemTools::GetFilenameWithoutLastExtension(rccInputFile); @@ -1839,14 +1839,18 @@ std::string cmQtAutoGenerators::ChecksumedPath(const std::string& sourceFile, * @brief Generates the parent directory of the given file on demand * @return True on success */ -bool cmQtAutoGenerators::MakeParentDirectory(const std::string& filename) const +bool cmQtAutoGenerators::MakeParentDirectory(const char* logPrefix, + const std::string& filename) const { bool success = true; const std::string dirName = cmSystemTools::GetFilenamePath(filename); if (!dirName.empty()) { success = cmsys::SystemTools::MakeDirectory(dirName); if (!success) { - this->LogError("AutoGen: Error: Directory creation failed: " + dirName); + std::string error = logPrefix; + error += ": Error: Parent directory creation failed for "; + error += Quoted(filename); + this->LogError(error); } } return success; diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 7ef2d6e..7419cdc 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -141,7 +141,8 @@ private: std::string ChecksumedPath(const std::string& sourceFile, const char* basePrefix, const char* baseSuffix) const; - bool MakeParentDirectory(const std::string& filename) const; + bool MakeParentDirectory(const char* logPrefix, + const std::string& filename) const; bool RunCommand(const std::vector<std::string>& command, std::string& output, bool verbose = true) const; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5965a589154e64ba3997c28a718652f54a84c631 commit 5965a589154e64ba3997c28a718652f54a84c631 Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Sat Apr 22 13:12:58 2017 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Sat Apr 22 13:21:18 2017 +0200 Autogen: Determine settings file name only once diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 2c65db8..89b90b2 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -76,14 +76,6 @@ static void InfoGet(cmMakefile* makefile, const char* key, cmSystemTools::ExpandListArgument(valueConf, list); } -static std::string SettingsFile(const std::string& targetDirectory) -{ - std::string filename(cmSystemTools::CollapseFullPath(targetDirectory)); - cmSystemTools::ConvertToUnixSlashes(filename); - filename += "/AutogenOldSettings.cmake"; - return filename; -} - inline static bool SettingsMatch(cmMakefile* makefile, const char* key, const std::string& value) { @@ -286,12 +278,12 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory, bool success = false; if (this->ReadAutogenInfoFile(mf.get(), targetDirectory, config)) { // Read old settings - this->SettingsFileRead(mf.get(), targetDirectory); + this->SettingsFileRead(mf.get()); // Init and run this->Init(mf.get()); if (this->RunAutogen()) { // Write current settings - if (this->SettingsFileWrite(targetDirectory)) { + if (this->SettingsFileWrite()) { success = true; } } @@ -338,6 +330,13 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( return false; } + // - Old settings file + { + this->SettingsFile = cmSystemTools::CollapseFullPath(targetDirectory); + cmSystemTools::ConvertToUnixSlashes(this->SettingsFile); + this->SettingsFile += "/AutogenOldSettings.cmake"; + } + // - Target names InfoGet(makefile, "AM_TARGET_NAME", this->AutogenTargetName); InfoGet(makefile, "AM_ORIGIN_TARGET_NAME", this->OriginTargetName); @@ -489,8 +488,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile( return true; } -void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile, - const std::string& targetDirectory) +void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile) { // Compose current settings strings if (this->MocEnabled()) { @@ -518,8 +516,7 @@ void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile, } // Read old settings - const std::string filename = SettingsFile(targetDirectory); - if (makefile->ReadListFile(filename.c_str())) { + if (makefile->ReadListFile(this->SettingsFile.c_str())) { if (!SettingsMatch(makefile, SettingsKeyMoc, this->SettingsStringMoc)) { this->MocSettingsChanged = true; } @@ -533,7 +530,7 @@ void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile, // 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->AnySettingsChanged()) { - cmSystemTools::RemoveFile(filename); + cmSystemTools::RemoveFile(this->SettingsFile); } } else { // If the file could not be read re-generate everythiung. @@ -543,17 +540,16 @@ void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile, } } -bool cmQtAutoGenerators::SettingsFileWrite(const std::string& targetDirectory) +bool cmQtAutoGenerators::SettingsFileWrite() { bool success = true; // Only write if any setting changed if (this->AnySettingsChanged()) { - const std::string filename = SettingsFile(targetDirectory); if (this->Verbose) { - this->LogInfo("AutoGen: Writing settings file " + filename); + this->LogInfo("AutoGen: Writing settings file " + this->SettingsFile); } cmsys::ofstream outfile; - outfile.open(filename.c_str(), std::ios::trunc); + outfile.open(this->SettingsFile.c_str(), std::ios::trunc); if (outfile) { SettingWrite(outfile, SettingsKeyMoc, this->SettingsStringMoc); SettingWrite(outfile, SettingsKeyUic, this->SettingsStringUic); @@ -563,9 +559,9 @@ bool cmQtAutoGenerators::SettingsFileWrite(const std::string& targetDirectory) } else { success = false; // Remove old settings file to trigger full rebuild on next run - cmSystemTools::RemoveFile(filename); + cmSystemTools::RemoveFile(this->SettingsFile); this->LogError("AutoGen: Error: Writing old settings file failed: " + - filename); + this->SettingsFile); } } return success; diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index a15efc1..7ef2d6e 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -44,9 +44,8 @@ private: bool RccEnabled() const { return !this->RccExecutable.empty(); } // -- Settings file - void SettingsFileRead(cmMakefile* makefile, - const std::string& targetDirectory); - bool SettingsFileWrite(const std::string& targetDirectory); + void SettingsFileRead(cmMakefile* makefile); + bool SettingsFileWrite(); bool AnySettingsChanged() const { @@ -176,6 +175,7 @@ private: bool IncludeProjectDirsBefore; bool Verbose; bool ColorOutput; + std::string SettingsFile; std::string SettingsStringMoc; std::string SettingsStringUic; std::string SettingsStringRcc; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=46ba6abe498f1fd6cd286213ab7a4a9dfa6f15fb commit 46ba6abe498f1fd6cd286213ab7a4a9dfa6f15fb Author: Sebastian Holtermann <sebh...@xwmw.org> AuthorDate: Sat Apr 22 11:35:23 2017 +0200 Commit: Sebastian Holtermann <sebh...@xwmw.org> CommitDate: Sat Apr 22 13:21:18 2017 +0200 Autogen: Overhaul class variable names and sorting diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index d142693..2c65db8 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -236,12 +236,12 @@ static void UicMergeOptions(std::vector<std::string>& opts, cmQtAutoGenerators::cmQtAutoGenerators() : Verbose(cmsys::SystemTools::HasEnv("VERBOSE")) , ColorOutput(true) - , RunMocFailed(false) - , RunUicFailed(false) - , RunRccFailed(false) - , GenerateAllMoc(false) - , GenerateAllUic(false) - , GenerateAllRcc(false) + , MocSettingsChanged(false) + , MocRunFailed(false) + , UicSettingsChanged(false) + , UicRunFailed(false) + , RccSettingsChanged(false) + , RccRunFailed(false) { std::string colorEnv; @@ -254,16 +254,16 @@ cmQtAutoGenerators::cmQtAutoGenerators() } } - this->MacroFilters[0].first = "Q_OBJECT"; - this->MacroFilters[0].second.compile("[\n][ \t]*Q_OBJECT[^a-zA-Z0-9_]"); - this->MacroFilters[1].first = "Q_GADGET"; - this->MacroFilters[1].second.compile("[\n][ \t]*Q_GADGET[^a-zA-Z0-9_]"); + this->MocMacroFilters[0].first = "Q_OBJECT"; + this->MocMacroFilters[0].second.compile("[\n][ \t]*Q_OBJECT[^a-zA-Z0-9_]"); + this->MocMacroFilters[1].first = "Q_GADGET"; + this->MocMacroFilters[1].second.compile("[\n][ \t]*Q_GADGET[^a-zA-Z0-9_]"); // Precompile regular expressions - this->RegExpMocInclude.compile( + this->MocRegExpInclude.compile( "[\n][ \t]*#[ \t]*include[ \t]+" "[\"<](([^ \">]+/)?moc_[^ \">/]+\\.cpp|[^ \">]+\\.moc)[\">]"); - this->RegExpUicInclude.compile("[\n][ \t]*#[ \t]*include[ \t]+" + this->UicRegExpInclude.compile("[\n][ \t]*#[ \t]*include[ \t]+" "[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]"); } @@ -521,25 +521,25 @@ void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile, const std::string filename = SettingsFile(targetDirectory); if (makefile->ReadListFile(filename.c_str())) { if (!SettingsMatch(makefile, SettingsKeyMoc, this->SettingsStringMoc)) { - this->GenerateAllMoc = true; + this->MocSettingsChanged = true; } if (!SettingsMatch(makefile, SettingsKeyUic, this->SettingsStringUic)) { - this->GenerateAllUic = true; + this->UicSettingsChanged = true; } if (!SettingsMatch(makefile, SettingsKeyRcc, this->SettingsStringRcc)) { - this->GenerateAllRcc = true; + this->RccSettingsChanged = 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->GenerateAllAny()) { + if (this->AnySettingsChanged()) { cmSystemTools::RemoveFile(filename); } } else { // If the file could not be read re-generate everythiung. - this->GenerateAllMoc = true; - this->GenerateAllUic = true; - this->GenerateAllRcc = true; + this->MocSettingsChanged = true; + this->UicSettingsChanged = true; + this->RccSettingsChanged = true; } } @@ -547,7 +547,7 @@ bool cmQtAutoGenerators::SettingsFileWrite(const std::string& targetDirectory) { bool success = true; // Only write if any setting changed - if (this->GenerateAllAny()) { + if (this->AnySettingsChanged()) { const std::string filename = SettingsFile(targetDirectory); if (this->Verbose) { this->LogInfo("AutoGen: Writing settings file " + filename); @@ -588,7 +588,7 @@ void cmQtAutoGenerators::Init(cmMakefile* makefile) } // Init file path checksum generator - fpathCheckSum.setupParentDirs(this->CurrentSourceDir, this->CurrentBinaryDir, + FPathChecksum.setupParentDirs(this->CurrentSourceDir, this->CurrentBinaryDir, this->ProjectSourceDir, this->ProjectBinaryDir); @@ -722,8 +722,8 @@ bool cmQtAutoGenerators::RunAutogen() bool cmQtAutoGenerators::MocRequired(const std::string& contentText, std::string* macroName) { - for (unsigned int ii = 0; ii != cmArraySize(this->MacroFilters); ++ii) { - MacroFilter& filter = this->MacroFilters[ii]; + for (unsigned int ii = 0; ii != cmArraySize(this->MocMacroFilters); ++ii) { + MocMacroFilter& filter = this->MocMacroFilters[ii]; // Run a simple find string operation before the expensive // regular expression check if (contentText.find(filter.first) != std::string::npos) { @@ -852,9 +852,9 @@ void cmQtAutoGenerators::UicParseContent( const char* contentChars = contentText.c_str(); if (strstr(contentChars, "ui_") != CM_NULLPTR) { - while (this->RegExpUicInclude.find(contentChars)) { - uisIncluded[absFilename].push_back(this->RegExpUicInclude.match(1)); - contentChars += this->RegExpUicInclude.end(); + while (this->UicRegExpInclude.find(contentChars)) { + uisIncluded[absFilename].push_back(this->UicRegExpInclude.match(1)); + contentChars += this->UicRegExpInclude.end(); } } } @@ -887,8 +887,8 @@ bool cmQtAutoGenerators::MocParseSourceContent( const char* contentChars = contentText.c_str(); if (strstr(contentChars, "moc") != CM_NULLPTR) { // Iterate over all included moc files - while (this->RegExpMocInclude.find(contentChars)) { - const std::string incString = this->RegExpMocInclude.match(1); + while (this->MocRegExpInclude.find(contentChars)) { + const std::string incString = this->MocRegExpInclude.match(1); // Basename of the moc include const std::string incSubDir(subDirPrefix(incString)); const std::string incBasename = @@ -1008,7 +1008,7 @@ bool cmQtAutoGenerators::MocParseSourceContent( } } // Forward content pointer - contentChars += this->RegExpMocInclude.end(); + contentChars += this->MocRegExpInclude.end(); } } @@ -1222,7 +1222,7 @@ bool cmQtAutoGenerators::MocGenerateAll( mocsIncluded.begin(); it != mocsIncluded.end(); ++it) { if (!this->MocGenerateFile(it->first, it->second, subDir, mocDepends)) { - if (this->RunMocFailed) { + if (this->MocRunFailed) { return false; } } @@ -1237,7 +1237,7 @@ bool cmQtAutoGenerators::MocGenerateAll( if (this->MocGenerateFile(it->first, it->second, subDir, mocDepends)) { mocCompFileGenerated = true; } else { - if (this->RunMocFailed) { + if (this->MocRunFailed) { return false; } } @@ -1315,7 +1315,7 @@ bool cmQtAutoGenerators::MocGenerateFile( const std::map<std::string, std::set<std::string> >& mocDepends) { bool mocGenerated = false; - bool generateMoc = this->GenerateAllMoc; + bool generateMoc = this->MocSettingsChanged; const std::string mocFileRel = this->AutogenBuildSubDir + subDir + mocFileName; @@ -1384,11 +1384,11 @@ bool cmQtAutoGenerators::MocGenerateFile( this->LogError(ost.str()); } cmSystemTools::RemoveFile(mocFileAbs); - this->RunMocFailed = true; + this->MocRunFailed = true; } } else { // Parent directory creation failed - this->RunMocFailed = true; + this->MocRunFailed = true; } } return mocGenerated; @@ -1487,7 +1487,7 @@ bool cmQtAutoGenerators::UicGenerateAll( it->second.begin(); sit != it->second.end(); ++sit) { if (!this->UicGenerateFile(it->first, sit->first, sit->second)) { - if (this->RunUicFailed) { + if (this->UicRunFailed) { return false; } } @@ -1505,7 +1505,7 @@ bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName, const std::string& uiOutputFile) { bool uicGenerated = false; - bool generateUic = this->GenerateAllUic; + bool generateUic = this->UicSettingsChanged; const std::string uicFileRel = this->AutogenBuildSubDir + "include/" + uiOutputFile; @@ -1555,11 +1555,11 @@ bool cmQtAutoGenerators::UicGenerateFile(const std::string& realName, this->LogError(ost.str()); } cmSystemTools::RemoveFile(uicFileAbs); - this->RunUicFailed = true; + this->UicRunFailed = true; } } else { // Parent directory creation failed - this->RunUicFailed = true; + this->UicRunFailed = true; } } return uicGenerated; @@ -1601,7 +1601,7 @@ bool cmQtAutoGenerators::RccGenerateAll() si != qrcGenMap.end(); ++si) { bool unique = FileNameIsUnique(si->first, qrcGenMap); if (!this->RccGenerateFile(si->first, si->second, unique)) { - if (this->RunRccFailed) { + if (this->RccRunFailed) { return false; } } @@ -1617,7 +1617,7 @@ bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile, bool unique_n) { bool rccGenerated = false; - bool generateRcc = this->GenerateAllRcc; + bool generateRcc = this->RccSettingsChanged; const std::string rccBuildFile = this->CurrentBinaryDir + rccOutputFile; @@ -1638,7 +1638,7 @@ bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile, } else { files = CM_NULLPTR; this->LogError(error); - this->RunRccFailed = true; + this->RccRunFailed = true; } } // Test if any input file is newer than the build file @@ -1664,7 +1664,7 @@ bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile, cmsys::SystemTools::GetFilenameWithoutLastExtension(rccInputFile); if (!unique_n) { symbolName += "_"; - symbolName += fpathCheckSum.getPart(rccInputFile); + symbolName += FPathChecksum.getPart(rccInputFile); } // Replace '-' with '_'. The former is valid for // file names but not for symbol names. @@ -1701,11 +1701,11 @@ bool cmQtAutoGenerators::RccGenerateFile(const std::string& rccInputFile, this->LogError(ost.str()); } cmSystemTools::RemoveFile(rccBuildFile); - this->RunRccFailed = true; + this->RccRunFailed = true; } } else { // Parent directory creation failed - this->RunRccFailed = true; + this->RccRunFailed = true; } } return rccGenerated; @@ -1831,7 +1831,7 @@ std::string cmQtAutoGenerators::ChecksumedPath(const std::string& sourceFile, const char* basePrefix, const char* baseSuffix) const { - std::string res = fpathCheckSum.getPart(sourceFile); + std::string res = FPathChecksum.getPart(sourceFile); res += "/"; res += basePrefix; res += cmsys::SystemTools::GetFilenameWithoutLastExtension(sourceFile); diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 24c0a33..a15efc1 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -23,7 +23,7 @@ public: bool Run(const std::string& targetDirectory, const std::string& config); private: - // - Types + // -- Types /// @brief Used to extract additional dependencies from content text struct MocDependFilter @@ -31,9 +31,9 @@ private: std::string key; cmsys::RegularExpression regExp; }; - typedef std::pair<std::string, cmsys::RegularExpression> MacroFilter; + typedef std::pair<std::string, cmsys::RegularExpression> MocMacroFilter; - // - Configuration + // -- Configuration bool MocDependFilterPush(const std::string& key, const std::string& regExp); bool ReadAutogenInfoFile(cmMakefile* makefile, const std::string& targetDirectory, @@ -43,22 +43,22 @@ private: bool UicEnabled() const { return !this->UicExecutable.empty(); } bool RccEnabled() const { return !this->RccExecutable.empty(); } - // - Settings file + // -- Settings file void SettingsFileRead(cmMakefile* makefile, const std::string& targetDirectory); bool SettingsFileWrite(const std::string& targetDirectory); - bool GenerateAllAny() const + bool AnySettingsChanged() const { - return (this->GenerateAllMoc || this->GenerateAllRcc || - this->GenerateAllUic); + return (this->MocSettingsChanged || this->RccSettingsChanged || + this->UicSettingsChanged); } - // - Init and run + // -- Init and run void Init(cmMakefile* makefile); bool RunAutogen(); - // - Content analysis + // -- Content analysis bool MocRequired(const std::string& contentText, std::string* macroName = CM_NULLPTR); void MocFindDepends( @@ -101,7 +101,7 @@ private: std::map<std::string, std::string>& mocsNotIncluded, std::map<std::string, std::set<std::string> >& mocDepends); - // - Moc file generation + // -- Moc file generation bool MocGenerateAll( const std::map<std::string, std::string>& mocsIncluded, const std::map<std::string, std::string>& mocsNotIncluded, @@ -111,7 +111,7 @@ private: const std::string& subDir, const std::map<std::string, std::set<std::string> >& mocDepends); - // - Uic file generation + // -- Uic file generation bool UicFindIncludedFile(std::string& absFile, const std::string& sourceFile, const std::string& includeString); bool UicGenerateAll( @@ -120,12 +120,12 @@ private: const std::string& uiInputFile, const std::string& uiOutputFile); - // - Rcc file generation + // -- Rcc file generation bool RccGenerateAll(); bool RccGenerateFile(const std::string& qrcInputFile, const std::string& qrcOutputFile, bool unique_n); - // - Logging + // -- Logging void LogErrorNameCollision( const std::string& message, const std::multimap<std::string, std::string>& collisions) const; @@ -135,7 +135,7 @@ private: void LogError(const std::string& message) const; void LogCommand(const std::vector<std::string>& command) const; - // - Utility + // -- Utility bool NameCollisionTest( const std::map<std::string, std::string>& genFiles, std::multimap<std::string, std::string>& collisions) const; @@ -153,28 +153,36 @@ private: bool MocFindIncludedFile(std::string& absFile, const std::string& sourceFile, const std::string& includeString) const; - // - Target names + // -- Target names std::string OriginTargetName; std::string AutogenTargetName; - // - Directories + // -- Directories std::string ProjectSourceDir; std::string ProjectBinaryDir; std::string CurrentSourceDir; std::string CurrentBinaryDir; std::string AutogenBuildSubDir; - // - Qt environment + // -- Qt environment std::string QtMajorVersion; std::string MocExecutable; std::string UicExecutable; std::string RccExecutable; - // - File lists + // -- File lists std::vector<std::string> Sources; std::vector<std::string> Headers; - // - Settings + std::vector<std::string> HeaderExtensions; + cmFilePathChecksum FPathChecksum; + // -- Settings + bool IncludeProjectDirsBefore; + bool Verbose; + bool ColorOutput; std::string SettingsStringMoc; std::string SettingsStringUic; std::string SettingsStringRcc; - // - Moc + // -- Moc + bool MocSettingsChanged; + bool MocRelaxedMode; + bool MocRunFailed; std::string MocCppFilenameRel; std::string MocCppFilenameAbs; std::string MocPredefsFileRel; @@ -184,35 +192,24 @@ private: std::vector<std::string> MocIncludes; std::vector<std::string> MocDefinitions; std::vector<std::string> MocOptions; + std::vector<std::string> MocPredefsCmd; std::vector<MocDependFilter> MocDependFilters; - // - Uic + MocMacroFilter MocMacroFilters[2]; + cmsys::RegularExpression MocRegExpInclude; + // -- Uic + bool UicSettingsChanged; + bool UicRunFailed; std::vector<std::string> UicSkipList; std::vector<std::string> UicTargetOptions; std::map<std::string, std::string> UicOptions; std::vector<std::string> UicSearchPaths; - // - Rcc + cmsys::RegularExpression UicRegExpInclude; + // -- Rcc + bool RccSettingsChanged; + bool RccRunFailed; std::vector<std::string> RccSources; std::map<std::string, std::string> RccOptions; std::map<std::string, std::vector<std::string> > RccInputs; - // - Utility - cmFilePathChecksum fpathCheckSum; - std::vector<std::string> HeaderExtensions; - MacroFilter MacroFilters[2]; - cmsys::RegularExpression RegExpMocInclude; - cmsys::RegularExpression RegExpUicInclude; - // - moc_predefs - std::vector<std::string> MocPredefsCmd; - // - Flags - bool IncludeProjectDirsBefore; - bool Verbose; - bool ColorOutput; - bool RunMocFailed; - bool RunUicFailed; - bool RunRccFailed; - bool GenerateAllMoc; - bool GenerateAllUic; - bool GenerateAllRcc; - bool MocRelaxedMode; }; #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5d1671324bbcf0826b32c4c1691ae0f1041430ed commit 5d1671324bbcf0826b32c4c1691ae0f1041430ed Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 10:09:41 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 10:09:41 2017 +0200 cmConfigure: provide macros CM_EQ_DELETE and CM_DISABLE_COPY diff --git a/Source/Checks/cm_cxx_eq_delete.cxx b/Source/Checks/cm_cxx_eq_delete.cxx new file mode 100644 index 0000000..809e4cf --- /dev/null +++ b/Source/Checks/cm_cxx_eq_delete.cxx @@ -0,0 +1,14 @@ +struct Foo +{ + Foo() {} + ~Foo() {} + Foo(Foo const&) = delete; + Foo& operator=(Foo const&) = delete; + int test() const { return 0; } +}; + +int main() +{ + Foo const foo; + return foo.test(); +} diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake index 80c9f3b..cd58539 100644 --- a/Source/Checks/cm_cxx_features.cmake +++ b/Source/Checks/cm_cxx_features.cmake @@ -33,6 +33,7 @@ endfunction() if(CMAKE_CXX_STANDARD) cm_check_cxx_feature(auto_ptr) + cm_check_cxx_feature(eq_delete) cm_check_cxx_feature(make_unique) if(CMake_HAVE_CXX_MAKE_UNIQUE) set(CMake_HAVE_CXX_UNIQUE_PTR 1) diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in index e30b43f..970fde5 100644 --- a/Source/cmConfigure.cmake.h.in +++ b/Source/cmConfigure.cmake.h.in @@ -21,6 +21,7 @@ #cmakedefine CMAKE_USE_MACH_PARSER #cmakedefine CMAKE_USE_LIBUV #cmakedefine CMake_HAVE_CXX_AUTO_PTR +#cmakedefine CMake_HAVE_CXX_EQ_DELETE #cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE #cmakedefine CMake_HAVE_CXX_NULLPTR #cmakedefine CMake_HAVE_CXX_OVERRIDE @@ -30,6 +31,12 @@ #define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@" #define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@" +#ifdef CMake_HAVE_CXX_EQ_DELETE +#define CM_EQ_DELETE = delete +#else +#define CM_EQ_DELETE +#endif + #ifdef CMake_HAVE_CXX_NULLPTR #define CM_NULLPTR nullptr #else @@ -42,4 +49,8 @@ #define CM_OVERRIDE #endif +#define CM_DISABLE_COPY(Class) \ + Class(Class const&) CM_EQ_DELETE; \ + Class& operator=(Class const&) CM_EQ_DELETE; + #endif diff --git a/bootstrap b/bootstrap index 4f58365..e957e82 100755 --- a/bootstrap +++ b/bootstrap @@ -1369,8 +1369,10 @@ cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_ cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\"" cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\"" cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP" +cmake_report cmConfigure.h${_tmp} "#define CM_EQ_DELETE" cmake_report cmConfigure.h${_tmp} "#define CM_NULLPTR 0" cmake_report cmConfigure.h${_tmp} "#define CM_OVERRIDE" +cmake_report cmConfigure.h${_tmp} "#define CM_DISABLE_COPY(Class)" # Regenerate configured headers for h in Configure VersionConfig; do https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=99d50d2b25d20ffe34bb081fb386b39612d938d7 commit 99d50d2b25d20ffe34bb081fb386b39612d938d7 Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:45:45 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:20 2017 +0200 cmLinkLineComputer: make noncopyable diff --git a/Source/cmLinkLineComputer.h b/Source/cmLinkLineComputer.h index bf65347..d8dacf3 100644 --- a/Source/cmLinkLineComputer.h +++ b/Source/cmLinkLineComputer.h @@ -41,6 +41,9 @@ public: std::string const& config); protected: + cmLinkLineComputer(cmLinkLineComputer const&); + cmLinkLineComputer& operator=(cmLinkLineComputer const&); + std::string ComputeLinkLibs(cmComputeLinkInformation& cli); std::string ComputeRPath(cmComputeLinkInformation& cli); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44b8debff4fb2fff6f784c0e5dd4fcb78f113d21 commit 44b8debff4fb2fff6f784c0e5dd4fcb78f113d21 Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:42:20 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:20 2017 +0200 cmGlobalGenerator::DirectoryContent: remove custom copy ctor diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index aa2dd22..cc7ffed 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -560,12 +560,6 @@ private: : LastDiskTime(-1) { } - DirectoryContent(DirectoryContent const& dc) - : LastDiskTime(dc.LastDiskTime) - , All(dc.All) - , Generated(dc.Generated) - { - } }; std::map<std::string, DirectoryContent> DirectoryContentMap; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=73bedfea3871235ba842979625053f706d9dcd49 commit 73bedfea3871235ba842979625053f706d9dcd49 Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:41:09 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:19 2017 +0200 cmTargetDepend: pass by value diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h index 1839923..daa902e 100644 --- a/Source/cmTargetDepend.h +++ b/Source/cmTargetDepend.h @@ -30,7 +30,7 @@ public: operator cmGeneratorTarget const*() const { return this->Target; } cmGeneratorTarget const* operator->() const { return this->Target; } cmGeneratorTarget const& operator*() const { return *this->Target; } - friend bool operator<(cmTargetDepend const& l, cmTargetDepend const& r) + friend bool operator<(cmTargetDepend l, cmTargetDepend r) { return l.Target < r.Target; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e6c606c7ba0ab1f9649de6a93aed5f98237276db commit e6c606c7ba0ab1f9649de6a93aed5f98237276db Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:38:46 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:19 2017 +0200 cmGeneratorTarget::SourceFileFlags: remove custom copy ctor diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 8a687e8..ae12f97 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -512,11 +512,6 @@ public: , MacFolder(CM_NULLPTR) { } - SourceFileFlags(SourceFileFlags const& r) - : Type(r.Type) - , MacFolder(r.MacFolder) - { - } SourceFileType Type; const char* MacFolder; // location inside Mac content folders }; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8d090ff253eff158cf6cbf63d8b7c2189a03f39c commit 8d090ff253eff158cf6cbf63d8b7c2189a03f39c Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:37:13 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:19 2017 +0200 cmLinkImplItem: remove custom copy ctor diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index 62e5f1d..f0fded2 100644 --- a/Source/cmLinkItem.h +++ b/Source/cmLinkItem.h @@ -51,12 +51,6 @@ public: , FromGenex(fromGenex) { } - cmLinkImplItem(cmLinkImplItem const& r) - : cmLinkItem(r) - , Backtrace(r.Backtrace) - , FromGenex(r.FromGenex) - { - } cmListFileBacktrace Backtrace; bool FromGenex; }; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a8a9577e468b92f690b72e1ed03891a2df0cd2f9 commit a8a9577e468b92f690b72e1ed03891a2df0cd2f9 Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:35:39 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:19 2017 +0200 cmLinkItem: remove custom copy ctor diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h index ae300e6..62e5f1d 100644 --- a/Source/cmLinkItem.h +++ b/Source/cmLinkItem.h @@ -32,11 +32,6 @@ public: , Target(t) { } - cmLinkItem(cmLinkItem const& r) - : std_string(r) - , Target(r.Target) - { - } cmGeneratorTarget const* Target; }; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf955e58f7b44d0371ff224738cff25274202ba4 commit bf955e58f7b44d0371ff224738cff25274202ba4 Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:33:34 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:19 2017 +0200 cmComputeLinkInformation::Item: remove custom copy ctor diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 60878e4..00e3ad2 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -36,12 +36,6 @@ public: , Target(CM_NULLPTR) { } - Item(Item const& item) - : Value(item.Value) - , IsPath(item.IsPath) - , Target(item.Target) - { - } Item(std::string const& v, bool p, cmGeneratorTarget const* target = CM_NULLPTR) : Value(v) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b44659f5e8c66d9a4fc8345f083530442ea240c1 commit b44659f5e8c66d9a4fc8345f083530442ea240c1 Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:31:52 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:19 2017 +0200 cmCryptoHash: make noncopyable diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h index 021ad10..ac92c48 100644 --- a/Source/cmCryptoHash.h +++ b/Source/cmCryptoHash.h @@ -78,6 +78,9 @@ public: std::string FinalizeHex(); private: + cmCryptoHash(cmCryptoHash const&); + cmCryptoHash& operator=(cmCryptoHash const&); + unsigned int Id; struct rhash_context* CTX; }; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7284b15f8c9bb20618e5286b41ff2f13245dfb9c commit 7284b15f8c9bb20618e5286b41ff2f13245dfb9c Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:25:01 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:18 2017 +0200 cmScriptGenerator: pass Indent by value diff --git a/Source/cmCPackPropertiesGenerator.cxx b/Source/cmCPackPropertiesGenerator.cxx index ae6b0a1..57a8b38 100644 --- a/Source/cmCPackPropertiesGenerator.cxx +++ b/Source/cmCPackPropertiesGenerator.cxx @@ -19,7 +19,7 @@ cmCPackPropertiesGenerator::cmCPackPropertiesGenerator( } void cmCPackPropertiesGenerator::GenerateScriptForConfig( - std::ostream& os, const std::string& config, Indent const& indent) + std::ostream& os, const std::string& config, Indent indent) { std::string const& expandedFileName = this->InstalledFile.GetNameExpression().Evaluate(this->LG, config); diff --git a/Source/cmCPackPropertiesGenerator.h b/Source/cmCPackPropertiesGenerator.h index 6df5297..107ccf9 100644 --- a/Source/cmCPackPropertiesGenerator.h +++ b/Source/cmCPackPropertiesGenerator.h @@ -27,7 +27,7 @@ public: protected: void GenerateScriptForConfig(std::ostream& os, const std::string& config, - Indent const& indent) CM_OVERRIDE; + Indent indent) CM_OVERRIDE; cmLocalGenerator* LG; cmInstalledFile const& InstalledFile; diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx index dfb3aeb..54ad85c 100644 --- a/Source/cmInstallDirectoryGenerator.cxx +++ b/Source/cmInstallDirectoryGenerator.cxx @@ -48,7 +48,7 @@ void cmInstallDirectoryGenerator::Compute(cmLocalGenerator* lg) } void cmInstallDirectoryGenerator::GenerateScriptActions(std::ostream& os, - Indent const& indent) + Indent indent) { if (this->ActionsPerConfig) { this->cmInstallGenerator::GenerateScriptActions(os, indent); @@ -58,7 +58,7 @@ void cmInstallDirectoryGenerator::GenerateScriptActions(std::ostream& os, } void cmInstallDirectoryGenerator::GenerateScriptForConfig( - std::ostream& os, const std::string& config, Indent const& indent) + std::ostream& os, const std::string& config, Indent indent) { std::vector<std::string> dirs; cmGeneratorExpression ge; @@ -82,7 +82,7 @@ void cmInstallDirectoryGenerator::GenerateScriptForConfig( } void cmInstallDirectoryGenerator::AddDirectoryInstallRule( - std::ostream& os, const std::string& config, Indent const& indent, + std::ostream& os, const std::string& config, Indent indent, std::vector<std::string> const& dirs) { // Write code to install the directories. diff --git a/Source/cmInstallDirectoryGenerator.h b/Source/cmInstallDirectoryGenerator.h index 029ce46..aa2cbc6 100644 --- a/Source/cmInstallDirectoryGenerator.h +++ b/Source/cmInstallDirectoryGenerator.h @@ -34,12 +34,11 @@ public: std::string GetDestination(std::string const& config) const; protected: - void GenerateScriptActions(std::ostream& os, - Indent const& indent) CM_OVERRIDE; + void GenerateScriptActions(std::ostream& os, Indent indent) CM_OVERRIDE; void GenerateScriptForConfig(std::ostream& os, const std::string& config, - Indent const& indent) CM_OVERRIDE; + Indent indent) CM_OVERRIDE; void AddDirectoryInstallRule(std::ostream& os, const std::string& config, - Indent const& indent, + Indent indent, std::vector<std::string> const& dirs); cmLocalGenerator* LocalGenerator; std::vector<std::string> Directories; diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index 39fab4f..b176e85 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -166,7 +166,7 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os) } void cmInstallExportGenerator::GenerateScriptConfigs(std::ostream& os, - Indent const& indent) + Indent indent) { // Create the main install rules first. this->cmInstallGenerator::GenerateScriptConfigs(os, indent); @@ -189,7 +189,7 @@ void cmInstallExportGenerator::GenerateScriptConfigs(std::ostream& os, } void cmInstallExportGenerator::GenerateScriptActions(std::ostream& os, - Indent const& indent) + Indent indent) { // Remove old per-configuration export files if the main changes. std::string installedDir = "$ENV{DESTDIR}"; diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h index 3a46a72..047e6b3 100644 --- a/Source/cmInstallExportGenerator.h +++ b/Source/cmInstallExportGenerator.h @@ -44,10 +44,8 @@ public: protected: void GenerateScript(std::ostream& os) CM_OVERRIDE; - void GenerateScriptConfigs(std::ostream& os, - Indent const& indent) CM_OVERRIDE; - void GenerateScriptActions(std::ostream& os, - Indent const& indent) CM_OVERRIDE; + void GenerateScriptConfigs(std::ostream& os, Indent indent) CM_OVERRIDE; + void GenerateScriptActions(std::ostream& os, Indent indent) CM_OVERRIDE; void GenerateImportFile(cmExportSet const* exportSet); void GenerateImportFile(const char* config, cmExportSet const* exportSet); void ComputeTempDir(); diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index 7daea38..6323a91 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx @@ -54,7 +54,7 @@ std::string cmInstallFilesGenerator::GetDestination( } void cmInstallFilesGenerator::AddFilesInstallRule( - std::ostream& os, std::string const& config, Indent const& indent, + std::ostream& os, std::string const& config, Indent indent, std::vector<std::string> const& files) { // Write code to install the files. @@ -67,7 +67,7 @@ void cmInstallFilesGenerator::AddFilesInstallRule( } void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os, - Indent const& indent) + Indent indent) { if (this->ActionsPerConfig) { this->cmInstallGenerator::GenerateScriptActions(os, indent); @@ -77,7 +77,7 @@ void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os, } void cmInstallFilesGenerator::GenerateScriptForConfig( - std::ostream& os, const std::string& config, Indent const& indent) + std::ostream& os, const std::string& config, Indent indent) { std::vector<std::string> files; cmGeneratorExpression ge; diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h index 578763b..62b57f9 100644 --- a/Source/cmInstallFilesGenerator.h +++ b/Source/cmInstallFilesGenerator.h @@ -34,12 +34,11 @@ public: std::string GetDestination(std::string const& config) const; protected: - void GenerateScriptActions(std::ostream& os, - Indent const& indent) CM_OVERRIDE; + void GenerateScriptActions(std::ostream& os, Indent indent) CM_OVERRIDE; void GenerateScriptForConfig(std::ostream& os, const std::string& config, - Indent const& indent) CM_OVERRIDE; + Indent indent) CM_OVERRIDE; void AddFilesInstallRule(std::ostream& os, std::string const& config, - Indent const& indent, + Indent indent, std::vector<std::string> const& files); cmLocalGenerator* LocalGenerator; diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 1827ed3..84d6f7a 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -58,7 +58,7 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os) } void cmInstallTargetGenerator::GenerateScriptForConfig( - std::ostream& os, const std::string& config, Indent const& indent) + std::ostream& os, const std::string& config, Indent indent) { cmStateEnums::TargetType targetType = this->Target->GetType(); cmInstallType type = cmInstallType(); @@ -339,7 +339,7 @@ static std::string computeInstallObjectDir(cmGeneratorTarget* gt, } void cmInstallTargetGenerator::GenerateScriptForConfigObjectLibrary( - std::ostream& os, const std::string& config, Indent const& indent) + std::ostream& os, const std::string& config, Indent indent) { // Compute all the object files inside this target std::vector<std::string> objects; @@ -444,7 +444,7 @@ void cmInstallTargetGenerator::Compute(cmLocalGenerator* lg) this->Target = lg->FindLocalNonAliasGeneratorTarget(this->TargetName); } -void cmInstallTargetGenerator::AddTweak(std::ostream& os, Indent const& indent, +void cmInstallTargetGenerator::AddTweak(std::ostream& os, Indent indent, const std::string& config, std::string const& file, TweakMethod tweak) @@ -460,7 +460,7 @@ void cmInstallTargetGenerator::AddTweak(std::ostream& os, Indent const& indent, } } -void cmInstallTargetGenerator::AddTweak(std::ostream& os, Indent const& indent, +void cmInstallTargetGenerator::AddTweak(std::ostream& os, Indent indent, const std::string& config, std::vector<std::string> const& files, TweakMethod tweak) @@ -500,7 +500,7 @@ std::string cmInstallTargetGenerator::GetDestDirPath(std::string const& file) } void cmInstallTargetGenerator::PreReplacementTweaks(std::ostream& os, - Indent const& indent, + Indent indent, const std::string& config, std::string const& file) { @@ -508,7 +508,7 @@ void cmInstallTargetGenerator::PreReplacementTweaks(std::ostream& os, } void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os, - Indent const& indent, + Indent indent, const std::string& config, std::string const& file) { @@ -520,7 +520,7 @@ void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os, } void cmInstallTargetGenerator::AddInstallNamePatchRule( - std::ostream& os, Indent const& indent, const std::string& config, + std::ostream& os, Indent indent, const std::string& config, std::string const& toDestDirPath) { if (this->ImportLibrary || @@ -621,7 +621,7 @@ void cmInstallTargetGenerator::AddInstallNamePatchRule( } void cmInstallTargetGenerator::AddRPathCheckRule( - std::ostream& os, Indent const& indent, const std::string& config, + std::ostream& os, Indent indent, const std::string& config, std::string const& toDestDirPath) { // Skip the chrpath if the target does not need it. @@ -655,7 +655,7 @@ void cmInstallTargetGenerator::AddRPathCheckRule( } void cmInstallTargetGenerator::AddChrpathPatchRule( - std::ostream& os, Indent const& indent, const std::string& config, + std::ostream& os, Indent indent, const std::string& config, std::string const& toDestDirPath) { // Skip the chrpath if the target does not need it. @@ -750,8 +750,7 @@ void cmInstallTargetGenerator::AddChrpathPatchRule( } } -void cmInstallTargetGenerator::AddStripRule(std::ostream& os, - Indent const& indent, +void cmInstallTargetGenerator::AddStripRule(std::ostream& os, Indent indent, const std::string& toDestDirPath) { @@ -779,8 +778,7 @@ void cmInstallTargetGenerator::AddStripRule(std::ostream& os, os << indent << "endif()\n"; } -void cmInstallTargetGenerator::AddRanlibRule(std::ostream& os, - Indent const& indent, +void cmInstallTargetGenerator::AddRanlibRule(std::ostream& os, Indent indent, const std::string& toDestDirPath) { // Static libraries need ranlib on this platform. @@ -805,7 +803,7 @@ void cmInstallTargetGenerator::AddRanlibRule(std::ostream& os, } void cmInstallTargetGenerator::AddUniversalInstallRule( - std::ostream& os, Indent const& indent, const std::string& toDestDirPath) + std::ostream& os, Indent indent, const std::string& toDestDirPath) { cmMakefile const* mf = this->Target->Target->GetMakefile(); diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h index 6aaa3ba..cf2de58 100644 --- a/Source/cmInstallTargetGenerator.h +++ b/Source/cmInstallTargetGenerator.h @@ -67,42 +67,39 @@ public: protected: void GenerateScript(std::ostream& os) CM_OVERRIDE; void GenerateScriptForConfig(std::ostream& os, const std::string& config, - Indent const& indent) CM_OVERRIDE; + Indent indent) CM_OVERRIDE; void GenerateScriptForConfigObjectLibrary(std::ostream& os, const std::string& config, - Indent const& indent); - typedef void (cmInstallTargetGenerator::*TweakMethod)(std::ostream&, - Indent const&, + Indent indent); + typedef void (cmInstallTargetGenerator::*TweakMethod)(std::ostream&, Indent, const std::string&, std::string const&); - void AddTweak(std::ostream& os, Indent const& indent, - const std::string& config, std::string const& file, - TweakMethod tweak); - void AddTweak(std::ostream& os, Indent const& indent, - const std::string& config, + void AddTweak(std::ostream& os, Indent indent, const std::string& config, + std::string const& file, TweakMethod tweak); + void AddTweak(std::ostream& os, Indent indent, const std::string& config, std::vector<std::string> const& files, TweakMethod tweak); std::string GetDestDirPath(std::string const& file); - void PreReplacementTweaks(std::ostream& os, Indent const& indent, + void PreReplacementTweaks(std::ostream& os, Indent indent, const std::string& config, std::string const& file); - void PostReplacementTweaks(std::ostream& os, Indent const& indent, + void PostReplacementTweaks(std::ostream& os, Indent indent, const std::string& config, std::string const& file); - void AddInstallNamePatchRule(std::ostream& os, Indent const& indent, + void AddInstallNamePatchRule(std::ostream& os, Indent indent, const std::string& config, const std::string& toDestDirPath); - void AddChrpathPatchRule(std::ostream& os, Indent const& indent, + void AddChrpathPatchRule(std::ostream& os, Indent indent, const std::string& config, std::string const& toDestDirPath); - void AddRPathCheckRule(std::ostream& os, Indent const& indent, + void AddRPathCheckRule(std::ostream& os, Indent indent, const std::string& config, std::string const& toDestDirPath); - void AddStripRule(std::ostream& os, Indent const& indent, + void AddStripRule(std::ostream& os, Indent indent, const std::string& toDestDirPath); - void AddRanlibRule(std::ostream& os, Indent const& indent, + void AddRanlibRule(std::ostream& os, Indent indent, const std::string& toDestDirPath); - void AddUniversalInstallRule(std::ostream& os, Indent const& indent, + void AddUniversalInstallRule(std::ostream& os, Indent indent, const std::string& toDestDirPath); std::string TargetName; diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx index 2a2dd40..3cf2537 100644 --- a/Source/cmScriptGenerator.cxx +++ b/Source/cmScriptGenerator.cxx @@ -90,8 +90,7 @@ void cmScriptGenerator::GenerateScript(std::ostream& os) this->GenerateScriptConfigs(os, indent); } -void cmScriptGenerator::GenerateScriptConfigs(std::ostream& os, - Indent const& indent) +void cmScriptGenerator::GenerateScriptConfigs(std::ostream& os, Indent indent) { if (this->ActionsPerConfig) { this->GenerateScriptActionsPerConfig(os, indent); @@ -100,8 +99,7 @@ void cmScriptGenerator::GenerateScriptConfigs(std::ostream& os, } } -void cmScriptGenerator::GenerateScriptActions(std::ostream& os, - Indent const& indent) +void cmScriptGenerator::GenerateScriptActions(std::ostream& os, Indent indent) { if (this->ActionsPerConfig) { // This is reached for single-configuration build generators in a @@ -112,7 +110,7 @@ void cmScriptGenerator::GenerateScriptActions(std::ostream& os, void cmScriptGenerator::GenerateScriptForConfig(std::ostream& /*unused*/, const std::string& /*unused*/, - Indent const& /*unused*/) + Indent /*unused*/) { // No actions for this generator. } @@ -138,7 +136,7 @@ bool cmScriptGenerator::GeneratesForConfig(const std::string& config) } void cmScriptGenerator::GenerateScriptActionsOnce(std::ostream& os, - Indent const& indent) + Indent indent) { if (this->Configurations.empty()) { // This rule is for all configurations. @@ -153,7 +151,7 @@ void cmScriptGenerator::GenerateScriptActionsOnce(std::ostream& os, } void cmScriptGenerator::GenerateScriptActionsPerConfig(std::ostream& os, - Indent const& indent) + Indent indent) { if (this->ConfigurationTypes->empty()) { // In a single-configuration generator there is only one action diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h index de2b60d..4023f3e 100644 --- a/Source/cmScriptGenerator.h +++ b/Source/cmScriptGenerator.h @@ -35,7 +35,7 @@ private: int Level; }; inline std::ostream& operator<<(std::ostream& os, - cmScriptGeneratorIndent const& indent) + cmScriptGeneratorIndent indent) { indent.Write(os); return os; @@ -58,12 +58,12 @@ public: protected: typedef cmScriptGeneratorIndent Indent; virtual void GenerateScript(std::ostream& os); - virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent); - virtual void GenerateScriptActions(std::ostream& os, Indent const& indent); + virtual void GenerateScriptConfigs(std::ostream& os, Indent indent); + virtual void GenerateScriptActions(std::ostream& os, Indent indent); virtual void GenerateScriptForConfig(std::ostream& os, const std::string& config, - Indent const& indent); - virtual void GenerateScriptNoConfig(std::ostream&, Indent const&) {} + Indent indent); + virtual void GenerateScriptNoConfig(std::ostream&, Indent) {} virtual bool NeedsScriptNoConfig() const { return false; } // Test if this generator does something for a given configuration. @@ -90,8 +90,8 @@ private: cmScriptGenerator(cmScriptGenerator const&); cmScriptGenerator& operator=(cmScriptGenerator const&); - void GenerateScriptActionsOnce(std::ostream& os, Indent const& indent); - void GenerateScriptActionsPerConfig(std::ostream& os, Indent const& indent); + void GenerateScriptActionsOnce(std::ostream& os, Indent indent); + void GenerateScriptActionsPerConfig(std::ostream& os, Indent indent); }; #endif diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx index 4164f3a..be4b378 100644 --- a/Source/cmTestGenerator.cxx +++ b/Source/cmTestGenerator.cxx @@ -35,15 +35,13 @@ void cmTestGenerator::Compute(cmLocalGenerator* lg) this->LG = lg; } -void cmTestGenerator::GenerateScriptConfigs(std::ostream& os, - Indent const& indent) +void cmTestGenerator::GenerateScriptConfigs(std::ostream& os, Indent indent) { // Create the tests. this->cmScriptGenerator::GenerateScriptConfigs(os, indent); } -void cmTestGenerator::GenerateScriptActions(std::ostream& os, - Indent const& indent) +void cmTestGenerator::GenerateScriptActions(std::ostream& os, Indent indent) { if (this->ActionsPerConfig) { // This is the per-config generation in a single-configuration @@ -59,7 +57,7 @@ void cmTestGenerator::GenerateScriptActions(std::ostream& os, void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, const std::string& config, - Indent const& indent) + Indent indent) { this->TestGenerated = true; @@ -125,8 +123,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, } } -void cmTestGenerator::GenerateScriptNoConfig(std::ostream& os, - Indent const& indent) +void cmTestGenerator::GenerateScriptNoConfig(std::ostream& os, Indent indent) { os << indent << "add_test(" << this->Test->GetName() << " NOT_AVAILABLE)\n"; } @@ -139,8 +136,7 @@ bool cmTestGenerator::NeedsScriptNoConfig() const !this->ConfigurationTypes->empty()); // config-dependent command } -void cmTestGenerator::GenerateOldStyle(std::ostream& fout, - Indent const& indent) +void cmTestGenerator::GenerateOldStyle(std::ostream& fout, Indent indent) { this->TestGenerated = true; diff --git a/Source/cmTestGenerator.h b/Source/cmTestGenerator.h index 7214375..9a25e33 100644 --- a/Source/cmTestGenerator.h +++ b/Source/cmTestGenerator.h @@ -29,16 +29,13 @@ public: void Compute(cmLocalGenerator* lg); protected: - void GenerateScriptConfigs(std::ostream& os, - Indent const& indent) CM_OVERRIDE; - void GenerateScriptActions(std::ostream& os, - Indent const& indent) CM_OVERRIDE; + void GenerateScriptConfigs(std::ostream& os, Indent indent) CM_OVERRIDE; + void GenerateScriptActions(std::ostream& os, Indent indent) CM_OVERRIDE; void GenerateScriptForConfig(std::ostream& os, const std::string& config, - Indent const& indent) CM_OVERRIDE; - void GenerateScriptNoConfig(std::ostream& os, - Indent const& indent) CM_OVERRIDE; + Indent indent) CM_OVERRIDE; + void GenerateScriptNoConfig(std::ostream& os, Indent indent) CM_OVERRIDE; bool NeedsScriptNoConfig() const CM_OVERRIDE; - void GenerateOldStyle(std::ostream& os, Indent const& indent); + void GenerateOldStyle(std::ostream& os, Indent indent); cmLocalGenerator* LG; cmTest* Test; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e99dd765b750e666975837143986237f2e33138a commit e99dd765b750e666975837143986237f2e33138a Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:15:21 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:18 2017 +0200 cmScriptGenerator: make noncopyable diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h index 0e98b27..de2b60d 100644 --- a/Source/cmScriptGenerator.h +++ b/Source/cmScriptGenerator.h @@ -87,6 +87,9 @@ protected: bool ActionsPerConfig; private: + cmScriptGenerator(cmScriptGenerator const&); + cmScriptGenerator& operator=(cmScriptGenerator const&); + void GenerateScriptActionsOnce(std::ostream& os, Indent const& indent); void GenerateScriptActionsPerConfig(std::ostream& os, Indent const& indent); }; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d921e8eb6c0ae7e8ad2db1f599de1d5c08dd92ea commit d921e8eb6c0ae7e8ad2db1f599de1d5c08dd92ea Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:12:50 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:18 2017 +0200 cmMakefile::ScopePushPop: make noncopyable diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 7543a89..2f4cea6 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -717,6 +717,8 @@ public: } ~ScopePushPop() { this->Makefile->PopScope(); } private: + ScopePushPop(ScopePushPop const&); + ScopePushPop& operator=(ScopePushPop const&); cmMakefile* Makefile; }; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=41a97653861596b2ead1a078eccee876abec735d commit 41a97653861596b2ead1a078eccee876abec735d Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:11:20 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:18 2017 +0200 cmStateDetail::PolicyStackEntry: remove custom copy ctor diff --git a/Source/cmStatePrivate.h b/Source/cmStatePrivate.h index b2c6a7c..f36ee37 100644 --- a/Source/cmStatePrivate.h +++ b/Source/cmStatePrivate.h @@ -57,11 +57,6 @@ struct cmStateDetail::PolicyStackEntry : public cmPolicies::PolicyMap , Weak(w) { } - PolicyStackEntry(PolicyStackEntry const& r) - : derived(r) - , Weak(r.Weak) - { - } bool Weak; }; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5d85a31d954e6f6ee03bf2ac1f91d90da3e5164 commit a5d85a31d954e6f6ee03bf2ac1f91d90da3e5164 Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Sat Apr 22 00:09:44 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Sat Apr 22 00:48:18 2017 +0200 cmDefinitions::Def: remove custom copy ctor diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 160e8e1..ddb8918 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -65,12 +65,6 @@ private: , Used(false) { } - Def(Def const& d) - : std_string(d) - , Exists(d.Exists) - , Used(d.Used) - { - } bool Exists; bool Used; }; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a28894e4d412000a4b9850fe9f41c7b1c1499a8d commit a28894e4d412000a4b9850fe9f41c7b1c1499a8d Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Fri Apr 21 22:00:09 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Fri Apr 21 22:00:09 2017 +0200 cmCommandArgumentParserHelper: make noncopyable diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h index 2b65a5a..c0c1cd9 100644 --- a/Source/cmCommandArgumentParserHelper.h +++ b/Source/cmCommandArgumentParserHelper.h @@ -60,6 +60,10 @@ public: char BSLASHVariable[3]; private: + cmCommandArgumentParserHelper(cmCommandArgumentParserHelper const&); + cmCommandArgumentParserHelper& operator=( + cmCommandArgumentParserHelper const&); + std::string::size_type InputBufferPos; std::string InputBuffer; std::vector<char> OutputBuffer; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=765822add7896f256078006191b2629bcf778849 commit 765822add7896f256078006191b2629bcf778849 Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Fri Apr 21 21:55:04 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Fri Apr 21 21:55:04 2017 +0200 cmake: pass cmStateSnapshot by const ref diff --git a/Source/cmake.h b/Source/cmake.h index 4c292f0..6a6beb4 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -409,7 +409,7 @@ public: void WatchUnusedCli(const std::string& var); cmState* GetState() const { return this->State; } - void SetCurrentSnapshot(cmStateSnapshot snapshot) + void SetCurrentSnapshot(cmStateSnapshot const& snapshot) { this->CurrentSnapshot = snapshot; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d0995b7f8bc3ca6b88e8794ab03b0c7a1c2a8ca commit 0d0995b7f8bc3ca6b88e8794ab03b0c7a1c2a8ca Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Fri Apr 21 21:50:45 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Fri Apr 21 21:50:45 2017 +0200 cmListFileArgument: remove custom copy ctor diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index bda4ea3..aa11ba7 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -45,12 +45,6 @@ struct cmListFileArgument , Line(0) { } - cmListFileArgument(const cmListFileArgument& r) - : Value(r.Value) - , Delim(r.Delim) - , Line(r.Line) - { - } cmListFileArgument(const std::string& v, Delimiter d, long line) : Value(v) , Delim(d) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=44963b509b08b59081bbe3f0a55e806fa2c3152b commit 44963b509b08b59081bbe3f0a55e806fa2c3152b Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Fri Apr 21 21:46:58 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Fri Apr 21 21:46:58 2017 +0200 cmLocaleRAII: make noncopyable diff --git a/Source/cmLocale.h b/Source/cmLocale.h index b98009f..086f448 100644 --- a/Source/cmLocale.h +++ b/Source/cmLocale.h @@ -10,8 +10,6 @@ class cmLocaleRAII { - std::string OldLocale; - public: cmLocaleRAII() : OldLocale(setlocale(LC_CTYPE, CM_NULLPTR)) @@ -19,6 +17,12 @@ public: setlocale(LC_CTYPE, ""); } ~cmLocaleRAII() { setlocale(LC_CTYPE, this->OldLocale.c_str()); } + +private: + cmLocaleRAII(cmLocaleRAII const&); + cmLocaleRAII& operator=(cmLocaleRAII const&); + + std::string OldLocale; }; #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3f677f207653b33ff55d82e4d03653e146df3910 commit 3f677f207653b33ff55d82e4d03653e146df3910 Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Fri Apr 21 21:42:45 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Fri Apr 21 21:42:45 2017 +0200 cmGraphEdge: remove custom copy ctor Also, merge the other ctors using default args. diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h index 527db16..46cf878 100644 --- a/Source/cmGraphAdjacencyList.h +++ b/Source/cmGraphAdjacencyList.h @@ -15,26 +15,11 @@ class cmGraphEdge { public: - cmGraphEdge() - : Dest(0) - , Strong(true) - { - } - cmGraphEdge(int n) - : Dest(n) - , Strong(true) - { - } - cmGraphEdge(int n, bool s) + cmGraphEdge(int n = 0, bool s = true) : Dest(n) , Strong(s) { } - cmGraphEdge(cmGraphEdge const& r) - : Dest(r.Dest) - , Strong(r.Strong) - { - } operator int() const { return this->Dest; } bool IsStrong() const { return this->Strong; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b799ca42b8a2fdf7d92a75c0edc3292934a3926a commit b799ca42b8a2fdf7d92a75c0edc3292934a3926a Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Fri Apr 21 21:40:54 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Fri Apr 21 21:40:54 2017 +0200 cmAlgorithms: pass std::string by const ref diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index 70581ad..4adfe23 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -360,7 +360,8 @@ std::string cmWrap(std::string const& prefix, Range const& r, } template <typename Range> -std::string cmWrap(char prefix, Range const& r, char suffix, std::string sep) +std::string cmWrap(char prefix, Range const& r, char suffix, + std::string const& sep) { return cmWrap(std::string(1, prefix), r, std::string(1, suffix), sep); } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7d6090aec41770414c4f8b9fd78823f1322381d8 commit 7d6090aec41770414c4f8b9fd78823f1322381d8 Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Fri Apr 21 21:36:32 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Fri Apr 21 21:36:32 2017 +0200 cmSystemTools::SaveRestoreEnvironment: make noncopyable Also, make the destructor non-virtual. diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index a8a9995..3ba2c22 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -381,9 +381,12 @@ public: { public: SaveRestoreEnvironment(); - virtual ~SaveRestoreEnvironment(); + ~SaveRestoreEnvironment(); private: + SaveRestoreEnvironment(SaveRestoreEnvironment const&); + SaveRestoreEnvironment& operator=(SaveRestoreEnvironment const&); + std::vector<std::string> Env; }; #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=aecba65241ae837759472f1104442d299b42d571 commit aecba65241ae837759472f1104442d299b42d571 Author: Daniel Pfeifer <dan...@pfeifer-mail.de> AuthorDate: Fri Apr 21 21:33:22 2017 +0200 Commit: Daniel Pfeifer <dan...@pfeifer-mail.de> CommitDate: Fri Apr 21 21:33:22 2017 +0200 cmCLocaleEnvironmentScope: make noncopyable diff --git a/Source/cmCLocaleEnvironmentScope.h b/Source/cmCLocaleEnvironmentScope.h index c4065e1..1e7c42a 100644 --- a/Source/cmCLocaleEnvironmentScope.h +++ b/Source/cmCLocaleEnvironmentScope.h @@ -15,6 +15,9 @@ public: ~cmCLocaleEnvironmentScope(); private: + cmCLocaleEnvironmentScope(cmCLocaleEnvironmentScope const&); + cmCLocaleEnvironmentScope& operator=(cmCLocaleEnvironmentScope const&); + std::string GetEnv(std::string const& key); void SetEnv(std::string const& key, std::string const& value); ----------------------------------------------------------------------- Summary of changes: Source/Checks/cm_cxx_eq_delete.cxx | 14 + Source/Checks/cm_cxx_features.cmake | 1 + Source/cmAlgorithms.h | 3 +- Source/cmCLocaleEnvironmentScope.h | 3 + Source/cmCPackPropertiesGenerator.cxx | 2 +- Source/cmCPackPropertiesGenerator.h | 2 +- Source/cmCommandArgumentParserHelper.h | 4 + Source/cmComputeLinkInformation.h | 6 - Source/cmConfigure.cmake.h.in | 11 + Source/cmCryptoHash.h | 3 + Source/cmDefinitions.h | 6 - Source/cmGeneratorTarget.h | 5 - Source/cmGlobalGenerator.h | 6 - Source/cmGraphAdjacencyList.h | 17 +- Source/cmInstallDirectoryGenerator.cxx | 6 +- Source/cmInstallDirectoryGenerator.h | 7 +- Source/cmInstallExportGenerator.cxx | 4 +- Source/cmInstallExportGenerator.h | 6 +- Source/cmInstallFilesGenerator.cxx | 6 +- Source/cmInstallFilesGenerator.h | 7 +- Source/cmInstallTargetGenerator.cxx | 26 +- Source/cmInstallTargetGenerator.h | 31 +-- Source/cmLinkItem.h | 11 - Source/cmLinkLineComputer.h | 3 + Source/cmListFileCache.h | 6 - Source/cmLocale.h | 8 +- Source/cmMakefile.h | 2 + Source/cmQtAutoGenerators.cxx | 478 +++++++++++++++++--------------- Source/cmQtAutoGenerators.h | 93 ++++--- Source/cmScriptGenerator.cxx | 12 +- Source/cmScriptGenerator.h | 17 +- Source/cmStatePrivate.h | 5 - Source/cmSystemTools.h | 5 +- Source/cmTargetDepend.h | 2 +- Source/cmTestGenerator.cxx | 14 +- Source/cmTestGenerator.h | 13 +- Source/cmake.h | 2 +- bootstrap | 2 + 38 files changed, 433 insertions(+), 416 deletions(-) create mode 100644 Source/Checks/cm_cxx_eq_delete.cxx hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits