diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-07-08 14:59:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-07-24 15:49:06 (GMT) |
commit | f5ca872e8b621bbef1c5feb92317bc420fe07716 (patch) | |
tree | 006c70de5dc42a9ac504eb9948c4d7e1cf2e793d /Source | |
parent | f82c751d7b3ee3907d780060985a36bdddcabad3 (diff) | |
download | CMake-f5ca872e8b621bbef1c5feb92317bc420fe07716.zip CMake-f5ca872e8b621bbef1c5feb92317bc420fe07716.tar.gz CMake-f5ca872e8b621bbef1c5feb92317bc420fe07716.tar.bz2 |
Use linked frameworks as a source of include directories.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmTarget.cxx | 28 | ||||
-rw-r--r-- | Source/cmTargetLinkLibrariesCommand.h | 5 |
2 files changed, 33 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 70500cd..994e053 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3344,6 +3344,34 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config) new cmTargetInternals::TargetPropertyEntry(cge, it->Value)); } + + if(this->Makefile->IsOn("APPLE")) + { + LinkImplementation const* impl = this->GetLinkImplementation(config, + this); + for(std::vector<std::string>::const_iterator + it = impl->Libraries.begin(); + it != impl->Libraries.end(); ++it) + { + std::string libDir = cmSystemTools::CollapseFullPath(it->c_str()); + + static cmsys::RegularExpression + frameworkCheck("(.*\\.framework)(/Versions/[^/]+)?/[^/]+$"); + if(!frameworkCheck.find(libDir)) + { + continue; + } + + libDir = frameworkCheck.match(1); + + cmGeneratorExpression ge(lfbt); + cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = + ge.Parse(libDir.c_str()); + this->Internal + ->CachedLinkInterfaceIncludeDirectoriesEntries[configString] + .push_back(new cmTargetInternals::TargetPropertyEntry(cge)); + } + } } processIncludeDirectories(this, diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h index ca651d0..e390343 100644 --- a/Source/cmTargetLinkLibrariesCommand.h +++ b/Source/cmTargetLinkLibrariesCommand.h @@ -109,6 +109,11 @@ public: " INTERFACE_POSITION_INDEPENDENT_CODE: Sets POSITION_INDEPENDENT_CODE\n" " or checked for consistency with existing value\n" "\n" + "If an <item> is a library in a Mac OX framework, the Headers " + "directory of the framework will also be processed as a \"usage " + "requirement\". This has the same effect as passing the framework " + "directory as an include directory." + "\n" " target_link_libraries(<target> LINK_INTERFACE_LIBRARIES\n" " [[debug|optimized|general] <lib>] ...)\n" "The LINK_INTERFACE_LIBRARIES mode appends the libraries " |