diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 52cb44859..06e84c455 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -784,7 +784,24 @@ void cmCacheManager::AddCacheEntry(const char* key, // make sure we only use unix style paths if(type == FILEPATH || type == PATH) { - cmSystemTools::ConvertToUnixSlashes(e.Value); + if(e.Value.find(';') != e.Value.npos) + { + std::vector paths; + cmSystemTools::ExpandListArgument(e.Value, paths); + const char* sep = ""; + for(std::vector::iterator i = paths.begin(); + i != paths.end(); ++i) + { + cmSystemTools::ConvertToUnixSlashes(*i); + e.Value += sep; + e.Value += *i; + sep = ";"; + } + } + else + { + cmSystemTools::ConvertToUnixSlashes(e.Value); + } } if ( helpString ) {