This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  6ba4780f2a66af33b444b6a61b3abb7120cedd0b (commit)
       via  6d79eda769a5693ed4657f50c97ef5a0c9ba2e1b (commit)
      from  07c34bf5d2ea7308093701fed2439f5fdfe4601e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ba4780f2a66af33b444b6a61b3abb7120cedd0b
commit 6ba4780f2a66af33b444b6a61b3abb7120cedd0b
Merge: 07c34bf 6d79eda
Author:     Brad King <[email protected]>
AuthorDate: Wed Jul 29 10:33:39 2015 -0400
Commit:     CMake Topic Stage <[email protected]>
CommitDate: Wed Jul 29 10:33:39 2015 -0400

    Merge topic 'cmCommonTargetGenerator-GetLinkedTargetDirectories' into next
    
    6d79eda7 cmCommonTargetGenerator: Adopt linked target directory computation


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6d79eda769a5693ed4657f50c97ef5a0c9ba2e1b
commit 6d79eda769a5693ed4657f50c97ef5a0c9ba2e1b
Author:     Brad King <[email protected]>
AuthorDate: Tue Jul 28 14:05:34 2015 -0400
Commit:     Brad King <[email protected]>
CommitDate: Tue Jul 28 15:40:06 2015 -0400

    cmCommonTargetGenerator: Adopt linked target directory computation
    
    Factor a GetLinkedTargetDirectories method out of
    cmMakefileTargetGenerator::WriteTargetDependRules to compute the list of
    directories associated with targets to which the current target links.

diff --git a/Source/cmCommonTargetGenerator.cxx 
b/Source/cmCommonTargetGenerator.cxx
index 2225fdc..c75ac23 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -368,3 +368,37 @@ std::string 
cmCommonTargetGenerator::GetIncludes(std::string const& l)
     }
   return i->second;
 }
+
+std::vector<std::string>
+cmCommonTargetGenerator::GetLinkedTargetDirectories() const
+{
+  std::vector<std::string> dirs;
+  std::set<cmTarget const*> emitted;
+  if (cmComputeLinkInformation* cli =
+      this->Target->GetLinkInformation(this->ConfigName))
+    {
+    cmComputeLinkInformation::ItemVector const& items = cli->GetItems();
+    for(cmComputeLinkInformation::ItemVector::const_iterator
+          i = items.begin(); i != items.end(); ++i)
+      {
+      cmTarget const* linkee = i->Target;
+      if(linkee && !linkee->IsImported()
+                // We can ignore the INTERFACE_LIBRARY items because
+                // Target->GetLinkInformation already processed their
+                // link interface and they don't have any output themselves.
+                && linkee->GetType() != cmTarget::INTERFACE_LIBRARY
+                && emitted.insert(linkee).second)
+        {
+        cmGeneratorTarget* gt =
+          this->GlobalGenerator->GetGeneratorTarget(linkee);
+        cmLocalGenerator* lg = gt->GetLocalGenerator();
+        cmMakefile* mf = linkee->GetMakefile();
+        std::string di = mf->GetCurrentBinaryDirectory();
+        di += "/";
+        di += lg->GetTargetDirectory(*linkee);
+        dirs.push_back(di);
+        }
+      }
+    }
+  return dirs;
+}
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index 5451a5a..166508d 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -85,6 +85,8 @@ protected:
   ByLanguageMap DefinesByLanguage;
   std::string GetIncludes(std::string const& l);
   ByLanguageMap IncludesByLanguage;
+
+  std::vector<std::string> GetLinkedTargetDirectories() const;
 };
 
 #endif
diff --git a/Source/cmMakefileTargetGenerator.cxx 
b/Source/cmMakefileTargetGenerator.cxx
index 0f82fb3..57ab2ca 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -1059,33 +1059,11 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
     << "\n"
     << "# Targets to which this target links.\n"
     << "set(CMAKE_TARGET_LINKED_INFO_FILES\n";
-  std::set<cmTarget const*> emitted;
-  const char* cfg = this->LocalGenerator->GetConfigName().c_str();
-  if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
+  std::vector<std::string> dirs = this->GetLinkedTargetDirectories();
+  for (std::vector<std::string>::iterator i = dirs.begin();
+       i != dirs.end(); ++i)
     {
-    cmComputeLinkInformation::ItemVector const& items = cli->GetItems();
-    for(cmComputeLinkInformation::ItemVector::const_iterator
-          i = items.begin(); i != items.end(); ++i)
-      {
-      cmTarget const* linkee = i->Target;
-      if(linkee && !linkee->IsImported()
-                // We can ignore the INTERFACE_LIBRARY items because
-                // Target->GetLinkInformation already processed their
-                // link interface and they don't have any output themselves.
-                && linkee->GetType() != cmTarget::INTERFACE_LIBRARY
-                && emitted.insert(linkee).second)
-        {
-        cmGeneratorTarget* gt =
-            this->GlobalGenerator->GetGeneratorTarget(linkee);
-        cmLocalGenerator* lg = gt->GetLocalGenerator();
-        cmMakefile* mf = linkee->GetMakefile();
-        std::string di = mf->GetCurrentBinaryDirectory();
-        di += "/";
-        di += lg->GetTargetDirectory(*linkee);
-        di += "/DependInfo.cmake";
-        *this->InfoFileStream << "  \"" << di << "\"\n";
-        }
-      }
+    *this->InfoFileStream << "  \"" << *i << "/DependInfo.cmake\"\n";
     }
   *this->InfoFileStream
     << "  )\n";

-----------------------------------------------------------------------

Summary of changes:
 Source/cmCommonTargetGenerator.cxx   |   34 ++++++++++++++++++++++++++++++++++
 Source/cmCommonTargetGenerator.h     |    2 ++
 Source/cmMakefileTargetGenerator.cxx |   30 ++++--------------------------
 3 files changed, 40 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
[email protected]
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to