diff options
author | Brad King <brad.king@kitware.com> | 2015-06-08 14:34:53 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-06-08 14:34:53 (GMT) |
commit | 25136d73945f9e0a6fbfc4abfde61e4dbd10e6c6 (patch) | |
tree | 25201bbe5247f27136f985d31f1dbd0ac94b78f9 | |
parent | 534cc47cd603b10aecb212576d03c9f687dce292 (diff) | |
parent | cdf2cba3e71b92c5bddf7afe760c131953f999a4 (diff) | |
download | CMake-25136d73945f9e0a6fbfc4abfde61e4dbd10e6c6.zip CMake-25136d73945f9e0a6fbfc4abfde61e4dbd10e6c6.tar.gz CMake-25136d73945f9e0a6fbfc4abfde61e4dbd10e6c6.tar.bz2 |
Merge topic 'vs-deterministic-guid'
cdf2cba3 VS: Use cmUuid RFC 4122 compliant hash based UUID generation
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index a242046..0ced245 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -15,6 +15,7 @@ #include "cmGeneratedFileStream.h" #include "cmLocalVisualStudio7Generator.h" #include "cmMakefile.h" +#include "cmUuid.h" #include "cmake.h" #include <cmsys/Encoding.hxx> @@ -953,14 +954,15 @@ std::string cmGlobalVisualStudio7Generator::GetGUID(std::string const& name) std::string input = this->CMakeInstance->GetState()->GetBinaryDirectory(); input += "|"; input += name; - std::string md5 = cmSystemTools::ComputeStringMD5(input); - assert(md5.length() == 32); - std::string const& guid = - (md5.substr( 0,8)+"-"+ - md5.substr( 8,4)+"-"+ - md5.substr(12,4)+"-"+ - md5.substr(16,4)+"-"+ - md5.substr(20,12)); + + cmUuid uuidGenerator; + + std::vector<unsigned char> uuidNamespace; + uuidGenerator.StringToBinary( + "ee30c4be-5192-4fb0-b335-722a2dffe760", uuidNamespace); + + std::string guid = uuidGenerator.FromMd5(uuidNamespace, input); + return cmSystemTools::UpperCase(guid); } |