summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-01-07 19:23:04 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-01-07 19:23:04 (GMT)
commitc2cde7f1047b2f11e7d4a466000a20d8c42394be (patch)
treeea3733543ae159f8031398db0d874290022f26e5 /Source
parentdb925e3532719af44022b50d2462ac5b050907bc (diff)
parentcc676c3a08019b17433931a9287d9cd8b0ccf2f2 (diff)
downloadCMake-c2cde7f1047b2f11e7d4a466000a20d8c42394be.zip
CMake-c2cde7f1047b2f11e7d4a466000a20d8c42394be.tar.gz
CMake-c2cde7f1047b2f11e7d4a466000a20d8c42394be.tar.bz2
Merge topic 'osx-implicit-link-dirs'
cc676c3 OS X: Detect implicit linker framework search paths 2dd67c7 OS X: Detect implicit link directories on modern toolchains ba58d0c OS X: Link with all framework search paths, not just the last
Diffstat (limited to 'Source')
-rw-r--r--Source/cmComputeLinkInformation.cxx29
-rw-r--r--Source/cmDocumentVariables.cxx9
-rw-r--r--Source/cmLocalGenerator.cxx2
3 files changed, 35 insertions, 5 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index d8ffb5e..19de903 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1376,10 +1376,31 @@ void cmComputeLinkInformation::DropDirectoryItem(std::string const& item)
//----------------------------------------------------------------------------
void cmComputeLinkInformation::ComputeFrameworkInfo()
{
- // Avoid adding system framework paths. See "man ld" on OS X.
- this->FrameworkPathsEmmitted.insert("/Library/Frameworks");
- this->FrameworkPathsEmmitted.insert("/Network/Library/Frameworks");
- this->FrameworkPathsEmmitted.insert("/System/Library/Frameworks");
+ // Avoid adding implicit framework paths.
+ std::vector<std::string> implicitDirVec;
+
+ // Get platform-wide implicit directories.
+ if(const char* implicitLinks = this->Makefile->GetDefinition
+ ("CMAKE_PLATFORM_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES"))
+ {
+ cmSystemTools::ExpandListArgument(implicitLinks, implicitDirVec);
+ }
+
+ // Get language-specific implicit directories.
+ std::string implicitDirVar = "CMAKE_";
+ implicitDirVar += this->LinkLanguage;
+ implicitDirVar += "_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES";
+ if(const char* implicitDirs =
+ this->Makefile->GetDefinition(implicitDirVar.c_str()))
+ {
+ cmSystemTools::ExpandListArgument(implicitDirs, implicitDirVec);
+ }
+
+ for(std::vector<std::string>::const_iterator i = implicitDirVec.begin();
+ i != implicitDirVec.end(); ++i)
+ {
+ this->FrameworkPathsEmmitted.insert(*i);
+ }
// Regular expression to extract a framework path and name.
this->SplitFramework.compile("(.*)/(.*)\\.framework$");
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index d4a876d..be45e2d 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -1642,6 +1642,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Variables for Languages");
cm->DefineProperty
+ ("CMAKE_<LANG>_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES", cmProperty::VARIABLE,
+ "Implicit linker framework search path detected for language <LANG>.",
+ "These paths are implicit linker framework search directories for "
+ "the compiler's language. "
+ "CMake automatically detects these directories for each language and "
+ "reports the results in this variable.", false,
+ "Variables for Languages");
+
+ cm->DefineProperty
("CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES", cmProperty::VARIABLE,
"Implicit link libraries and flags detected for language <LANG>.",
"Compilers typically pass language runtime library names and "
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index b41f060..b557ca1 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1708,7 +1708,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
for(std::vector<std::string>::const_iterator fdi = fwDirs.begin();
fdi != fwDirs.end(); ++fdi)
{
- frameworkPath = " -F";
+ frameworkPath += "-F";
frameworkPath += this->Convert(fdi->c_str(), NONE, SHELL, false);
frameworkPath += " ";
}