cmTarget: Refactor ComputePDBOutputDir interface

Add a runtime parameter to specify the property name prefix.
Update the call site to pass "PDB" to preserve the existing
name for that call path.
This commit is contained in:
Brad King 2014-02-24 14:09:05 -05:00
parent aae5184c16
commit 718a9532c6
2 changed files with 7 additions and 6 deletions

View File

@ -2467,7 +2467,7 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config) const
OutputInfo info;
this->ComputeOutputDir(config, false, info.OutDir);
this->ComputeOutputDir(config, true, info.ImpDir);
if(!this->ComputePDBOutputDir(config, info.PdbDir))
if(!this->ComputePDBOutputDir("PDB", config, info.PdbDir))
{
info.PdbDir = info.OutDir;
}
@ -4111,13 +4111,13 @@ bool cmTarget::ComputeOutputDir(const char* config,
}
//----------------------------------------------------------------------------
bool cmTarget::ComputePDBOutputDir(const char* config, std::string& out) const
bool cmTarget::ComputePDBOutputDir(const char* kind, const char* config,
std::string& out) const
{
// Look for a target property defining the target output directory
// based on the target type.
std::string targetTypeName = "PDB";
const char* propertyName = 0;
std::string propertyNameStr = targetTypeName;
std::string propertyNameStr = kind;
if(!propertyNameStr.empty())
{
propertyNameStr += "_OUTPUT_DIRECTORY";
@ -4127,7 +4127,7 @@ bool cmTarget::ComputePDBOutputDir(const char* config, std::string& out) const
// Check for a per-configuration output directory target property.
std::string configUpper = cmSystemTools::UpperCase(config? config : "");
const char* configProp = 0;
std::string configPropStr = targetTypeName;
std::string configPropStr = kind;
if(!configPropStr.empty())
{
configPropStr += "_OUTPUT_DIRECTORY_";

View File

@ -710,7 +710,8 @@ private:
OutputInfo const* GetOutputInfo(const char* config) const;
bool
ComputeOutputDir(const char* config, bool implib, std::string& out) const;
bool ComputePDBOutputDir(const char* config, std::string& out) const;
bool ComputePDBOutputDir(const char* kind, const char* config,
std::string& out) const;
// Cache import information from properties for each configuration.
struct ImportInfo;