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.
This commit is contained in:
parent
0fe0523810
commit
8824f7984a
@ -294,10 +294,10 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
|
|||||||
const char* dir,
|
const char* dir,
|
||||||
cmTarget& t)
|
cmTarget& t)
|
||||||
{
|
{
|
||||||
std::string d = cmSystemTools::ConvertToOutputPath(dir);
|
|
||||||
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
|
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
|
||||||
<< dspname << "\", \""
|
<< dspname << "\", \""
|
||||||
<< d << "\\" << dspname << ".vcproj\", \"{"
|
<< this->ConvertToSolutionPath(dir)
|
||||||
|
<< "\\" << dspname << ".vcproj\", \"{"
|
||||||
<< this->GetGUID(dspname) << "}\"\n";
|
<< this->GetGUID(dspname) << "}\"\n";
|
||||||
fout << "\tProjectSection(ProjectDependencies) = postProject\n";
|
fout << "\tProjectSection(ProjectDependencies) = postProject\n";
|
||||||
this->WriteProjectDepends(fout, dspname, dir, t);
|
this->WriteProjectDepends(fout, dspname, dir, t);
|
||||||
@ -379,10 +379,9 @@ void cmGlobalVisualStudio71Generator
|
|||||||
const char* location,
|
const char* location,
|
||||||
const std::vector<std::string>& depends)
|
const std::vector<std::string>& depends)
|
||||||
{
|
{
|
||||||
std::string d = cmSystemTools::ConvertToOutputPath(location);
|
|
||||||
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
|
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
|
||||||
<< name << "\", \""
|
<< name << "\", \""
|
||||||
<< d << "\", \"{"
|
<< this->ConvertToSolutionPath(location) << "\", \"{"
|
||||||
<< this->GetGUID(name)
|
<< this->GetGUID(name)
|
||||||
<< "}\"\n";
|
<< "}\"\n";
|
||||||
|
|
||||||
|
@ -554,6 +554,21 @@ void cmGlobalVisualStudio7Generator
|
|||||||
this->WriteSLNFooter(fout);
|
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,
|
// Write a dsp file into the SLN file,
|
||||||
// Note, that dependencies from executables to
|
// Note, that dependencies from executables to
|
||||||
@ -562,10 +577,10 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout,
|
|||||||
const char* dspname,
|
const char* dspname,
|
||||||
const char* dir, cmTarget&)
|
const char* dir, cmTarget&)
|
||||||
{
|
{
|
||||||
std::string d = cmSystemTools::ConvertToOutputPath(dir);
|
|
||||||
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
|
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
|
||||||
<< dspname << "\", \""
|
<< dspname << "\", \""
|
||||||
<< d << "\\" << dspname << ".vcproj\", \"{"
|
<< this->ConvertToSolutionPath(dir)
|
||||||
|
<< "\\" << dspname << ".vcproj\", \"{"
|
||||||
<< this->GetGUID(dspname) << "}\"\nEndProject\n";
|
<< this->GetGUID(dspname) << "}\"\nEndProject\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -681,7 +696,7 @@ void cmGlobalVisualStudio7Generator::WriteExternalProject(std::ostream& fout,
|
|||||||
std::string d = cmSystemTools::ConvertToOutputPath(location);
|
std::string d = cmSystemTools::ConvertToOutputPath(location);
|
||||||
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
|
fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \""
|
||||||
<< name << "\", \""
|
<< name << "\", \""
|
||||||
<< d << "\", \"{"
|
<< this->ConvertToSolutionPath(location) << "\", \"{"
|
||||||
<< this->GetGUID(name)
|
<< this->GetGUID(name)
|
||||||
<< "}\"\n";
|
<< "}\"\n";
|
||||||
fout << "EndProject\n";
|
fout << "EndProject\n";
|
||||||
|
@ -118,6 +118,7 @@ protected:
|
|||||||
const char* name, const char* path,
|
const char* name, const char* path,
|
||||||
const std::vector<std::string>& dependencies);
|
const std::vector<std::string>& dependencies);
|
||||||
|
|
||||||
|
std::string ConvertToSolutionPath(const char* path);
|
||||||
|
|
||||||
std::vector<std::string> Configurations;
|
std::vector<std::string> Configurations;
|
||||||
std::map<cmStdString, cmStdString> GUIDMap;
|
std::map<cmStdString, cmStdString> GUIDMap;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user