diff options
author | Brad King <brad.king@kitware.com> | 2006-10-10 01:48:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-10-10 01:48:48 (GMT) |
commit | 8824f7984a5b19f3e5496b418f3716ffc6bf4718 (patch) | |
tree | 8aa2afc15302658da68580fe74974d0f0157923b /Source/cmGlobalVisualStudio7Generator.cxx | |
parent | 0fe0523810b1408c94c722ebae8aa47429d55d6d (diff) | |
download | CMake-8824f7984a5b19f3e5496b418f3716ffc6bf4718.zip CMake-8824f7984a5b19f3e5496b418f3716ffc6bf4718.tar.gz CMake-8824f7984a5b19f3e5496b418f3716ffc6bf4718.tar.bz2 |
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.
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 22c6647..ec24d22 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -554,6 +554,21 @@ void cmGlobalVisualStudio7Generator 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 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout, 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 @@ void cmGlobalVisualStudio7Generator::WriteExternalProject(std::ostream& fout, 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"; |