From 0829faa9e180abc0be38f634bbb3ba63ac0b3702 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 7 May 2001 18:14:13 -0400 Subject: [PATCH] ENH: Moved cache entry addition into cmMakefile::AddLibrary and AddExecutable so that commands do not have to add it explicitly. --- Source/cmAddExecutableCommand.cxx | 5 ----- Source/cmAddLibraryCommand.cxx | 6 ------ Source/cmMakefile.cxx | 12 ++++++++++++ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx index 39e02917e..2988c6d3a 100644 --- a/Source/cmAddExecutableCommand.cxx +++ b/Source/cmAddExecutableCommand.cxx @@ -54,11 +54,6 @@ bool cmAddExecutableCommand::Invoke(std::vector& args) std::vector srclists(++s, args.end()); m_Makefile->AddExecutable(args[0].c_str(),srclists); - // Add an entry into the cache - cmCacheManager::GetInstance()-> - AddCacheEntry(args[0].c_str(), - m_Makefile->GetCurrentOutputDirectory(), - "Path to an executable", cmCacheManager::INTERNAL); return true; } diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx index 0ba7e48b3..1de271a9d 100644 --- a/Source/cmAddLibraryCommand.cxx +++ b/Source/cmAddLibraryCommand.cxx @@ -54,12 +54,6 @@ bool cmAddLibraryCommand::Invoke(std::vector& args) std::vector srclists(++s, args.end()); m_Makefile->AddLibrary(args[0].c_str(),srclists); - - // Add an entry into the cache - cmCacheManager::GetInstance()-> - AddCacheEntry(args[0].c_str(), - m_Makefile->GetCurrentOutputDirectory(), - "Path to a library", cmCacheManager::INTERNAL); return true; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c5d566ee8..3e2e81c43 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -470,6 +470,12 @@ void cmMakefile::AddLibrary(const char* lname, const std::vector &s target.SetInAll(true); target.GetSourceLists() = srcs; m_Targets.insert(cmTargets::value_type(lname,target)); + + // Add an entry into the cache + cmCacheManager::GetInstance()-> + AddCacheEntry(lname, + this->GetCurrentOutputDirectory(), + "Path to a library", cmCacheManager::INTERNAL); } void cmMakefile::AddExecutable(const char *exeName, @@ -480,6 +486,12 @@ void cmMakefile::AddExecutable(const char *exeName, target.SetInAll(true); target.GetSourceLists() = srcs; m_Targets.insert(cmTargets::value_type(exeName,target)); + + // Add an entry into the cache + cmCacheManager::GetInstance()-> + AddCacheEntry(exeName, + this->GetCurrentOutputDirectory(), + "Path to an executable", cmCacheManager::INTERNAL); }