From a6567329d7cda4ba6e74a859e128b7fc689f1dcd Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Fri, 8 Aug 2003 10:07:09 -0400 Subject: [PATCH] ENH: When fixing cache value with uninitialized type, collapse full paths for PATH and FILEPATH. Closes Bug #82 - Specifying relative path when entering path can break things --- Source/cmMakefile.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 09c475b3f..76d5dc9f8 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -846,6 +846,26 @@ void cmMakefile::AddCacheDefinition(const char* name, const char* value, it.Initialized()) { val = it.GetValue(); + if ( type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH ) + { + std::vector::size_type cc; + std::vector files; + std::string nvalue = ""; + cmSystemTools::ExpandListArgument(val, files); + for ( cc = 0; cc < files.size(); cc ++ ) + { + files[cc] = cmSystemTools::CollapseFullPath(files[cc].c_str()); + if ( cc > 0 ) + { + nvalue += ";"; + } + nvalue += files[cc]; + } + + this->GetCacheManager()->AddCacheEntry(name, nvalue.c_str(), doc, type); + val = it.GetValue(); + } + } this->GetCacheManager()->AddCacheEntry(name, val, doc, type); this->AddDefinition(name, val);