summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-06-11 18:15:02 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-06-11 18:15:02 (GMT)
commit5484a691effbc1aa5ceee616d9599a59af5a7b2a (patch)
tree224505804a0d82e8c00f2aff23eb38bd4c2dc2fc /Source
parentf3cfbce074bde5e20f432c1abee4f5a5a26686e3 (diff)
downloadCMake-5484a691effbc1aa5ceee616d9599a59af5a7b2a.zip
CMake-5484a691effbc1aa5ceee616d9599a59af5a7b2a.tar.gz
CMake-5484a691effbc1aa5ceee616d9599a59af5a7b2a.tar.bz2
BUG: fix dot net for paths with spaces
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMSDotNETGenerator.cxx71
-rw-r--r--Source/cmMSDotNETGenerator.h1
2 files changed, 53 insertions, 19 deletions
diff --git a/Source/cmMSDotNETGenerator.cxx b/Source/cmMSDotNETGenerator.cxx
index 87dccc8..ccf45eb 100644
--- a/Source/cmMSDotNETGenerator.cxx
+++ b/Source/cmMSDotNETGenerator.cxx
@@ -627,19 +627,19 @@ void cmMSDotNETGenerator::AddVCProjBuildRule(cmSourceGroup& sourceGroup)
m_Makefile->ExpandVariablesInString(dsprule);
dsprule = cmSystemTools::ConvertToOutputPath(dsprule.c_str());
std::string args = makefileIn;
- args += " -H\"";
+ args += " -H";
args +=
cmSystemTools::ConvertToOutputPath(m_Makefile->GetHomeDirectory());
- args += "\" -S\"";
+ args += " -S";
args +=
cmSystemTools::ConvertToOutputPath(m_Makefile->GetStartDirectory());
- args += "\" -O\"";
+ args += " -O";
args +=
cmSystemTools::ConvertToOutputPath(m_Makefile->GetStartOutputDirectory());
- args += "\" -B\"";
+ args += " -B";
args +=
cmSystemTools::ConvertToOutputPath(m_Makefile->GetHomeOutputDirectory());
- args += "\"";
+ args += "";
m_Makefile->ExpandVariablesInString(args);
std::string configFile =
@@ -819,6 +819,7 @@ void cmMSDotNETGenerator::OutputBuildTool(std::ostream& fout,
const char *libName,
const cmTarget &target)
{
+ std::string temp;
switch(target.GetType())
{
case cmTarget::STATIC_LIBRARY:
@@ -828,7 +829,7 @@ void cmMSDotNETGenerator::OutputBuildTool(std::ostream& fout,
fout << "\t\t\t<Tool\n"
<< "\t\t\t\tName=\"VCLibrarianTool\"\n"
<< "\t\t\t\t\tOutputFile=\""
- << this->ConvertToXMLOutputPath(libpath.c_str()) << ".\"/>\n";
+ << this->ConvertToXMLOutputPathSingle(libpath.c_str()) << ".\"/>\n";
break;
}
case cmTarget::SHARED_LIBRARY:
@@ -839,17 +840,26 @@ void cmMSDotNETGenerator::OutputBuildTool(std::ostream& fout,
<< "\t\t\t\tAdditionalDependencies=\" odbc32.lib odbccp32.lib ";
this->OutputLibraries(fout, configName, libName, target);
fout << "\"\n";
+ temp = m_LibraryOutputPath;
+ temp += configName;
+ temp += "/";
+ temp += libName;
+ temp += ".dll";
fout << "\t\t\t\tOutputFile=\""
- << m_ExecutableOutputPath << configName << "/"
- << libName << ".dll\"\n";
+ << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
fout << "\t\t\t\tLinkIncremental=\"1\"\n";
fout << "\t\t\t\tSuppressStartupBanner=\"TRUE\"\n";
fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
this->OutputLibraryDirectories(fout, configName, libName, target);
fout << "\"\n";
this->OutputModuleDefinitionFile(fout, target);
- fout << "\t\t\t\tProgramDatabaseFile=\"" << m_LibraryOutputPath
- << "$(OutDir)\\" << libName << ".pdb\"\n";
+ temp = m_LibraryOutputPath;
+ temp += "$(OutDir)";
+ temp += "/";
+ temp += libName;
+ temp += ".pdb";
+ fout << "\t\t\t\tProgramDatabaseFile=\"" <<
+ this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
if(strcmp(configName, "Debug") == 0
|| strcmp(configName, "RelWithDebInfo") == 0)
{
@@ -857,9 +867,12 @@ void cmMSDotNETGenerator::OutputBuildTool(std::ostream& fout,
}
fout << "\t\t\t\tStackReserveSize=\""
<< m_Makefile->GetDefinition("CMAKE_CXX_STACK_SIZE") << "\"\n";
- fout << "\t\t\t\tImportLibrary=\""
- << m_ExecutableOutputPath << configName << "/"
- << libName << ".lib\"/>\n";
+ temp = m_ExecutableOutputPath;
+ temp += configName;
+ temp += "/";
+ temp += libName;
+ temp += ".lib";
+ fout << "\t\t\t\tImportLibrary=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"/>\n";
break;
case cmTarget::EXECUTABLE:
case cmTarget::WIN32_EXECUTABLE:
@@ -870,8 +883,12 @@ void cmMSDotNETGenerator::OutputBuildTool(std::ostream& fout,
<< "\t\t\t\tAdditionalDependencies=\" odbc32.lib odbccp32.lib ";
this->OutputLibraries(fout, configName, libName, target);
fout << "\"\n";
- fout << "\t\t\t\tOutputFile=\""
- << m_ExecutableOutputPath << configName << "/" << libName << ".exe\"\n";
+ temp = m_ExecutableOutputPath;
+ temp += configName;
+ temp += "/";
+ temp += libName;
+ temp += ".exe";
+ fout << "\t\t\t\tOutputFile=\"" << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";
fout << "\t\t\t\tLinkIncremental=\"1\"\n";
fout << "\t\t\t\tSuppressStartupBanner=\"TRUE\"\n";
fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
@@ -922,17 +939,24 @@ void cmMSDotNETGenerator::OutputLibraryDirectories(std::ostream& fout,
const char*,
const char*,
const cmTarget &tgt)
-{
+{
bool hasone = false;
if(m_LibraryOutputPath.size())
{
hasone = true;
- fout << m_LibraryOutputPath << "$(INTDIR)," << m_LibraryOutputPath;
+ std::string temp = m_LibraryOutputPath;
+ temp += "$(INTDIR)";
+
+ fout << this->ConvertToXMLOutputPath(temp.c_str()) << "," <<
+ this->ConvertToXMLOutputPath(m_LibraryOutputPath.c_str());
}
if(m_ExecutableOutputPath.size())
{
hasone = true;
- fout << m_ExecutableOutputPath << "$(INTDIR)," << m_ExecutableOutputPath;
+ std::string temp = m_ExecutableOutputPath;
+ temp += "$(INTDIR)";
+ fout << this->ConvertToXMLOutputPath(temp.c_str()) << "," <<
+ this->ConvertToXMLOutputPath(m_ExecutableOutputPath.c_str());
}
std::set<std::string> pathEmitted;
@@ -1292,7 +1316,9 @@ void cmMSDotNETGenerator::OutputTargetRules(std::ostream& fout,
fout << "\nCommandLine=\"";
init = true;
}
- fout << cc.GetCommand() << " " << cc.GetArguments() << "\n";
+ std::string args = cc.GetArguments();
+ cmSystemTools::ReplaceString(args, "\"", "&quot;");
+ fout << this->ConvertToXMLOutputPath(cc.GetCommand().c_str()) << " " << args << "\n";
}
}
if (init)
@@ -1333,3 +1359,10 @@ std::string cmMSDotNETGenerator::ConvertToXMLOutputPath(const char* path)
cmSystemTools::ReplaceString(ret, "\"", "&quot;");
return ret;
}
+
+std::string cmMSDotNETGenerator::ConvertToXMLOutputPathSingle(const char* path)
+{
+ std::string ret = cmSystemTools::ConvertToOutputPath(path);
+ cmSystemTools::ReplaceString(ret, "\"", "");
+ return ret;
+}
diff --git a/Source/cmMSDotNETGenerator.h b/Source/cmMSDotNETGenerator.h
index 7fc8c2d..b2c5f1b 100644
--- a/Source/cmMSDotNETGenerator.h
+++ b/Source/cmMSDotNETGenerator.h
@@ -150,6 +150,7 @@ private:
const char* libName,
const cmTarget &target);
std::string ConvertToXMLOutputPath(const char* path);
+ std::string ConvertToXMLOutputPathSingle(const char* path);
private:
std::map<cmStdString, cmStdString> m_GUIDMap;
bool m_BuildSLN;