BUG: Fixed generation of VS8 solution file to not be re-written when loaded by VS and to work with msbuild.
This commit is contained in:
parent
eeab2c55ed
commit
bd0b829ffb
@ -25,6 +25,7 @@
|
|||||||
cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator()
|
cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator()
|
||||||
{
|
{
|
||||||
m_FindMakeProgramFile = "CMakeVS71FindMake.cmake";
|
m_FindMakeProgramFile = "CMakeVS71FindMake.cmake";
|
||||||
|
m_ProjectConfigurationSectionName = "ProjectConfiguration";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -52,6 +53,7 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout,
|
|||||||
std::string rootdir = root->GetMakefile()->GetStartOutputDirectory();
|
std::string rootdir = root->GetMakefile()->GetStartOutputDirectory();
|
||||||
rootdir += "/";
|
rootdir += "/";
|
||||||
bool doneAllBuild = false;
|
bool doneAllBuild = false;
|
||||||
|
bool doneCheckBuild = false;
|
||||||
bool doneRunTests = false;
|
bool doneRunTests = false;
|
||||||
bool doneInstall = false;
|
bool doneInstall = false;
|
||||||
|
|
||||||
@ -141,6 +143,17 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout,
|
|||||||
doneAllBuild = true;
|
doneAllBuild = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(l->first == CMAKE_CHECK_BUILD_SYSTEM_TARGET)
|
||||||
|
{
|
||||||
|
if(doneCheckBuild)
|
||||||
|
{
|
||||||
|
skip = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
doneCheckBuild = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(l->first == "INSTALL")
|
if(l->first == "INSTALL")
|
||||||
{
|
{
|
||||||
if(doneInstall)
|
if(doneInstall)
|
||||||
@ -172,16 +185,10 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fout << "Global\n"
|
fout << "Global\n";
|
||||||
<< "\tGlobalSection(SolutionConfiguration) = preSolution\n";
|
this->WriteSolutionConfigurations(fout);
|
||||||
|
fout << "\tGlobalSection(" << m_ProjectConfigurationSectionName
|
||||||
for(std::vector<std::string>::iterator i = m_Configurations.begin();
|
<< ") = postSolution\n";
|
||||||
i != m_Configurations.end(); ++i)
|
|
||||||
{
|
|
||||||
fout << "\t\t" << *i << " = " << *i << "\n";
|
|
||||||
}
|
|
||||||
fout << "\tEndGlobalSection\n";
|
|
||||||
fout << "\tGlobalSection(ProjectConfiguration) = postSolution\n";
|
|
||||||
// loop over again and compute the depends
|
// loop over again and compute the depends
|
||||||
for(i = 0; i < generators.size(); ++i)
|
for(i = 0; i < generators.size(); ++i)
|
||||||
{
|
{
|
||||||
@ -221,6 +228,19 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
cmGlobalVisualStudio71Generator
|
||||||
|
::WriteSolutionConfigurations(std::ostream& fout)
|
||||||
|
{
|
||||||
|
fout << "\tGlobalSection(SolutionConfiguration) = preSolution\n";
|
||||||
|
for(std::vector<std::string>::iterator i = m_Configurations.begin();
|
||||||
|
i != m_Configurations.end(); ++i)
|
||||||
|
{
|
||||||
|
fout << "\t\t" << *i << " = " << *i << "\n";
|
||||||
|
}
|
||||||
|
fout << "\tEndGlobalSection\n";
|
||||||
|
}
|
||||||
|
|
||||||
// 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
|
||||||
// the libraries it uses are also done here
|
// the libraries it uses are also done here
|
||||||
|
@ -46,6 +46,7 @@ protected:
|
|||||||
virtual void WriteSLNFile(std::ostream& fout,
|
virtual void WriteSLNFile(std::ostream& fout,
|
||||||
cmLocalGenerator* root,
|
cmLocalGenerator* root,
|
||||||
std::vector<cmLocalGenerator*>& generators);
|
std::vector<cmLocalGenerator*>& generators);
|
||||||
|
virtual void WriteSolutionConfigurations(std::ostream& fout);
|
||||||
virtual void WriteProject(std::ostream& fout,
|
virtual void WriteProject(std::ostream& fout,
|
||||||
const char* name, const char* path, cmTarget &t);
|
const char* name, const char* path, cmTarget &t);
|
||||||
virtual void WriteProjectDepends(std::ostream& fout,
|
virtual void WriteProjectDepends(std::ostream& fout,
|
||||||
@ -55,5 +56,7 @@ protected:
|
|||||||
const std::vector<std::string>& depends);
|
const std::vector<std::string>& depends);
|
||||||
virtual void WriteSLNFooter(std::ostream& fout);
|
virtual void WriteSLNFooter(std::ostream& fout);
|
||||||
virtual void WriteSLNHeader(std::ostream& fout);
|
virtual void WriteSLNHeader(std::ostream& fout);
|
||||||
|
|
||||||
|
std::string m_ProjectConfigurationSectionName;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -278,7 +278,6 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout,
|
|||||||
std::string rootdir = root->GetMakefile()->GetStartOutputDirectory();
|
std::string rootdir = root->GetMakefile()->GetStartOutputDirectory();
|
||||||
rootdir += "/";
|
rootdir += "/";
|
||||||
bool doneAllBuild = false;
|
bool doneAllBuild = false;
|
||||||
bool doneCheckBuild = false;
|
|
||||||
bool doneRunTests = false;
|
bool doneRunTests = false;
|
||||||
bool doneInstall = false;
|
bool doneInstall = false;
|
||||||
|
|
||||||
@ -368,17 +367,6 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout,
|
|||||||
doneAllBuild = true;
|
doneAllBuild = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(l->first == CMAKE_CHECK_BUILD_SYSTEM_TARGET)
|
|
||||||
{
|
|
||||||
if(doneCheckBuild)
|
|
||||||
{
|
|
||||||
skip = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
doneCheckBuild = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(l->first == "INSTALL")
|
if(l->first == "INSTALL")
|
||||||
{
|
{
|
||||||
if(doneInstall)
|
if(doneInstall)
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator()
|
cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator()
|
||||||
{
|
{
|
||||||
m_FindMakeProgramFile = "CMakeVS8FindMake.cmake";
|
m_FindMakeProgramFile = "CMakeVS8FindMake.cmake";
|
||||||
|
m_ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -179,5 +180,37 @@ void cmGlobalVisualStudio8Generator::WriteSLNFile(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now write the solution file.
|
// Now write the solution file.
|
||||||
this->cmGlobalVisualStudio7Generator::WriteSLNFile(fout, root, generators);
|
this->cmGlobalVisualStudio71Generator::WriteSLNFile(fout, root, generators);
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void
|
||||||
|
cmGlobalVisualStudio8Generator
|
||||||
|
::WriteSolutionConfigurations(std::ostream& fout)
|
||||||
|
{
|
||||||
|
fout << "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n";
|
||||||
|
for(std::vector<std::string>::iterator i = m_Configurations.begin();
|
||||||
|
i != m_Configurations.end(); ++i)
|
||||||
|
{
|
||||||
|
fout << "\t\t" << *i << "|Win32 = " << *i << "|Win32\n";
|
||||||
|
}
|
||||||
|
fout << "\tEndGlobalSection\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
void
|
||||||
|
cmGlobalVisualStudio8Generator
|
||||||
|
::WriteProjectConfigurations(std::ostream& fout,
|
||||||
|
const char* name, bool in_all_build)
|
||||||
|
{
|
||||||
|
std::string guid = this->GetGUID(name);
|
||||||
|
for(std::vector<std::string>::iterator i = m_Configurations.begin();
|
||||||
|
i != m_Configurations.end(); ++i)
|
||||||
|
{
|
||||||
|
fout << "\t\t{" << guid << "}." << *i << "|Win32.ActiveCfg = " << *i << "|Win32\n";
|
||||||
|
if (in_all_build)
|
||||||
|
{
|
||||||
|
fout << "\t\t{" << guid << "}." << *i << "|Win32.Build.0 = " << *i << "|Win32\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,5 +52,8 @@ protected:
|
|||||||
virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
|
virtual void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
|
||||||
std::vector<cmLocalGenerator*>& generators);
|
std::vector<cmLocalGenerator*>& generators);
|
||||||
virtual void WriteSLNHeader(std::ostream& fout);
|
virtual void WriteSLNHeader(std::ostream& fout);
|
||||||
|
virtual void WriteSolutionConfigurations(std::ostream& fout);
|
||||||
|
virtual void WriteProjectConfigurations(std::ostream& fout,
|
||||||
|
const char* name, bool in_all);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user