diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-06-03 14:25:55 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-06-03 14:25:55 (GMT) |
commit | e5668ea656f9fd747ef1ce2023adb6c682b58a89 (patch) | |
tree | f4a763c0c5813e21a4edf5deac1a7cb01fac22aa /Source/cmTarget.cxx | |
parent | 993aebb7482c99ab1149f23b981ef83410e1af2e (diff) | |
download | CMake-e5668ea656f9fd747ef1ce2023adb6c682b58a89.zip CMake-e5668ea656f9fd747ef1ce2023adb6c682b58a89.tar.gz CMake-e5668ea656f9fd747ef1ce2023adb6c682b58a89.tar.bz2 |
ENH: only add _LIB_DEPEND information for libraries and modules
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 32 |
1 files changed, 19 insertions, 13 deletions
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 |