[cmake-commits] king committed cmLocalVisualStudio6Generator.cxx 1.114 1.115

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Mar 9 16:25:18 EST 2007


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

Modified Files:
	cmLocalVisualStudio6Generator.cxx 
Log Message:
ENH: Implemented use of cmTarget::GetDirectory() in Visual Studio 6 generator.  This is an incremental fix for bug#4210.


Index: cmLocalVisualStudio6Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalVisualStudio6Generator.cxx,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- cmLocalVisualStudio6Generator.cxx	20 Feb 2007 15:52:06 -0000	1.114
+++ cmLocalVisualStudio6Generator.cxx	9 Mar 2007 21:25:16 -0000	1.115
@@ -851,13 +851,17 @@
 // Code in blocks surrounded by a test for this definition is needed
 // only for compatibility with user project's replacement DSP
 // templates.  The CMake templates no longer use them.
-#define CM_USE_OLD_VS6
+//#define CM_USE_OLD_VS6
 
 void cmLocalVisualStudio6Generator
 ::WriteDSPHeader(std::ostream& fout, 
                  const char *libName, cmTarget &target, 
                  std::vector<cmSourceGroup> &)
 {
+  // Lookup the output directory for the target.
+  std::string outPath = target.GetDirectory();
+
+#ifdef CM_USE_OLD_VS6
   // Lookup the library and executable output directories.
   std::string libPath;
   if(this->Makefile->GetDefinition("LIBRARY_OUTPUT_PATH"))
@@ -886,7 +890,6 @@
       }
     }
 
-#ifdef CM_USE_OLD_VS6
   std::set<std::string> pathEmitted;
   
   // determine the link directories
@@ -1188,6 +1191,42 @@
                              optionsRelWithDebInfo);
     }
 
+  // Compute the path of the import library.
+  std::string targetImplibFlagDebug;
+  std::string targetImplibFlagRelease;
+  std::string targetImplibFlagMinSizeRel;
+  std::string targetImplibFlagRelWithDebInfo;
+  if(target.GetType() == cmTarget::SHARED_LIBRARY)
+    {
+    std::string fullPathImpDebug = target.GetDirectory("Debug", true);
+    std::string fullPathImpRelease = target.GetDirectory("Release", true);
+    std::string fullPathImpMinSizeRel = target.GetDirectory("MinSizeRel", true);
+    std::string fullPathImpRelWithDebInfo = target.GetDirectory("RelWithDebInfo", true);
+    fullPathImpDebug += "/";
+    fullPathImpRelease += "/";
+    fullPathImpMinSizeRel += "/";
+    fullPathImpRelWithDebInfo += "/";
+    fullPathImpDebug += target.GetFullName("Debug", true);
+    fullPathImpRelease += target.GetFullName("Release", true);
+    fullPathImpMinSizeRel += target.GetFullName("MinSizeRel", true);
+    fullPathImpRelWithDebInfo += target.GetFullName("RelWithDebInfo", true);
+
+    targetImplibFlagDebug = "/implib:";
+    targetImplibFlagRelease = "/implib:";
+    targetImplibFlagMinSizeRel = "/implib:";
+    targetImplibFlagRelWithDebInfo = "/implib:";
+    targetImplibFlagDebug +=
+      this->ConvertToOptionallyRelativeOutputPath(fullPathImpDebug.c_str());
+    targetImplibFlagRelease +=
+      this->ConvertToOptionallyRelativeOutputPath(fullPathImpRelease.c_str());
+    targetImplibFlagMinSizeRel +=
+      this->ConvertToOptionallyRelativeOutputPath(
+        fullPathImpMinSizeRel.c_str());
+    targetImplibFlagRelWithDebInfo +=
+      this->ConvertToOptionallyRelativeOutputPath(
+        fullPathImpRelWithDebInfo.c_str());
+    }
+
 #ifdef CM_USE_OLD_VS6
   // Compute link information for the target.
   if(extraLinkOptions.size())
@@ -1300,7 +1339,16 @@
                                  this->IncludeOptions.c_str());
     cmSystemTools::ReplaceString(line, "TARGET_VERSION_FLAG",
                                  targetVersionFlag.c_str());
+    cmSystemTools::ReplaceString(line, "TARGET_IMPLIB_FLAG_DEBUG",
+                                 targetImplibFlagDebug.c_str());
+    cmSystemTools::ReplaceString(line, "TARGET_IMPLIB_FLAG_RELEASE",
+                                 targetImplibFlagRelease.c_str());
+    cmSystemTools::ReplaceString(line, "TARGET_IMPLIB_FLAG_MINSIZEREL",
+                                 targetImplibFlagMinSizeRel.c_str());
+    cmSystemTools::ReplaceString(line, "TARGET_IMPLIB_FLAG_RELWITHDEBINFO",
+                                 targetImplibFlagRelWithDebInfo.c_str());
     cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName);
+#ifdef CM_USE_OLD_VS6
     // because LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH 
     // are already quoted in the template file,
     // we need to remove the quotes here, we still need
@@ -1313,6 +1361,11 @@
       (line, "EXECUTABLE_OUTPUT_PATH",
        removeQuotes(this->ConvertToOptionallyRelativeOutputPath
                     (exePath.c_str())).c_str());
+#endif
+    cmSystemTools::ReplaceString
+      (line, "OUTPUT_DIRECTORY",
+       removeQuotes(this->ConvertToOptionallyRelativeOutputPath
+                    (outPath.c_str())).c_str());
 
     cmSystemTools::ReplaceString(line, 
                                  "EXTRA_DEFINES", 



More information about the Cmake-commits mailing list