cmInstallTargetGenerator: Drop default constructor arguments

They are used only in cmLocalGenerator::GenerateTargetInstallRules.
Move the defaults to a local helper where the context justifies their
values.
This commit is contained in:
Brad King 2014-06-24 10:55:20 -04:00
parent 67815894ca
commit f0a0196250
2 changed files with 22 additions and 9 deletions

View File

@ -24,11 +24,10 @@ class cmInstallTargetGenerator: public cmInstallGenerator
public: public:
cmInstallTargetGenerator( cmInstallTargetGenerator(
cmTarget& t, const char* dest, bool implib, cmTarget& t, const char* dest, bool implib,
const char* file_permissions = "", const char* file_permissions,
std::vector<std::string> const& configurations std::vector<std::string> const& configurations,
= std::vector<std::string>(), const char* component,
const char* component = "Unspecified", bool optional
bool optional = false
); );
virtual ~cmInstallTargetGenerator(); virtual ~cmInstallTargetGenerator();

View File

@ -2997,6 +2997,16 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
return relative; return relative;
} }
//----------------------------------------------------------------------------
class cmInstallTargetGeneratorLocal: public cmInstallTargetGenerator
{
public:
cmInstallTargetGeneratorLocal(cmTarget& t, const char* dest, bool implib):
cmInstallTargetGenerator(
t, dest, implib, "", std::vector<std::string>(), "Unspecified",
false) {}
};
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmLocalGenerator cmLocalGenerator
@ -3042,7 +3052,8 @@ cmLocalGenerator
case cmTarget::MODULE_LIBRARY: case cmTarget::MODULE_LIBRARY:
{ {
// Use a target install generator. // Use a target install generator.
cmInstallTargetGenerator g(l->second, destination.c_str(), false); cmInstallTargetGeneratorLocal
g(l->second, destination.c_str(), false);
g.Generate(os, config, configurationTypes); g.Generate(os, config, configurationTypes);
} }
break; break;
@ -3052,16 +3063,19 @@ cmLocalGenerator
// Special code to handle DLL. Install the import library // Special code to handle DLL. Install the import library
// to the normal destination and the DLL to the runtime // to the normal destination and the DLL to the runtime
// destination. // destination.
cmInstallTargetGenerator g1(l->second, destination.c_str(), true); cmInstallTargetGeneratorLocal
g1(l->second, destination.c_str(), true);
g1.Generate(os, config, configurationTypes); g1.Generate(os, config, configurationTypes);
// We also skip over the leading slash given by the user. // We also skip over the leading slash given by the user.
destination = l->second.GetRuntimeInstallPath().substr(1); destination = l->second.GetRuntimeInstallPath().substr(1);
cmSystemTools::ConvertToUnixSlashes(destination); cmSystemTools::ConvertToUnixSlashes(destination);
cmInstallTargetGenerator g2(l->second, destination.c_str(), false); cmInstallTargetGeneratorLocal
g2(l->second, destination.c_str(), false);
g2.Generate(os, config, configurationTypes); g2.Generate(os, config, configurationTypes);
#else #else
// Use a target install generator. // Use a target install generator.
cmInstallTargetGenerator g(l->second, destination.c_str(), false); cmInstallTargetGeneratorLocal
g(l->second, destination.c_str(), false);
g.Generate(os, config, configurationTypes); g.Generate(os, config, configurationTypes);
#endif #endif
} }