summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-06-03 14:25:55 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-06-03 14:25:55 (GMT)
commite5668ea656f9fd747ef1ce2023adb6c682b58a89 (patch)
treef4a763c0c5813e21a4edf5deac1a7cb01fac22aa /Source
parent993aebb7482c99ab1149f23b981ef83410e1af2e (diff)
downloadCMake-e5668ea656f9fd747ef1ce2023adb6c682b58a89.zip
CMake-e5668ea656f9fd747ef1ce2023adb6c682b58a89.tar.gz
CMake-e5668ea656f9fd747ef1ce2023adb6c682b58a89.tar.bz2
ENH: only add _LIB_DEPEND information for libraries and modules
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx9
-rw-r--r--Source/cmTarget.cxx32
2 files changed, 27 insertions, 14 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 40b0d45..3afce3d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -659,6 +659,14 @@ void cmMakefile::SetProjectName(const char* p)
void cmMakefile::AddGlobalLinkInformation(const char* name, cmTarget& target)
{
+ // for these targets do not add anything
+ switch(target.GetType())
+ {
+ case cmTarget::UTILITY:
+ case cmTarget::INSTALL_FILES:
+ case cmTarget::INSTALL_PROGRAMS:
+ return;
+ }
std::vector<std::string>::iterator j;
for(j = m_LinkDirectories.begin();
j != m_LinkDirectories.end(); ++j)
@@ -766,7 +774,6 @@ void cmMakefile::AddExecutable(const char *exeName,
target.SetInAll(true);
target.GetSourceLists() = srcs;
this->AddGlobalLinkInformation(exeName, target);
-
m_Targets.insert(cmTargets::value_type(exeName,target));
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 04c9a4c..ee5071d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -134,21 +134,27 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
// simply a set of libraries separated by ";". There should always
// be a trailing ";". These library names are not canonical, in that
// they may be "-framework x", "-ly", "/path/libz.a", etc.
- std::string targetEntry = target;
- targetEntry += "_LIB_DEPENDS";
- std::string dependencies;
- const char* old_val = mf.GetDefinition( targetEntry.c_str() );
- if( old_val )
+ // only add depend information for library targets
+ if(m_TargetType >= STATIC_LIBRARY && m_TargetType <= MODULE_LIBRARY)
{
- dependencies += old_val;
- }
- if( dependencies.find( lib ) == std::string::npos )
- {
- dependencies += lib;
- dependencies += ";";
+ std::string targetEntry = target;
+ targetEntry += "_LIB_DEPENDS";
+ std::string dependencies;
+ const char* old_val = mf.GetDefinition( targetEntry.c_str() );
+ if( old_val )
+ {
+ dependencies += old_val;
+ }
+ if( dependencies.find( lib ) == std::string::npos )
+ {
+ dependencies += lib;
+ dependencies += ";";
+ }
+ mf.AddCacheDefinition( targetEntry.c_str(), dependencies.c_str(),
+ "Dependencies for the target",
+ cmCacheManager::STATIC );
}
- mf.AddCacheDefinition( targetEntry.c_str(), dependencies.c_str(),
- "Dependencies for the target", cmCacheManager::STATIC );
+
}
bool cmTarget::HasCxx() const