Commit 07d0e776 authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

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

parent 586a9427
......@@ -169,23 +169,6 @@ void cmGlobalVisualStudio6Generator::Generate()
gen[0]->GetMakefile()->
AddUtilityCommand("ALL_BUILD", false, no_output, no_depends, no_working_dir,
"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 doneRunTests = false;
bool doneInstall = false;
bool doneEditCache = false;
bool doneRebuildCache = false;
bool donePackage = false;
for(i = 0; i < generators.size(); ++i)
{
......@@ -322,6 +308,39 @@ void cmGlobalVisualStudio6Generator::WriteDSWFile(std::ostream& fout,
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)
{
this->WriteProject(fout, si->c_str(), dir.c_str(),l->second);
......
......@@ -107,7 +107,8 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout,
{
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());
}
......
......@@ -205,22 +205,6 @@ void cmGlobalVisualStudio7Generator::Generate()
"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=$(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.GetType() == cmTarget::UTILITY)
if (al->second.GetType() == cmTarget::UTILITY &&
al->second.GetType() == cmTarget::GLOBAL_TARGET)
{
l->second.AddUtility(al->first.c_str());
}
......
......@@ -183,6 +183,7 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
this->SetBuildType(EXECUTABLE,l->first.c_str(), l->second);
break;
case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
this->SetBuildType(UTILITY, l->first.c_str(), l->second);
break;
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
// the dependencies of all the rules. The later rules must each
// 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.GetPostBuildCommands().empty()))
{
......@@ -453,7 +455,8 @@ void cmLocalVisualStudio6Generator::WriteGroup(const cmSourceGroup *sg, cmTarget
{
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";
......@@ -718,7 +721,8 @@ cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target,
{
std::string customRuleCode = "";
if (target.GetType() >= cmTarget::UTILITY)
if (target.GetType() >= cmTarget::UTILITY ||
target.GetType() >= cmTarget::GLOBAL_TARGET)
{
return customRuleCode;
}
......
......@@ -162,11 +162,6 @@ void cmLocalVisualStudio7Generator::OutputVCProjFile()
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
&& (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 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))
{
cmTarget& target = l->second;
......@@ -435,6 +430,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
configType = "1";
break;
case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
configType = "10";
default:
break;
......@@ -859,6 +855,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
break;
}
case cmTarget::UTILITY:
case cmTarget::GLOBAL_TARGET:
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";
std::string d = this->ConvertToXMLOutputPathSingle(source.c_str());
......@@ -1222,7 +1220,8 @@ void cmLocalVisualStudio7Generator::OutputTargetRules(std::ostream& fout,
cmTarget &target,
const char * /*libName*/)
{
if (target.GetType() > cmTarget::UTILITY)
if (target.GetType() > cmTarget::UTILITY ||
target.GetType() > cmTarget::GLOBAL_TARGET)
{
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment