[cmake-commits] king committed cmExportLibraryDependencies.cxx 1.21 1.22 cmExportLibraryDependencies.h 1.9 1.10

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Feb 20 13:36:40 EST 2008


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

Modified Files:
	cmExportLibraryDependencies.cxx cmExportLibraryDependencies.h 
Log Message:
ENH: Deprecate export_library_dependencies

  - Reference export() and install(EXPORT)
  - Fix to support OUTPUT_NAME in simple cases


Index: cmExportLibraryDependencies.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExportLibraryDependencies.cxx,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- cmExportLibraryDependencies.cxx	12 Feb 2008 14:18:50 -0000	1.21
+++ cmExportLibraryDependencies.cxx	20 Feb 2008 18:36:38 -0000	1.22
@@ -80,8 +80,8 @@
 
   // Collect dependency information about all library targets built in
   // the project.
-  const cmake* cm = this->Makefile->GetCMakeInstance();
-  const cmGlobalGenerator* global = cm->GetGlobalGenerator();
+  cmake* cm = this->Makefile->GetCMakeInstance();
+  cmGlobalGenerator* global = cm->GetGlobalGenerator();
   const std::vector<cmLocalGenerator *>& locals = global->GetLocalGenerators();
   std::map<cmStdString, cmStdString> libDepsOld;
   std::map<cmStdString, cmStdString> libDepsNew;
@@ -137,9 +137,20 @@
             ltValue = "optimized";
             break;
           }
-        valueOld += li->first;
+        std::string lib = li->first;
+        if(cmTarget* libtgt = global->FindTarget(0, lib.c_str()))
+          {
+          // Handle simple output name changes.  This command is
+          // deprecated so we do not support full target name
+          // translation (which requires per-configuration info).
+          if(const char* outname = libtgt->GetProperty("OUTPUT_NAME"))
+            {
+            lib = outname;
+            }
+          }
+        valueOld += lib;
         valueOld += ";";
-        valueNew += li->first;
+        valueNew += lib;
         valueNew += ";";
 
         std::string& ltEntry = libTypes[ltVar];

Index: cmExportLibraryDependencies.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExportLibraryDependencies.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cmExportLibraryDependencies.h	23 Jan 2008 15:27:59 -0000	1.9
+++ cmExportLibraryDependencies.h	20 Feb 2008 18:36:38 -0000	1.10
@@ -59,8 +59,7 @@
    */
   virtual const char* GetTerseDocumentation() 
     {
-    return 
-      "Write out the dependency information for all targets of a project.";
+    return "Deprecated.  Use INSTALL(EXPORT) or EXPORT command.";
     }
   
   /**
@@ -69,6 +68,14 @@
   virtual const char* GetFullDocumentation()
     {
     return
+      "This command generates an old-style library dependencies file.  "
+      "Projects requiring CMake 2.6 or later should not use the command.  "
+      "Use instead the install(EXPORT) command to help export targets "
+      "from an installation tree and the export() command to export targets "
+      "from a build tree.\n"
+      "The old-style library dependencies file does not take into account "
+      "per-configuration names of libraries or the LINK_INTERFACE_LIBRARIES "
+      "target property.\n"
       "  export_library_dependencies(<file> [APPEND])\n"
       "Create a file named <file> that can be included into a CMake listfile "
       "with the INCLUDE command.  The file will contain a number of SET "
@@ -78,6 +85,12 @@
       "specified, the SET commands will be appended to the given file "
       "instead of replacing it.";
     }
+
+  /** This command is kept for compatibility with older CMake versions. */
+  virtual bool IsDiscouraged()
+    {
+    return true;
+    }
   
   cmTypeMacro(cmExportLibraryDependenciesCommand, cmCommand);
 



More information about the Cmake-commits mailing list