ENH: dot net almost working

This commit is contained in:
Bill Hoffman 2002-02-25 18:14:01 -05:00
parent b253a0644d
commit 6ad590aad6
6 changed files with 45 additions and 36 deletions

View File

@ -44,6 +44,16 @@ bool cmBuildCommand::InitialPass(std::vector<std::string> const& args)
makecommand += m_Makefile->GetProjectName(); makecommand += m_Makefile->GetProjectName();
makecommand += ".dsw /MAKE \"ALL_BUILD - Release\" "; makecommand += ".dsw /MAKE \"ALL_BUILD - Release\" ";
} }
else if (makeprogram.find("devenv") != std::string::npos ||
makeprogram.find("DEVENV") != std::string::npos )
{
makecommand = "\"";
makecommand += makeprogram;
makecommand += "\"";
makecommand += " ";
makecommand += m_Makefile->GetProjectName();
makecommand += ".sln /build Release /project ALL_BUILD";
}
else if(m_Makefile->GetDefinition("BORLAND")) else if(m_Makefile->GetDefinition("BORLAND"))
{ {
makecommand = makeprogram; makecommand = makeprogram;

View File

@ -42,7 +42,7 @@ public:
/** /**
* Return the number of files in the current directory. * Return the number of files in the current directory.
*/ */
int GetNumberOfFiles() { return m_Files.size();} std::vector<std::string>::size_type GetNumberOfFiles() { return m_Files.size();}
/** /**
* Return the file at the given index, the indexing is 0 based * Return the file at the given index, the indexing is 0 based

View File

@ -27,7 +27,7 @@
cmMSDotNETGenerator::cmMSDotNETGenerator() cmMSDotNETGenerator::cmMSDotNETGenerator()
{ {
m_Configurations.push_back("Debug"); m_Configurations.push_back("Debug");
// m_Configurations.push_back("Release"); m_Configurations.push_back("Release");
// m_Configurations.push_back("MinSizeRel"); // m_Configurations.push_back("MinSizeRel");
// m_Configurations.push_back("RelWithDebInfo"); // m_Configurations.push_back("RelWithDebInfo");
// default to building a sln project file // default to building a sln project file
@ -66,7 +66,7 @@ void cmMSDotNETGenerator::ComputeSystemInfo()
} }
std::string fpath = std::string fpath =
m_Makefile->GetDefinition("CMAKE_ROOT"); m_Makefile->GetDefinition("CMAKE_ROOT");
fpath += "/Templates/CMakeWindowsSystemConfig.cmake"; fpath += "/Templates/CMakeDotNetSystemConfig.cmake";
m_Makefile->ReadListFile(NULL,fpath.c_str()); m_Makefile->ReadListFile(NULL,fpath.c_str());
} }
@ -742,7 +742,9 @@ void cmMSDotNETGenerator::WriteConfiguration(std::ostream& fout,
fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n"; fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCCustomBuildTool\"/>\n";
fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n"; fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCMIDLTool\"/>\n";
fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"/>\n"; fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCPostBuildEventTool\"";
this->OutputTargetRules(fout, target, libName);
fout << "/>\n";
fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n"; fout << "\t\t\t<Tool\n\t\t\t\tName=\"VCPreBuildEventTool\"/>\n";
this->OutputBuildTool(fout, configName, libName, target); this->OutputBuildTool(fout, configName, libName, target);
fout << "\t\t</Configuration>\n"; fout << "\t\t</Configuration>\n";
@ -838,7 +840,7 @@ void cmMSDotNETGenerator::OutputLibraryDirectories(std::ostream& fout,
{ {
fout << ","; fout << ",";
} }
fout << lpath; fout << lpath << "\\$(INTDIR)," << lpath;
hasone = true; hasone = true;
} }
} }
@ -873,13 +875,17 @@ void cmMSDotNETGenerator::OutputDefineFlags(std::ostream& fout)
std::string defs = m_Makefile->GetDefineFlags(); std::string defs = m_Makefile->GetDefineFlags();
std::string::size_type pos = defs.find("-D"); std::string::size_type pos = defs.find("-D");
bool done = pos == std::string::npos; bool done = pos == std::string::npos;
if(!done)
{
fout << ",";
}
while(!done) while(!done)
{ {
std::string::size_type nextpos = defs.find("-D", pos+2); std::string::size_type nextpos = defs.find("-D", pos+2);
std::string define; std::string define;
if(nextpos != std::string::npos) if(nextpos != std::string::npos)
{ {
define = defs.substr(pos+2, nextpos - pos -2); define = defs.substr(pos+2, nextpos - pos -3);
} }
else else
{ {
@ -1113,15 +1119,14 @@ cmMSDotNETGenerator::CombineCommands(const cmSourceGroup::Commands &commands,
// look for custom rules on a target and collect them together // look for custom rules on a target and collect them together
std::string
cmMSDotNETGenerator::CreateTargetRules(const cmTarget &target, void cmMSDotNETGenerator::OutputTargetRules(std::ostream& fout,
const cmTarget &target,
const char *libName) const char *libName)
{ {
std::string customRuleCode = "";
if (target.GetType() >= cmTarget::UTILITY) if (target.GetType() >= cmTarget::UTILITY)
{ {
return customRuleCode; return;
} }
// Find the group in which the lix exe custom rules belong // Find the group in which the lix exe custom rules belong
@ -1136,23 +1141,16 @@ cmMSDotNETGenerator::CreateTargetRules(const cmTarget &target,
{ {
if(!init) if(!init)
{ {
// header stuff fout << "\nCommandLine=\"";
customRuleCode = "# Begin Special Build Tool\nPostBuild_Cmds=";
init = true; init = true;
} }
else fout << cc.GetCommand() << " " << cc.GetArguments() << "\n";
{
customRuleCode += "\t";
}
customRuleCode += cc.GetCommand() + " " + cc.GetArguments();
} }
} }
if (init) if (init)
{ {
customRuleCode += "\n# End Special Build Tool\n"; fout << "\"";
} }
return customRuleCode;
} }
void cmMSDotNETGenerator::WriteProjectStart(std::ostream& fout, const char *libName, void cmMSDotNETGenerator::WriteProjectStart(std::ostream& fout, const char *libName,

View File

@ -112,7 +112,8 @@ private:
const std::set<std::string>& depends, const std::set<std::string>& depends,
const std::set<std::string>& outputs); const std::set<std::string>& outputs);
std::string CreateTargetRules(const cmTarget &target, void OutputTargetRules(std::ostream& fout,
const cmTarget &target,
const char *libName); const char *libName);
std::string CombineCommands(const cmSourceGroup::Commands &commands, std::string CombineCommands(const cmSourceGroup::Commands &commands,
cmSourceGroup::CommandFiles &totalCommand, cmSourceGroup::CommandFiles &totalCommand,

View File

@ -220,12 +220,12 @@ public:
/** /**
* Index to start of first find. * Index to start of first find.
*/ */
inline long start() const; inline std::string::size_type start() const;
/** /**
* Index to end of first find. * Index to end of first find.
*/ */
inline long end() const; inline std::string::size_type end() const;
/** /**
* Returns true if two regular expressions have the same * Returns true if two regular expressions have the same
@ -259,8 +259,8 @@ public:
* Destructor. * Destructor.
*/ */
// awf added // awf added
int start(int n) const; std::string::size_type start(int n) const;
int end(int n) const; std::string::size_type end(int n) const;
std::string match(int n) const; std::string match(int n) const;
private: private:
@ -306,7 +306,7 @@ inline cmRegularExpression::~cmRegularExpression ()
/** /**
* Set the start position for the regular expression. * Set the start position for the regular expression.
*/ */
inline long cmRegularExpression::start () const inline std::string::size_type cmRegularExpression::start () const
{ {
return(this->startp[0] - searchstring); return(this->startp[0] - searchstring);
} }
@ -315,7 +315,7 @@ inline long cmRegularExpression::start () const
/** /**
* Returns the start/end index of the last item found. * Returns the start/end index of the last item found.
*/ */
inline long cmRegularExpression::end () const inline std::string::size_type cmRegularExpression::end () const
{ {
return(this->endp[0] - searchstring); return(this->endp[0] - searchstring);
} }
@ -350,7 +350,7 @@ inline void cmRegularExpression::set_invalid ()
/** /**
* Return start index of nth submatch. start(0) is the start of the full match. * Return start index of nth submatch. start(0) is the start of the full match.
*/ */
inline int cmRegularExpression::start(int n) const inline std::string::size_type cmRegularExpression::start(int n) const
{ {
return this->startp[n] - searchstring; return this->startp[n] - searchstring;
} }
@ -359,7 +359,7 @@ inline int cmRegularExpression::start(int n) const
/** /**
* Return end index of nth submatch. end(0) is the end of the full match. * Return end index of nth submatch. end(0) is the end of the full match.
*/ */
inline int cmRegularExpression::end(int n) const inline std::string::size_type cmRegularExpression::end(int n) const
{ {
return this->endp[n] - searchstring; return this->endp[n] - searchstring;
} }

View File

@ -179,9 +179,9 @@ void cmSystemTools::ReplaceString(std::string& source,
const char* replace, const char* replace,
const char* with) const char* with)
{ {
int lengthReplace = strlen(replace); std::string::size_type lengthReplace = strlen(replace);
std::string rest; std::string rest;
size_t start = source.find(replace); std::string::size_type start = source.find(replace);
while(start != std::string::npos) while(start != std::string::npos)
{ {
rest = source.substr(start+lengthReplace); rest = source.substr(start+lengthReplace);
@ -393,7 +393,7 @@ std::string cmSystemTools::UpperCase(const std::string& s)
} }
// convert windows slashes to unix slashes \ with / // convert windows slashes to unix slashes
void cmSystemTools::ConvertToUnixSlashes(std::string& path) void cmSystemTools::ConvertToUnixSlashes(std::string& path)
{ {
std::string::size_type pos = 0; std::string::size_type pos = 0;