diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-05-02 19:56:13 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-05-02 19:56:13 (GMT) |
commit | a80153b5cb077e99ff81eca947643099430ba391 (patch) | |
tree | eca46cd73aa79466bb7208d3f91a7aa3d2dd14ad /Source/cmTarget.cxx | |
parent | 2242006ca1f6834059d23b761dafd4ad7e70661b (diff) | |
download | CMake-a80153b5cb077e99ff81eca947643099430ba391.zip CMake-a80153b5cb077e99ff81eca947643099430ba391.tar.gz CMake-a80153b5cb077e99ff81eca947643099430ba391.tar.bz2 |
make it backwards compatible with old cmake
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 7d3dda7..51a270c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -89,17 +89,34 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, case cmTarget::DEBUG: mf.AddCacheDefinition(linkTypeName.c_str(), "debug", "Library is used for debug links only", - cmCacheManager::INTERNAL); + cmCacheManager::STATIC); break; case cmTarget::OPTIMIZED: mf.AddCacheDefinition(linkTypeName.c_str(), "optimized", "Library is used for debug links only", - cmCacheManager::INTERNAL); + cmCacheManager::STATIC); break; } } - - mf.AddDependencyToCache( target, lib ); + // Add the explicit dependency information for this target. This is + // 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 ) + { + 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 ); } bool cmTarget::HasCxx() const |