summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorAmitha Perera <perera@cs.rpi.edu>2002-05-01 18:00:21 (GMT)
committerAmitha Perera <perera@cs.rpi.edu>2002-05-01 18:00:21 (GMT)
commit1f8df8585ef36aa980d13a0cb6646de399bceff9 (patch)
tree3106ab0d6e942aa15c783425316235c75c790e8b /Source/cmMakefile.cxx
parentd53458de9ac298344a87d6703de78991d6770832 (diff)
downloadCMake-1f8df8585ef36aa980d13a0cb6646de399bceff9.zip
CMake-1f8df8585ef36aa980d13a0cb6646de399bceff9.tar.gz
CMake-1f8df8585ef36aa980d13a0cb6646de399bceff9.tar.bz2
ENH: Add library dependency analysis.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index fd2989a..091bbb4 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -429,6 +429,8 @@ void cmMakefile::GenerateMakefile()
{
l->second.GenerateSourceFilesFromSourceLists(*this);
l->second.MergeLibraries(m_LinkLibraries);
+ l->second.MergeDirectories(m_LinkDirectories);
+ l->second.AnalyzeLibDependencies(*this);
}
// now do the generation
m_MakefileGenerator->GenerateMakefile();
@@ -521,9 +523,7 @@ void cmMakefile::AddLinkLibraryForTarget(const char *target,
{
if (m_Targets.find(target) != m_Targets.end())
{
- m_Targets[target].GetLinkLibraries().
- push_back(
- std::pair<std::string, cmTarget::LinkLibraryType>(lib,llt));
+ m_Targets[target].AddLinkLibrary( *this, target, lib, llt );
}
else
{
@@ -695,6 +695,15 @@ void cmMakefile::AddLibrary(const char* lname, int shared,
"Whether a library is static, shared or module.",
cmCacheManager::INTERNAL);
}
+
+ // Clear its dependencies. Otherwise, dependencies might persist
+ // over changes in CMakeLists.txt, making the information stale and
+ // hence useless.
+ std::string depname = lname;
+ depname += "_LIB_DEPENDS";
+ cmCacheManager::GetInstance()->
+ AddCacheEntry(depname.c_str(), "",
+ "Dependencies for target", cmCacheManager::INTERNAL);
}
void cmMakefile::AddExecutable(const char *exeName,
@@ -861,7 +870,7 @@ void cmMakefile::ExpandVariables()
}
}
-bool cmMakefile::IsOn(const char* name)
+bool cmMakefile::IsOn(const char* name) const
{
const char* value = this->GetDefinition(name);
return cmSystemTools::IsOn(value);