summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmExportLibraryDependencies.cxx34
-rw-r--r--Source/cmGlobalVisualStudio6Generator.cxx4
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx7
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx10
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx10
-rw-r--r--Source/cmInstallFilesCommand.cxx31
-rw-r--r--Source/cmInstallFilesCommand.h3
-rw-r--r--Source/cmInstallProgramsCommand.cxx26
-rw-r--r--Source/cmInstallProgramsCommand.h3
-rw-r--r--Source/cmLocalGenerator.cxx5
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx8
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx4
-rw-r--r--Source/cmMakefile.cxx2
-rw-r--r--Source/cmTarget.cxx12
14 files changed, 64 insertions, 95 deletions
diff --git a/Source/cmExportLibraryDependencies.cxx b/Source/cmExportLibraryDependencies.cxx
index a5d66e7..bf9d533 100644
--- a/Source/cmExportLibraryDependencies.cxx
+++ b/Source/cmExportLibraryDependencies.cxx
@@ -94,28 +94,24 @@ 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());
+ if(def)
{
- libDepName = l->first;
- libDepName += "_LIB_DEPENDS";
- const char* def = this->Makefile->GetDefinition(libDepName.c_str());
- if(def)
+ fout << "SET(" << libDepName << " \"" << def << "\")\n";
+ // now for each dependency, check for link type
+ cmSystemTools::ExpandListArgument(def, depends);
+ for(std::vector<std::string>::const_iterator d = depends.begin();
+ d != depends.end(); ++d)
{
- fout << "SET(" << libDepName << " \"" << def << "\")\n";
- // now for each dependency, check for link type
- cmSystemTools::ExpandListArgument(def, depends);
- for(std::vector<std::string>::const_iterator d = depends.begin();
- d != depends.end(); ++d)
+ libDepName = *d;
+ libDepName += "_LINK_TYPE";
+ defType = this->Makefile->GetDefinition(libDepName.c_str());
+ libDepName = cmSystemTools::EscapeSpaces(libDepName.c_str());
+ if(defType)
{
- libDepName = *d;
- libDepName += "_LINK_TYPE";
- defType = this->Makefile->GetDefinition(libDepName.c_str());
- libDepName = cmSystemTools::EscapeSpaces(libDepName.c_str());
- if(defType)
- {
- fout << "SET(" << libDepName << " \"" << defType << "\")\n";
- }
+ fout << "SET(" << libDepName << " \"" << defType << "\")\n";
}
}
}
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index 13758c5..2ed4f40 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -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" )
@@ -332,7 +329,6 @@ void cmGlobalVisualStudio6Generator
this->WriteProject(fout, si->c_str(), dir.c_str(),l->second);
}
++si;
- }
}
}
}
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index fe67f01..fe39318 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -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" )
{
@@ -224,7 +221,6 @@ void cmGlobalVisualStudio71Generator
this->WriteProject(fout, dspname, dir.c_str(),l->second);
}
}
- }
}
}
}
@@ -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(),
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index a4d2258..8ccdb84 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -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" )
{
@@ -420,7 +417,6 @@ void cmGlobalVisualStudio7Generator
this->WriteProject(fout, dspname, dir.c_str(),l->second);
}
}
- }
}
}
}
@@ -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(),
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 6662236..ee09b21 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -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())
{
diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx
index 33c0899..e608484 100644
--- a/Source/cmInstallFilesCommand.cxx
+++ b/Source/cmInstallFilesCommand.cxx
@@ -16,6 +16,8 @@
=========================================================================*/
#include "cmInstallFilesCommand.h"
+#include "cmInstallFilesGenerator.h"
+
// cmExecutableCommand
bool cmInstallFilesCommand
::InitialPass(std::vector<std::string> const& argsIn)
@@ -33,14 +35,8 @@ 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"))
{
this->IsFilesForm = true;
@@ -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));
}
/**
diff --git a/Source/cmInstallFilesCommand.h b/Source/cmInstallFilesCommand.h
index ec1ad9d..5d7501d 100644
--- a/Source/cmInstallFilesCommand.h
+++ b/Source/cmInstallFilesCommand.h
@@ -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;
};
diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx
index 0b320a4..bd137dd 100644
--- a/Source/cmInstallProgramsCommand.cxx
+++ b/Source/cmInstallProgramsCommand.cxx
@@ -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));
}
/**
diff --git a/Source/cmInstallProgramsCommand.h b/Source/cmInstallProgramsCommand.h
index 3fe2bf3..6b085f5 100644
--- a/Source/cmInstallProgramsCommand.h
+++ b/Source/cmInstallProgramsCommand.h
@@ -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;
};
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 052663a..874779c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -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
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index b877cb9..41f00a6 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -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('/');
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index ec38421..f3b594d 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -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);
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 064e153..001f13d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -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:;
}
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index da33e07..6d9b419 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -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)