[cmake-commits] king committed cmMakefileTargetGenerator.cxx 1.78 1.79

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Dec 28 11:49:48 EST 2007


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv11704/Source

Modified Files:
	cmMakefileTargetGenerator.cxx 
Log Message:
ENH: Store in DependInfo.cmake files a list of the corresponding files for the targets to which a target links.  This is useful for locating Fortran modules provided by linked targets.  See issue #5809.


Index: cmMakefileTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileTargetGenerator.cxx,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- cmMakefileTargetGenerator.cxx	21 Dec 2007 17:22:12 -0000	1.78
+++ cmMakefileTargetGenerator.cxx	28 Dec 2007 16:49:46 -0000	1.79
@@ -792,6 +792,37 @@
     *this->InfoFileStream << "  )\n\n";
     }
 
+  // Store list of targets linked directly or transitively.
+  {
+  *this->InfoFileStream
+    << "\n"
+    << "# Targets to which this target links.\n"
+    << "SET(CMAKE_TARGET_LINKED_INFO_FILES\n";
+  cmGlobalGenerator* gg = this->GlobalGenerator;
+  std::set<cmTarget const*> emitted;
+  cmTarget::LinkLibraryVectorType const& libs =
+    this->Target->GetLinkLibraries();
+  for(cmTarget::LinkLibraryVectorType::const_iterator j = libs.begin();
+      j != libs.end(); ++j)
+    {
+    if(cmTarget const* linkee = gg->FindTarget(0, j->first.c_str(), false))
+      {
+      if(emitted.insert(linkee).second)
+        {
+        cmMakefile* mf = linkee->GetMakefile();
+        cmLocalGenerator* lg = mf->GetLocalGenerator();
+        std::string di = mf->GetStartOutputDirectory();
+        di += "/";
+        di += lg->GetTargetDirectory(*linkee);
+        di += "/DependInfo.cmake";
+        *this->InfoFileStream << "  \"" << di << "\"\n";
+        }
+      }
+    }
+  *this->InfoFileStream
+    << "  )\n";
+  }
+
   // and now write the rule to use it
   std::vector<std::string> depends;
   std::vector<std::string> commands;



More information about the Cmake-commits mailing list