[cmake-commits] king committed cmGlobalVisualStudio71Generator.cxx 1.33 1.34 cmGlobalVisualStudio7Generator.cxx 1.76 1.77 cmGlobalVisualStudio7Generator.h 1.38 1.39

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Oct 9 21:48:50 EDT 2006


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

Modified Files:
	cmGlobalVisualStudio71Generator.cxx 
	cmGlobalVisualStudio7Generator.cxx 
	cmGlobalVisualStudio7Generator.h 
Log Message:
BUG: Fixed references to projects outside the build tree and in other locations with spaces in the path.  This is needed for out-of-source/out-of-binary subdirectories in the build.


Index: cmGlobalVisualStudio71Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio71Generator.cxx,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- cmGlobalVisualStudio71Generator.cxx	28 Sep 2006 20:40:35 -0000	1.33
+++ cmGlobalVisualStudio71Generator.cxx	10 Oct 2006 01:48:48 -0000	1.34
@@ -294,10 +294,10 @@
                                               const char* dir,
                                               cmTarget& t)
 {
-  std::string d = cmSystemTools::ConvertToOutputPath(dir);
   fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" 
        << dspname << "\", \""
-       << d << "\\" << dspname << ".vcproj\", \"{"
+       << this->ConvertToSolutionPath(dir)
+       << "\\" << dspname << ".vcproj\", \"{"
        << this->GetGUID(dspname) << "}\"\n";
   fout << "\tProjectSection(ProjectDependencies) = postProject\n";
   this->WriteProjectDepends(fout, dspname, dir, t);
@@ -379,10 +379,9 @@
                        const char* location,
                        const std::vector<std::string>& depends)
 { 
-    std::string d = cmSystemTools::ConvertToOutputPath(location);
   fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" 
        << name << "\", \""
-       << d << "\", \"{"
+       << this->ConvertToSolutionPath(location) << "\", \"{"
        << this->GetGUID(name)
        << "}\"\n";
   

Index: cmGlobalVisualStudio7Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.cxx,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- cmGlobalVisualStudio7Generator.cxx	28 Sep 2006 20:40:35 -0000	1.76
+++ cmGlobalVisualStudio7Generator.cxx	10 Oct 2006 01:48:48 -0000	1.77
@@ -554,6 +554,21 @@
   this->WriteSLNFooter(fout);
 }
 
+//----------------------------------------------------------------------------
+std::string
+cmGlobalVisualStudio7Generator::ConvertToSolutionPath(const char* path)
+{
+  // Convert to backslashes.  Do not use ConvertToOutputPath because
+  // we will add quoting ourselves, and we know these projects always
+  // use windows slashes.
+  std::string d = path;
+  std::string::size_type pos = 0;
+  while((pos = d.find('/', pos)) != d.npos)
+    {
+    d[pos++] = '\\';
+    }
+  return d;
+}
 
 // Write a dsp file into the SLN file,
 // Note, that dependencies from executables to 
@@ -562,10 +577,10 @@
                                const char* dspname,
                                const char* dir, cmTarget&)
 {
-  std::string d = cmSystemTools::ConvertToOutputPath(dir);
   fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" 
        << dspname << "\", \""
-       << d << "\\" << dspname << ".vcproj\", \"{"
+       << this->ConvertToSolutionPath(dir)
+       << "\\" << dspname << ".vcproj\", \"{"
        << this->GetGUID(dspname) << "}\"\nEndProject\n";
 }
 
@@ -681,7 +696,7 @@
   std::string d = cmSystemTools::ConvertToOutputPath(location);
   fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" 
        << name << "\", \""
-       << d << "\", \"{"
+       << this->ConvertToSolutionPath(location) << "\", \"{"
        << this->GetGUID(name)
        << "}\"\n";
   fout << "EndProject\n";

Index: cmGlobalVisualStudio7Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalVisualStudio7Generator.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- cmGlobalVisualStudio7Generator.h	28 Sep 2006 20:40:35 -0000	1.38
+++ cmGlobalVisualStudio7Generator.h	10 Oct 2006 01:48:48 -0000	1.39
@@ -118,6 +118,7 @@
                             const char* name, const char* path,
                             const std::vector<std::string>& dependencies);
 
+  std::string ConvertToSolutionPath(const char* path);
 
   std::vector<std::string> Configurations;
   std::map<cmStdString, cmStdString> GUIDMap;



More information about the Cmake-commits mailing list