diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 3ab8904b9..ba4f76f52 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -256,22 +256,6 @@ bool cmCacheManager::LoadCache(const char* path, return true; } -void cmCacheManager::DefineCache(cmMakefile *mf) -{ - if (!mf) - { - return; - } - - // add definition to the makefile - for( std::map::const_iterator i = m_Cache.begin(); - i != m_Cache.end(); ++i) - { - const CacheEntry& ce = (*i).second; - mf->AddDefinition((*i).first.c_str(), ce.m_Value.c_str()); - } -} - bool cmCacheManager::SaveCache(cmMakefile* mf) { return this->SaveCache(mf->GetHomeOutputDirectory()); diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index d557b662e..54a1d105e 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -58,9 +58,6 @@ public: std::set& excludes, std::set& includes); - ///! Put cache definitions into makefile - void DefineCache(cmMakefile*); - ///! Save cache for given makefile. Saves to ouput home CMakeCache.txt. bool SaveCache(cmMakefile*) ; ///! Save cache for given makefile. Saves to ouput path/CMakeCache.txt diff --git a/Source/cmLoadCacheCommand.cxx b/Source/cmLoadCacheCommand.cxx index 2076435f4..9ea56e6ab 100644 --- a/Source/cmLoadCacheCommand.cxx +++ b/Source/cmLoadCacheCommand.cxx @@ -73,6 +73,8 @@ bool cmLoadCacheCommand::InitialPass(std::vector const& argsIn) } } + // Loop over each build directory listed in the arguments. Each + // directory has a cache file. for(i=0; i const& argsIn) m_Makefile->ExpandVariablesInString(args[i]); cmCacheManager::GetInstance()->LoadCache(args[i].c_str(), false, excludes, includes); - cmCacheManager::GetInstance()->DefineCache(m_Makefile); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 506130a75..deead3e06 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -52,7 +52,6 @@ cmMakefile::cmMakefile() this->AddSourceGroup("Header Files", "\\.(h|hh|hpp|hxx|hm|inl)$"); this->AddDefaultCommands(); this->AddDefaultDefinitions(); - cmCacheManager::GetInstance()->DefineCache(this); } unsigned int cmMakefile::GetCacheMajorVersion() @@ -885,7 +884,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source, bool atOnly) const { // This method replaces ${VAR} and @VAR@ where VAR is looked up - // in the m_Definitions map, if not found in the map, nothing is expanded. + // with GetDefinition(), if not found in the map, nothing is expanded. // It also supports the $ENV{VAR} syntax where VAR is looked up in // the current environment variables. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index c65ca8aa3..6c845cb92 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -384,9 +384,6 @@ int cmake::Generate(const std::vector& args, bool buildMakefiles) // compute system info gen->ComputeSystemInfo(); - // Transfer the cache into the makefile's definitions. - cmCacheManager::GetInstance()->DefineCache(&mf); - std::string lf = mf.GetStartDirectory(); lf += "/CMakeLists.txt"; if(!mf.ReadListFile(lf.c_str()))