diff options
author | Brad King <brad.king@kitware.com> | 2014-02-21 21:45:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-02-21 22:05:26 (GMT) |
commit | f11f7b34a8e77c3bd68578f00b57e0884cb0d872 (patch) | |
tree | a109e5873b03c632fd950e64de8fee59e32a0ad5 /Source | |
parent | e190236c7424fec478b083488eeed88717ed123a (diff) | |
download | CMake-f11f7b34a8e77c3bd68578f00b57e0884cb0d872.zip CMake-f11f7b34a8e77c3bd68578f00b57e0884cb0d872.tar.gz CMake-f11f7b34a8e77c3bd68578f00b57e0884cb0d872.tar.bz2 |
cmInstallFilesGenerator: Add reference to calling cmMakefile
Add a Makefile member to the cmInstallFilesGenerator class and
populate it on construction. This will be useful in a following
change to evaluate generator expressions with proper context.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmInstallCommand.cxx | 16 | ||||
-rw-r--r-- | Source/cmInstallFilesCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmInstallFilesGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmInstallFilesGenerator.h | 7 | ||||
-rw-r--r-- | Source/cmInstallProgramsCommand.cxx | 2 |
5 files changed, 21 insertions, 10 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 6f2dd65..f4fbb8a 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -32,10 +32,12 @@ static cmInstallTargetGenerator* CreateInstallTargetGenerator(cmTarget& target, } static cmInstallFilesGenerator* CreateInstallFilesGenerator( + cmMakefile* mf, const std::vector<std::string>& absFiles, const cmInstallCommandArguments& args, bool programs) { - return new cmInstallFilesGenerator(absFiles, args.GetDestination().c_str(), + return new cmInstallFilesGenerator(mf, + absFiles, args.GetDestination().c_str(), programs, args.GetPermissions().c_str(), args.GetConfigurations(), args.GetComponent().c_str(), args.GetRename().c_str(), args.GetOptional()); @@ -668,7 +670,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) if (!privateHeaderArgs.GetDestination().empty()) { privateHeaderGenerator = - CreateInstallFilesGenerator(absFiles, privateHeaderArgs, false); + CreateInstallFilesGenerator(this->Makefile, absFiles, + privateHeaderArgs, false); } else { @@ -694,7 +697,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) if (!publicHeaderArgs.GetDestination().empty()) { publicHeaderGenerator = - CreateInstallFilesGenerator(absFiles, publicHeaderArgs, false); + CreateInstallFilesGenerator(this->Makefile, absFiles, + publicHeaderArgs, false); } else { @@ -719,8 +723,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args) // Create the files install generator. if (!resourceArgs.GetDestination().empty()) { - resourceGenerator = CreateInstallFilesGenerator(absFiles, - resourceArgs, false); + resourceGenerator = CreateInstallFilesGenerator( + this->Makefile, absFiles, resourceArgs, false); } else { @@ -888,7 +892,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args) // Create the files install generator. this->Makefile->AddInstallGenerator( - CreateInstallFilesGenerator(absFiles, ica, programs)); + CreateInstallFilesGenerator(this->Makefile, absFiles, ica, programs)); //Tell the global generator about any installation component names specified. this->Makefile->GetLocalGenerator()->GetGlobalGenerator() diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx index cc62c4b..32e463b 100644 --- a/Source/cmInstallFilesCommand.cxx +++ b/Source/cmInstallFilesCommand.cxx @@ -133,7 +133,7 @@ void cmInstallFilesCommand::CreateInstallGenerator() const "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"); std::vector<std::string> no_configurations; this->Makefile->AddInstallGenerator( - new cmInstallFilesGenerator(this->Files, + new cmInstallFilesGenerator(this->Makefile, this->Files, destination.c_str(), false, no_permissions, no_configurations, no_component.c_str(), no_rename)); diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index ec02bc7..506dcbf 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx @@ -13,7 +13,8 @@ //---------------------------------------------------------------------------- cmInstallFilesGenerator -::cmInstallFilesGenerator(std::vector<std::string> const& files, +::cmInstallFilesGenerator(cmMakefile* mf, + std::vector<std::string> const& files, const char* dest, bool programs, const char* file_permissions, std::vector<std::string> const& configurations, @@ -21,6 +22,7 @@ cmInstallFilesGenerator const char* rename, bool optional): cmInstallGenerator(dest, configurations, component), + Makefile(mf), Files(files), Programs(programs), FilePermissions(file_permissions), Rename(rename), Optional(optional) diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h index 871335c..02b005e 100644 --- a/Source/cmInstallFilesGenerator.h +++ b/Source/cmInstallFilesGenerator.h @@ -14,13 +14,16 @@ #include "cmInstallGenerator.h" +class cmMakefile; + /** \class cmInstallFilesGenerator * \brief Generate file installation rules. */ class cmInstallFilesGenerator: public cmInstallGenerator { public: - cmInstallFilesGenerator(std::vector<std::string> const& files, + cmInstallFilesGenerator(cmMakefile* mf, + std::vector<std::string> const& files, const char* dest, bool programs, const char* file_permissions, std::vector<std::string> const& configurations, @@ -31,6 +34,8 @@ public: protected: virtual void GenerateScriptActions(std::ostream& os, Indent const& indent); + + cmMakefile* Makefile; std::vector<std::string> Files; bool Programs; std::string FilePermissions; diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index 3a0a322..9f2945f 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/Source/cmInstallProgramsCommand.cxx @@ -94,7 +94,7 @@ void cmInstallProgramsCommand::FinalPass() "CMAKE_INSTALL_DEFAULT_COMPONENT_NAME"); std::vector<std::string> no_configurations; this->Makefile->AddInstallGenerator( - new cmInstallFilesGenerator(this->Files, + new cmInstallFilesGenerator(this->Makefile, this->Files, destination.c_str(), true, no_permissions, no_configurations, no_component.c_str(), no_rename)); |