ENH: Fixed INSTALL_FILES and INSTALL_PROGRAMS commands to not create targets. No targets of type cmTarget::INSTALL_FILES or cmTarget::INSTALL_PROGRAMS are created, so we do not need to check for them everywhere anymore.
This commit is contained in:
parent
303b4312b2
commit
ba7780a3c4
|
@ -94,9 +94,6 @@ void cmExportLibraryDependenciesCommand::FinalPass()
|
|||
for(cmTargets::iterator l = tgts.begin();
|
||||
l != tgts.end(); ++l)
|
||||
{
|
||||
if ((l->second.GetType() != cmTarget::INSTALL_FILES)
|
||||
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
|
||||
{
|
||||
libDepName = l->first;
|
||||
libDepName += "_LIB_DEPENDS";
|
||||
const char* def = this->Makefile->GetDefinition(libDepName.c_str());
|
||||
|
@ -120,6 +117,5 @@ void cmExportLibraryDependenciesCommand::FinalPass()
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -256,9 +256,6 @@ void cmGlobalVisualStudio6Generator
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((l->second.GetType() != cmTarget::INSTALL_FILES)
|
||||
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
|
||||
{
|
||||
bool skip = false;
|
||||
// skip ALL_BUILD and RUN_TESTS if they have already been added
|
||||
if(l->first == "ALL_BUILD" )
|
||||
|
@ -335,7 +332,6 @@ void cmGlobalVisualStudio6Generator
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Write the footer for the DSW file
|
||||
this->WriteDSWFooter(fout);
|
||||
|
|
|
@ -134,9 +134,6 @@ void cmGlobalVisualStudio71Generator
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((l->second.GetType() != cmTarget::INSTALL_FILES)
|
||||
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
|
||||
{
|
||||
bool skip = false;
|
||||
if(l->first == "ALL_BUILD" )
|
||||
{
|
||||
|
@ -227,7 +224,6 @@ void cmGlobalVisualStudio71Generator
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fout << "Global\n";
|
||||
this->WriteSolutionConfigurations(fout);
|
||||
fout << "\tGlobalSection(" << this->ProjectConfigurationSectionName
|
||||
|
@ -254,8 +250,7 @@ void cmGlobalVisualStudio71Generator
|
|||
this->WriteProjectConfigurations(fout, project.c_str(),
|
||||
true);
|
||||
}
|
||||
else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
|
||||
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
|
||||
else
|
||||
{
|
||||
bool partOfDefaultBuild = this->IsPartOfDefaultBuild(
|
||||
root->GetMakefile()->GetProjectName(),
|
||||
|
|
|
@ -341,9 +341,6 @@ void cmGlobalVisualStudio7Generator
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((l->second.GetType() != cmTarget::INSTALL_FILES)
|
||||
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
|
||||
{
|
||||
bool skip = false;
|
||||
if(l->first == "ALL_BUILD" )
|
||||
{
|
||||
|
@ -423,7 +420,6 @@ void cmGlobalVisualStudio7Generator
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fout << "Global\n"
|
||||
<< "\tGlobalSection(SolutionConfiguration) = preSolution\n";
|
||||
|
||||
|
@ -476,8 +472,7 @@ void cmGlobalVisualStudio7Generator
|
|||
depcount++;
|
||||
}
|
||||
}
|
||||
else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
|
||||
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
|
||||
else
|
||||
{
|
||||
const char *dspname =
|
||||
l->second.GetProperty("GENERATOR_FILE_NAME");
|
||||
|
@ -513,8 +508,7 @@ void cmGlobalVisualStudio7Generator
|
|||
this->WriteProjectConfigurations(fout, name.c_str(),
|
||||
true);
|
||||
}
|
||||
else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
|
||||
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
|
||||
else
|
||||
{
|
||||
bool partOfDefaultBuild = this->IsPartOfDefaultBuild(
|
||||
root->GetMakefile()->GetProjectName(),
|
||||
|
|
|
@ -596,12 +596,6 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
|
|||
cmtarget.GetType() == cmTarget::GLOBAL_TARGET)
|
||||
{
|
||||
targets.push_back(this->CreateUtilityTarget(cmtarget));
|
||||
}
|
||||
if(cmtarget.GetType() == cmTarget::UTILITY ||
|
||||
cmtarget.GetType() == cmTarget::GLOBAL_TARGET ||
|
||||
cmtarget.GetType() == cmTarget::INSTALL_FILES ||
|
||||
cmtarget.GetType() == cmTarget::INSTALL_PROGRAMS)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2498,9 +2492,7 @@ cmGlobalXCodeGenerator::OutputXCodeProject(cmLocalGenerator* root,
|
|||
for(cmTargets::iterator l = tgts.begin();
|
||||
l != tgts.end(); l++)
|
||||
{
|
||||
if ((l->second.GetType() != cmTarget::INSTALL_FILES)
|
||||
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
|
||||
&& (strncmp(l->first.c_str(),
|
||||
if ((strncmp(l->first.c_str(),
|
||||
"INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)
|
||||
&& banned.find(l->second.GetName()) == banned.end())
|
||||
{
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
=========================================================================*/
|
||||
#include "cmInstallFilesCommand.h"
|
||||
|
||||
#include "cmInstallFilesGenerator.h"
|
||||
|
||||
// cmExecutableCommand
|
||||
bool cmInstallFilesCommand
|
||||
::InitialPass(std::vector<std::string> const& argsIn)
|
||||
|
@ -33,13 +35,7 @@ bool cmInstallFilesCommand
|
|||
std::vector<std::string> args;
|
||||
this->Makefile->ExpandSourceListArguments(argsIn, args, 2);
|
||||
|
||||
// Create an INSTALL_FILES target specifically for this path.
|
||||
this->TargetName = "INSTALL_FILES_"+args[0];
|
||||
cmTarget& target = this->Makefile->GetTargets()[this->TargetName];
|
||||
target.SetType(cmTarget::INSTALL_FILES, this->TargetName.c_str());
|
||||
target.SetMakefile(this->Makefile);
|
||||
target.SetProperty("EXCLUDE_FROM_ALL","TRUE");
|
||||
target.SetInstallPath(args[0].c_str());
|
||||
this->Destination = args[0];
|
||||
|
||||
if((args.size() > 1) && (args[1] == "FILES"))
|
||||
{
|
||||
|
@ -49,7 +45,7 @@ bool cmInstallFilesCommand
|
|||
{
|
||||
// Find the source location for each file listed.
|
||||
std::string f = this->FindInstallSource(s->c_str());
|
||||
target.GetSourceLists().push_back(f);
|
||||
this->Files.push_back(f);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -75,8 +71,6 @@ void cmInstallFilesCommand::FinalPass()
|
|||
|
||||
std::string testf;
|
||||
std::string ext = this->FinalArgs[0];
|
||||
std::vector<std::string>& targetSourceLists =
|
||||
this->Makefile->GetTargets()[this->TargetName].GetSourceLists();
|
||||
|
||||
// two different options
|
||||
if (this->FinalArgs.size() > 1)
|
||||
|
@ -100,7 +94,7 @@ void cmInstallFilesCommand::FinalPass()
|
|||
}
|
||||
|
||||
// add to the result
|
||||
targetSourceLists.push_back(this->FindInstallSource(testf.c_str()));
|
||||
this->Files.push_back(this->FindInstallSource(testf.c_str()));
|
||||
}
|
||||
}
|
||||
else // reg exp list
|
||||
|
@ -114,9 +108,20 @@ void cmInstallFilesCommand::FinalPass()
|
|||
// for each argument, get the files
|
||||
for (;s != files.end(); ++s)
|
||||
{
|
||||
targetSourceLists.push_back(this->FindInstallSource(s->c_str()));
|
||||
this->Files.push_back(this->FindInstallSource(s->c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
// Use a file install generator.
|
||||
const char* no_permissions = "";
|
||||
const char* no_rename = "";
|
||||
const char* no_component = "";
|
||||
std::vector<std::string> no_configurations;
|
||||
this->Makefile->AddInstallGenerator(
|
||||
new cmInstallFilesGenerator(this->Files,
|
||||
this->Destination.c_str(), false,
|
||||
no_permissions, no_configurations,
|
||||
no_component, no_rename));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -106,9 +106,10 @@ protected:
|
|||
std::string FindInstallSource(const char* name) const;
|
||||
|
||||
private:
|
||||
std::string TargetName;
|
||||
std::vector<std::string> FinalArgs;
|
||||
bool IsFilesForm;
|
||||
std::string Destination;
|
||||
std::vector<std::string> Files;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -30,13 +30,7 @@ bool cmInstallProgramsCommand
|
|||
this->Makefile->GetLocalGenerator()
|
||||
->GetGlobalGenerator()->EnableInstallTarget();
|
||||
|
||||
// Create an INSTALL_PROGRAMS target specifically for this path.
|
||||
this->TargetName = "INSTALL_PROGRAMS_"+args[0];
|
||||
cmTarget& target = this->Makefile->GetTargets()[this->TargetName];
|
||||
target.SetType(cmTarget::INSTALL_PROGRAMS, this->TargetName.c_str());
|
||||
target.SetMakefile(this->Makefile);
|
||||
target.SetProperty("EXCLUDE_FROM_ALL","TRUE");
|
||||
target.SetInstallPath(args[0].c_str());
|
||||
this->Destination = args[0];
|
||||
|
||||
std::vector<std::string>::const_iterator s = args.begin();
|
||||
for (++s;s != args.end(); ++s)
|
||||
|
@ -49,9 +43,6 @@ bool cmInstallProgramsCommand
|
|||
|
||||
void cmInstallProgramsCommand::FinalPass()
|
||||
{
|
||||
std::vector<std::string>& targetSourceLists =
|
||||
this->Makefile->GetTargets()[this->TargetName].GetSourceLists();
|
||||
|
||||
bool files_mode = false;
|
||||
if(!this->FinalArgs.empty() && this->FinalArgs[0] == "FILES")
|
||||
{
|
||||
|
@ -71,7 +62,7 @@ void cmInstallProgramsCommand::FinalPass()
|
|||
for(;s != this->FinalArgs.end(); ++s)
|
||||
{
|
||||
// add to the result
|
||||
targetSourceLists.push_back(this->FindInstallSource(s->c_str()));
|
||||
this->Files.push_back(this->FindInstallSource(s->c_str()));
|
||||
}
|
||||
}
|
||||
else // reg exp list
|
||||
|
@ -84,9 +75,20 @@ void cmInstallProgramsCommand::FinalPass()
|
|||
// for each argument, get the programs
|
||||
for (;s != programs.end(); ++s)
|
||||
{
|
||||
targetSourceLists.push_back(this->FindInstallSource(s->c_str()));
|
||||
this->Files.push_back(this->FindInstallSource(s->c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
// Use a file install generator.
|
||||
const char* no_permissions = "";
|
||||
const char* no_rename = "";
|
||||
const char* no_component = "";
|
||||
std::vector<std::string> no_configurations;
|
||||
this->Makefile->AddInstallGenerator(
|
||||
new cmInstallFilesGenerator(this->Files,
|
||||
this->Destination.c_str(), true,
|
||||
no_permissions, no_configurations,
|
||||
no_component, no_rename));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -101,8 +101,9 @@ public:
|
|||
protected:
|
||||
std::string FindInstallSource(const char* name) const;
|
||||
private:
|
||||
std::string TargetName;
|
||||
std::vector<std::string> FinalArgs;
|
||||
std::string Destination;
|
||||
std::vector<std::string> Files;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -145,10 +145,7 @@ void cmLocalGenerator::TraceDependencies()
|
|||
{
|
||||
// INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
|
||||
// so don't build a projectfile for it
|
||||
if ((t->second.GetType() != cmTarget::INSTALL_FILES)
|
||||
&& (t->second.GetType() != cmTarget::INSTALL_PROGRAMS)
|
||||
&& (t->second.GetType() != cmTarget::INSTALL_DIRECTORY)
|
||||
&& (strncmp(t->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0))
|
||||
if (strncmp(t->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)
|
||||
{
|
||||
std::string projectFilename;
|
||||
if (this->IsMakefileGenerator == false) // only use of this variable
|
||||
|
|
|
@ -141,19 +141,13 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
|
|||
case cmTarget::GLOBAL_TARGET:
|
||||
this->SetBuildType(UTILITY, l->first.c_str(), l->second);
|
||||
break;
|
||||
case cmTarget::INSTALL_FILES:
|
||||
break;
|
||||
case cmTarget::INSTALL_PROGRAMS:
|
||||
break;
|
||||
default:
|
||||
cmSystemTools::Error("Bad target type", l->first.c_str());
|
||||
break;
|
||||
}
|
||||
// INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
|
||||
// so don't build a projectfile for it
|
||||
if ((l->second.GetType() != cmTarget::INSTALL_FILES)
|
||||
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
|
||||
&& (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0))
|
||||
if (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)
|
||||
{
|
||||
// check to see if the dsp is going into a sub-directory
|
||||
std::string::size_type pos = l->first.rfind('/');
|
||||
|
|
|
@ -134,9 +134,7 @@ void cmLocalVisualStudio7Generator::OutputVCProjFile()
|
|||
{
|
||||
// INCLUDE_EXTERNAL_MSPROJECT command only affects the workspace
|
||||
// so don't build a projectfile for it
|
||||
if ((l->second.GetType() != cmTarget::INSTALL_FILES)
|
||||
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS)
|
||||
&& (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0))
|
||||
if (strncmp(l->first.c_str(), "INCLUDE_EXTERNAL_MSPROJECT", 26) != 0)
|
||||
{
|
||||
this->CreateSingleVCProj(l->first.c_str(),l->second);
|
||||
}
|
||||
|
|
|
@ -1317,8 +1317,6 @@ void cmMakefile::AddGlobalLinkInformation(const char* name, cmTarget& target)
|
|||
{
|
||||
case cmTarget::UTILITY:
|
||||
case cmTarget::GLOBAL_TARGET:
|
||||
case cmTarget::INSTALL_FILES:
|
||||
case cmTarget::INSTALL_PROGRAMS:
|
||||
return;
|
||||
default:;
|
||||
}
|
||||
|
|
|
@ -337,6 +337,12 @@ void cmTarget::DefineProperties(cmake *cm)
|
|||
void cmTarget::SetType(TargetType type, const char* name)
|
||||
{
|
||||
this->Name = name;
|
||||
if(type == cmTarget::INSTALL_FILES ||
|
||||
type == cmTarget::INSTALL_PROGRAMS ||
|
||||
type == cmTarget::INSTALL_DIRECTORY)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
// only add dependency information for library targets
|
||||
this->TargetTypeValue = type;
|
||||
if(this->TargetTypeValue >= STATIC_LIBRARY
|
||||
|
@ -664,12 +670,6 @@ void cmTarget::GenerateSourceFilesFromSourceLists( cmMakefile &mf)
|
|||
{
|
||||
return;
|
||||
}
|
||||
// this is only done for non install targets
|
||||
if ((this->TargetTypeValue == cmTarget::INSTALL_FILES)
|
||||
|| (this->TargetTypeValue == cmTarget::INSTALL_PROGRAMS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
// for each src lists add the classes
|
||||
for (std::vector<std::string>::const_iterator s = this->SourceLists.begin();
|
||||
s != this->SourceLists.end(); ++s)
|
||||
|
|
Loading…
Reference in New Issue