diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-07-28 17:32:03 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-07-30 06:28:31 (GMT) |
commit | 4e41913f9acb6a33f6a4eb1b88577fb7499e99d6 (patch) | |
tree | 6d92ca296a5f5a6b270747ad326f5413e1af5cf0 /Source | |
parent | e5e529701812bdfe7ea1c3ffe682bd576b9c05a8 (diff) | |
download | CMake-4e41913f9acb6a33f6a4eb1b88577fb7499e99d6.zip CMake-4e41913f9acb6a33f6a4eb1b88577fb7499e99d6.tar.gz CMake-4e41913f9acb6a33f6a4eb1b88577fb7499e99d6.tar.bz2 |
cmInstallCommand: Store only a targetName, not a cmTarget.
Compute the cmTarget at Compute() time.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmInstallCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 12 | ||||
-rw-r--r-- | Source/cmInstallTargetGenerator.h | 6 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 18 |
4 files changed, 28 insertions, 11 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index a33acad..f548f5d 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -27,7 +27,8 @@ static cmInstallTargetGenerator* CreateInstallTargetGenerator(cmTarget& target, { cmInstallGenerator::MessageLevel message = cmInstallGenerator::SelectMessageLevel(target.GetMakefile()); - return new cmInstallTargetGenerator(target, args.GetDestination().c_str(), + return new cmInstallTargetGenerator(target.GetName(), + args.GetDestination().c_str(), impLib, args.GetPermissions().c_str(), args.GetConfigurations(), args.GetComponent().c_str(), message, diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 09af56e..a5d8a74 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -22,13 +22,16 @@ //---------------------------------------------------------------------------- cmInstallTargetGenerator -::cmInstallTargetGenerator(cmTarget& t, const char* dest, bool implib, +::cmInstallTargetGenerator(const std::string& targetName, + const char* dest, bool implib, const char* file_permissions, std::vector<std::string> const& configurations, const char* component, MessageLevel message, bool optional): - cmInstallGenerator(dest, configurations, component, message), Target(&t), + cmInstallGenerator(dest, configurations, component, message), + TargetName(targetName), + Target(0), FilePermissions(file_permissions), ImportLibrary(implib), Optional(optional) @@ -430,6 +433,11 @@ cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target, return fname; } +void cmInstallTargetGenerator::Compute(cmLocalGenerator* lg) +{ + this->Target = lg->GetMakefile()->FindTarget(this->TargetName); +} + //---------------------------------------------------------------------------- void cmInstallTargetGenerator diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h index db69220..128e1a2 100644 --- a/Source/cmInstallTargetGenerator.h +++ b/Source/cmInstallTargetGenerator.h @@ -22,7 +22,7 @@ class cmInstallTargetGenerator: public cmInstallGenerator { public: cmInstallTargetGenerator( - cmTarget& t, const char* dest, bool implib, + std::string const& targetName, const char* dest, bool implib, const char* file_permissions, std::vector<std::string> const& configurations, const char* component, @@ -56,7 +56,10 @@ public: const std::string& config, NameType nameType = NameNormal); + void Compute(cmLocalGenerator* lg); + cmTarget* GetTarget() const { return this->Target; } + bool IsImportLibrary() const { return this->ImportLibrary; } std::string GetDestination(std::string const& config) const; @@ -98,6 +101,7 @@ protected: void AddRanlibRule(std::ostream& os, Indent const& indent, const std::string& toDestDirPath); + std::string TargetName; cmTarget* Target; std::string FilePermissions; NamelinkModeType NamelinkMode; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2e20ee2..6b48a44 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2375,11 +2375,15 @@ cmLocalGenerator::ConstructComment(cmCustomCommandGenerator const& ccg, class cmInstallTargetGeneratorLocal: public cmInstallTargetGenerator { public: - cmInstallTargetGeneratorLocal(cmTarget& t, const char* dest, bool implib): + cmInstallTargetGeneratorLocal(cmLocalGenerator* lg, std::string const& t, + const char* dest, bool implib): cmInstallTargetGenerator( t, dest, implib, "", std::vector<std::string>(), "Unspecified", - cmInstallGenerator::SelectMessageLevel(t.GetMakefile()), - false) {} + cmInstallGenerator::SelectMessageLevel(lg->GetMakefile()), + false) + { + this->Compute(lg); + } }; //---------------------------------------------------------------------------- @@ -2428,7 +2432,7 @@ cmLocalGenerator { // Use a target install generator. cmInstallTargetGeneratorLocal - g(l->second, destination.c_str(), false); + g(this, l->first, destination.c_str(), false); g.Generate(os, config, configurationTypes); } break; @@ -2439,18 +2443,18 @@ cmLocalGenerator // to the normal destination and the DLL to the runtime // destination. cmInstallTargetGeneratorLocal - g1(l->second, destination.c_str(), true); + g1(this, l->first, destination.c_str(), true); g1.Generate(os, config, configurationTypes); // We also skip over the leading slash given by the user. destination = l->second.GetRuntimeInstallPath().substr(1); cmSystemTools::ConvertToUnixSlashes(destination); cmInstallTargetGeneratorLocal - g2(l->second, destination.c_str(), false); + g2(this, l->first, destination.c_str(), false); g2.Generate(os, config, configurationTypes); #else // Use a target install generator. cmInstallTargetGeneratorLocal - g(l->second, destination.c_str(), false); + g(this, l->first, destination.c_str(), false); g.Generate(os, config, configurationTypes); #endif } |