Browse Source

Revert "With very long file names, VS 2010 was unable to compile files."

This reverts commit 945f2c2214bc80f513ed08ebe2c8003263a4ee56.
Bill Hoffman 14 years ago
parent
commit
38368d52f3
1 changed files with 10 additions and 1 deletions
  1. 10 1
      Source/cmVisualStudio10TargetGenerator.cxx

+ 10 - 1
Source/cmVisualStudio10TargetGenerator.cxx

@@ -367,7 +367,10 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
     static_cast<cmGlobalVisualStudio7Generator *>
     static_cast<cmGlobalVisualStudio7Generator *>
     (this->GlobalGenerator)->GetConfigurations(); 
     (this->GlobalGenerator)->GetConfigurations(); 
   this->WriteString("<CustomBuild Include=\"", 2);
   this->WriteString("<CustomBuild Include=\"", 2);
-  std::string path = sourcePath;
+  std::string path =
+    cmSystemTools::RelativePath(
+      this->Makefile->GetCurrentOutputDirectory(),
+      sourcePath.c_str());
   this->ConvertToWindowsSlash(path);
   this->ConvertToWindowsSlash(path);
   (*this->BuildFileStream ) << path << "\">\n";
   (*this->BuildFileStream ) << path << "\">\n";
   for(std::vector<std::string>::iterator i = configs->begin();
   for(std::vector<std::string>::iterator i = configs->begin();
@@ -608,6 +611,9 @@ WriteGroupSources(const char* name,
     const char* filter = sourceGroup.GetFullName();
     const char* filter = sourceGroup.GetFullName();
     this->WriteString("<", 2); 
     this->WriteString("<", 2); 
     std::string path = source;
     std::string path = source;
+    path = cmSystemTools::RelativePath(
+      this->Makefile->GetCurrentOutputDirectory(),
+      source.c_str());
     this->ConvertToWindowsSlash(path);
     this->ConvertToWindowsSlash(path);
     (*this->BuildFileStream) << name << " Include=\""
     (*this->BuildFileStream) << name << " Include=\""
                              << path;
                              << path;
@@ -695,6 +701,9 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
     bool rc = lang && (strcmp(lang, "RC") == 0);
     bool rc = lang && (strcmp(lang, "RC") == 0);
     bool idl = ext == "idl";
     bool idl = ext == "idl";
     std::string sourceFile = (*source)->GetFullPath();
     std::string sourceFile = (*source)->GetFullPath();
+    sourceFile =  cmSystemTools::RelativePath(
+      this->Makefile->GetCurrentOutputDirectory(),
+      sourceFile.c_str());
     this->ConvertToWindowsSlash(sourceFile);
     this->ConvertToWindowsSlash(sourceFile);
     // output the source file
     // output the source file
     if(header)
     if(header)