diff options
author | Brad King <brad.king@kitware.com> | 2007-05-23 15:40:12 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2007-05-23 15:40:12 -0400 |
commit | ba7780a3c494f2c2989e9528366c69dafbdccfec (patch) | |
tree | 38d791d439b11d6b02b9e3c4f20123b2b9734259 /Source/cmInstallFilesCommand.cxx | |
parent | 303b4312b2c28329a2aecde7d7ddd84137efa1ce (diff) | |
download | cmake-ba7780a3c494f2c2989e9528366c69dafbdccfec.tar.gz |
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.
Diffstat (limited to 'Source/cmInstallFilesCommand.cxx')
-rw-r--r-- | Source/cmInstallFilesCommand.cxx | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx index 33c0899c34..e608484c2a 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)); } /** |