BUG: More fixing of support for global target son visual studio

This commit is contained in:
Andy Cedilnik 2006-02-24 16:20:44 -05:00
parent 586a9427d3
commit 07d0e776ad
5 changed files with 53 additions and 45 deletions

View File

@ -169,23 +169,6 @@ void cmGlobalVisualStudio6Generator::Generate()
gen[0]->GetMakefile()-> gen[0]->GetMakefile()->
AddUtilityCommand("ALL_BUILD", false, no_output, no_depends, no_working_dir, AddUtilityCommand("ALL_BUILD", false, no_output, no_depends, no_working_dir,
"echo", "Build all projects"); "echo", "Build all projects");
std::string cmake_command =
m_LocalGenerators[0]->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND");
gen[0]->GetMakefile()->
AddUtilityCommand("INSTALL", false, no_output, no_depends, no_working_dir,
cmake_command.c_str(),
"-DBUILD_TYPE=$(IntDir)", "-P", "cmake_install.cmake");
// Make the INSTALL target depend on ALL_BUILD unless the
// project says to not do so.
const char* noall =
gen[0]->GetMakefile()
->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
if(!noall || cmSystemTools::IsOff(noall))
{
cmTarget* install = gen[0]->GetMakefile()->FindTarget("INSTALL");
install->AddUtility("ALL_BUILD");
}
} }
} }
@ -215,6 +198,9 @@ void cmGlobalVisualStudio6Generator::WriteDSWFile(std::ostream& fout,
bool doneAllBuild = false; bool doneAllBuild = false;
bool doneRunTests = false; bool doneRunTests = false;
bool doneInstall = false; bool doneInstall = false;
bool doneEditCache = false;
bool doneRebuildCache = false;
bool donePackage = false;
for(i = 0; i < generators.size(); ++i) for(i = 0; i < generators.size(); ++i)
{ {
@ -322,6 +308,39 @@ void cmGlobalVisualStudio6Generator::WriteDSWFile(std::ostream& fout,
doneRunTests = true; doneRunTests = true;
} }
} }
if(l->first == "EDIT_CACHE")
{
if(doneEditCache)
{
skip = true;
}
else
{
doneEditCache = true;
}
}
if(l->first == "REBUILD_CACHE")
{
if(doneRebuildCache)
{
skip = true;
}
else
{
doneRebuildCache = true;
}
}
if(l->first == "PACKAGE")
{
if(donePackage)
{
skip = true;
}
else
{
donePackage = true;
}
}
if(!skip) if(!skip)
{ {
this->WriteProject(fout, si->c_str(), dir.c_str(),l->second); this->WriteProject(fout, si->c_str(), dir.c_str(),l->second);

View File

@ -107,7 +107,8 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout,
{ {
if (al->second.IsInAll()) if (al->second.IsInAll())
{ {
if (al->second.GetType() == cmTarget::UTILITY) if (al->second.GetType() == cmTarget::UTILITY &&
al->second.GetType() == cmTarget::GLOBAL_TARGET)
{ {
l->second.AddUtility(al->first.c_str()); l->second.AddUtility(al->first.c_str());
} }

View File

@ -205,22 +205,6 @@ void cmGlobalVisualStudio7Generator::Generate()
"echo", "Build all projects"); "echo", "Build all projects");
std::string cmake_command = std::string cmake_command =
m_LocalGenerators[0]->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND"); m_LocalGenerators[0]->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND");
gen[0]->GetMakefile()->
AddUtilityCommand("INSTALL", false, no_output, no_depends,
no_working_dir,
cmake_command.c_str(),
"-DBUILD_TYPE=$(OutDir)", "-P", "cmake_install.cmake");
// Make the INSTALL target depend on ALL_BUILD unless the
// project says to not do so.
const char* noall =
gen[0]->GetMakefile()
->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
if(!noall || cmSystemTools::IsOff(noall))
{
cmTarget* install = gen[0]->GetMakefile()->FindTarget("INSTALL");
install->AddUtility("ALL_BUILD");
}
} }
} }
@ -331,7 +315,8 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout,
{ {
if (al->second.IsInAll()) if (al->second.IsInAll())
{ {
if (al->second.GetType() == cmTarget::UTILITY) if (al->second.GetType() == cmTarget::UTILITY &&
al->second.GetType() == cmTarget::GLOBAL_TARGET)
{ {
l->second.AddUtility(al->first.c_str()); l->second.AddUtility(al->first.c_str());
} }

View File

@ -183,6 +183,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
this->SetBuildType(EXECUTABLE,l->first.c_str(), l->second); this->SetBuildType(EXECUTABLE,l->first.c_str(), l->second);
break; break;
case cmTarget::UTILITY: case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
this->SetBuildType(UTILITY, l->first.c_str(), l->second); this->SetBuildType(UTILITY, l->first.c_str(), l->second);
break; break;
case cmTarget::INSTALL_FILES: case cmTarget::INSTALL_FILES:
@ -309,7 +310,8 @@ void cmLocalVisualStudio6Generator::WriteDSPFile(std::ostream& fout,
// special care for dependencies. The first rule must depend on all // special care for dependencies. The first rule must depend on all
// the dependencies of all the rules. The later rules must each // the dependencies of all the rules. The later rules must each
// depend only on the previous rule. // depend only on the previous rule.
if (target.GetType() == cmTarget::UTILITY && if ((target.GetType() == cmTarget::UTILITY ||
target.GetType() == cmTarget::GLOBAL_TARGET) &&
(!target.GetPreBuildCommands().empty() || (!target.GetPreBuildCommands().empty() ||
!target.GetPostBuildCommands().empty())) !target.GetPostBuildCommands().empty()))
{ {
@ -453,7 +455,8 @@ void cmLocalVisualStudio6Generator::WriteGroup(const cmSourceGroup *sg, cmTarget
{ {
cmSystemTools::ExpandListArgument(dependsValue, depends); cmSystemTools::ExpandListArgument(dependsValue, depends);
} }
if (source != libName || target.GetType() == cmTarget::UTILITY) if (source != libName || target.GetType() == cmTarget::UTILITY
|| target.GetType() == cmTarget::GLOBAL_TARGET)
{ {
fout << "# Begin Source File\n\n"; fout << "# Begin Source File\n\n";
@ -718,7 +721,8 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target,
{ {
std::string customRuleCode = ""; std::string customRuleCode = "";
if (target.GetType() >= cmTarget::UTILITY) if (target.GetType() >= cmTarget::UTILITY ||
target.GetType() >= cmTarget::GLOBAL_TARGET)
{ {
return customRuleCode; return customRuleCode;
} }

View File

@ -162,11 +162,6 @@ void cmLocalVisualStudio7Generator::OutputVCProjFile()
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS) && (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
&& (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0) && (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)
&& (strcmp(l->first.c_str(), "ALL_BUILD") != 0) && (strcmp(l->first.c_str(), "ALL_BUILD") != 0)
&& (strcmp(l->first.c_str(), "RUN_TESTS") != 0)
&& (strcmp(l->first.c_str(), "EDIT_CACHE") != 0)
&& (strcmp(l->first.c_str(), "REBUILD_CACHE") != 0)
&& (strcmp(l->first.c_str(), "PACKAGE") != 0)
&& (strcmp(l->first.c_str(), "INSTALL") != 0)
&& (strcmp(l->first.c_str(), CMAKE_CHECK_BUILD_SYSTEM_TARGET) != 0)) && (strcmp(l->first.c_str(), CMAKE_CHECK_BUILD_SYSTEM_TARGET) != 0))
{ {
cmTarget& target = l->second; cmTarget& target = l->second;
@ -435,6 +430,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
configType = "1"; configType = "1";
break; break;
case cmTarget::UTILITY: case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
configType = "10"; configType = "10";
default: default:
break; break;
@ -859,6 +855,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
break; break;
} }
case cmTarget::UTILITY: case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
break; break;
} }
} }
@ -1070,7 +1067,8 @@ void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget
} }
} }
} }
if (source != libName || target.GetType() == cmTarget::UTILITY) if (source != libName || target.GetType() == cmTarget::UTILITY ||
target.GetType() == cmTarget::GLOBAL_TARGET )
{ {
fout << "\t\t\t<File\n"; fout << "\t\t\t<File\n";
std::string d = this->ConvertToXMLOutputPathSingle(source.c_str()); std::string d = this->ConvertToXMLOutputPathSingle(source.c_str());
@ -1222,7 +1220,8 @@ void cmLocalVisualStudio7Generator::OutputTargetRules(std::ostream& fout,
cmTarget &target, cmTarget &target,
const char * /*libName*/) const char * /*libName*/)
{ {
if (target.GetType() > cmTarget::UTILITY) if (target.GetType() > cmTarget::UTILITY ||
target.GetType() > cmTarget::GLOBAL_TARGET)
{ {
return; return;
} }