diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-04-22 12:54:34 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-04-22 12:54:34 (GMT) |
commit | d040459679371a234cb24ebed3701cd464cc5fc5 (patch) | |
tree | bc4318e666f986c1cddd0c1813af8b16f8edd794 | |
parent | 7c5f5f1a209952828ddce26827b96ab9b9143949 (diff) | |
download | CMake-d040459679371a234cb24ebed3701cd464cc5fc5.zip CMake-d040459679371a234cb24ebed3701cd464cc5fc5.tar.gz CMake-d040459679371a234cb24ebed3701cd464cc5fc5.tar.bz2 |
Autogen: Save the hash of the old settings string only
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 61 |
1 files changed, 34 insertions, 27 deletions
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 |