summaryrefslogtreecommitdiffstats
path: root/Source/cmAddLibraryCommand.cxx
diff options
context:
space:
mode:
authorAmitha Perera <perera@cs.rpi.edu>2002-05-01 20:33:27 (GMT)
committerAmitha Perera <perera@cs.rpi.edu>2002-05-01 20:33:27 (GMT)
commit099436db26c0a46b3df4b5aaf51e8777e35bfe06 (patch)
treecdcbf890cd3e3cc61b9cb398d1a00ee1d53325be /Source/cmAddLibraryCommand.cxx
parent36f80fe6c8f7593462c450789b01f4eb37792996 (diff)
downloadCMake-099436db26c0a46b3df4b5aaf51e8777e35bfe06.zip
CMake-099436db26c0a46b3df4b5aaf51e8777e35bfe06.tar.gz
CMake-099436db26c0a46b3df4b5aaf51e8777e35bfe06.tar.bz2
ENH: Make the LinkLibraries command contribute dependencies towards AddLibraries.
Diffstat (limited to 'Source/cmAddLibraryCommand.cxx')
-rw-r--r--Source/cmAddLibraryCommand.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index a066585..13957b0 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -33,7 +33,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& argsIn)
std::vector<std::string>::const_iterator s = args.begin();
- std::string libname = *s;
+ m_LibName = *s;
++s;
@@ -67,8 +67,18 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& argsIn)
++s;
}
- m_Makefile->AddLibrary(libname.c_str(), shared, srclists);
+ m_Makefile->AddLibrary(m_LibName.c_str(), shared, srclists);
return true;
}
+void cmAddLibraryCommand::FinalPass()
+{
+ const cmTarget::LinkLibraries& libs = m_Makefile->GetLinkLibraries();
+
+ for( cmTarget::LinkLibraries::const_iterator i = libs.begin();
+ i != libs.end(); ++i )
+ {
+ m_Makefile->AddDependencyToCache( m_LibName.c_str(), i->first );
+ }
+}