diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2005-12-26 18:14:19 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2005-12-26 18:14:19 (GMT) |
commit | 452925649a619256e509ed19bb7c41af1d643deb (patch) | |
tree | 3d4d79fdeda6d6a578cf8c529daa2d0c47ba8c6b /Source/cmTarget.cxx | |
parent | 102ab85a172b67696cf72c4ba526012a83a5bc2e (diff) | |
download | CMake-452925649a619256e509ed19bb7c41af1d643deb.zip CMake-452925649a619256e509ed19bb7c41af1d643deb.tar.gz CMake-452925649a619256e509ed19bb7c41af1d643deb.tar.bz2 |
ENH: add better support for framework linking
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 70a44c2..2960749 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -301,9 +301,28 @@ void cmTarget::ClearDependencyInformation( cmMakefile& mf, const char* target ) void cmTarget::AddLinkLibrary(const std::string& lib, LinkLibraryType llt) { + this->AddFramework(lib.c_str(), llt); m_LinkLibraries.push_back( std::pair<std::string, cmTarget::LinkLibraryType>(lib,llt) ); } +bool cmTarget::AddFramework(const std::string& libname, LinkLibraryType llt) +{ + if(cmSystemTools::IsPathToFramework(libname.c_str())) + { + std::string frameworkDir = libname; + frameworkDir += "/../"; + frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str()); + std::vector<std::string>::iterator i = + std::find(m_Frameworks.begin(), + m_Frameworks.end(), frameworkDir); + if(i == m_Frameworks.end()) + { + m_Frameworks.push_back(frameworkDir); + } + return true; + } + return false; +} void cmTarget::AddLinkLibrary(cmMakefile& mf, const char *target, const char* lib, LinkLibraryType llt) @@ -313,7 +332,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, { return; } - + this->AddFramework(lib, llt); m_LinkLibraries.push_back( std::pair<std::string, cmTarget::LinkLibraryType>(lib,llt) ); if(llt != cmTarget::GENERAL) |