diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-08-08 14:07:09 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-08-08 14:07:09 (GMT) |
commit | a6567329d7cda4ba6e74a859e128b7fc689f1dcd (patch) | |
tree | bdf86a901add1d00fda50911b31b5b7107ff894b /Source/cmMakefile.cxx | |
parent | 2003b4987a92be9c58cfb75c9cccdd39b8ab3c85 (diff) | |
download | CMake-a6567329d7cda4ba6e74a859e128b7fc689f1dcd.zip CMake-a6567329d7cda4ba6e74a859e128b7fc689f1dcd.tar.gz CMake-a6567329d7cda4ba6e74a859e128b7fc689f1dcd.tar.bz2 |
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
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 09c475b..76d5dc9 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<std::string>::size_type cc; + std::vector<std::string> 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); |