Commit 84fdc992 authored by Ben Boeckel's avatar Ben Boeckel Committed by Brad King

stringapi: Pass configuration names as strings

parent f154475b
......@@ -623,7 +623,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
componentsVector.push_back(installComponent);
}
const char* buildConfig = this->GetOption("CPACK_BUILD_CONFIG");
const char* buildConfigCstr = this->GetOption("CPACK_BUILD_CONFIG");
std::string buildConfig = buildConfigCstr ? buildConfigCstr : "";
cmGlobalGenerator* globalGenerator
= this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator(
cmakeGenerator);
......@@ -822,9 +823,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
<< "'" << std::endl);
}
if ( buildConfig && *buildConfig )
if (!buildConfig.empty())
{
mf->AddDefinition("BUILD_TYPE", buildConfig);
mf->AddDefinition("BUILD_TYPE", buildConfig.c_str());
}
std::string installComponentLowerCase
= cmSystemTools::LowerCase(installComponent);
......
......@@ -172,7 +172,7 @@ satisfy dependencies.
//----------------------------------------------------------------------------
cmComputeLinkDepends
::cmComputeLinkDepends(cmTarget const* target, const char* config,
::cmComputeLinkDepends(cmTarget const* target, const std::string& config,
cmTarget const* head)
{
// Store context information.
......@@ -184,7 +184,8 @@ cmComputeLinkDepends
this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
// The configuration being linked.
this->Config = (config && *config)? config : 0;
this->HasConfig = !config.empty();
this->Config = (this->HasConfig)? config : std::string();
this->LinkType = this->Target->ComputeLinkType(this->Config);
// Enable debug mode if requested.
......@@ -255,7 +256,7 @@ cmComputeLinkDepends::Compute()
"---------------------------------------\n");
fprintf(stderr, "Link dependency analysis for target %s, config %s\n",
this->Target->GetName().c_str(),
this->Config?this->Config:"noconfig");
this->HasConfig?this->Config.c_str():"noconfig");
this->DisplayConstraintGraph();
}
......
......@@ -32,7 +32,7 @@ class cmake;
class cmComputeLinkDepends
{
public:
cmComputeLinkDepends(cmTarget const* target, const char* config,
cmComputeLinkDepends(cmTarget const* target, const std::string& config,
cmTarget const* head);
~cmComputeLinkDepends();
......@@ -68,7 +68,8 @@ private:
bool DebugMode;
// Configuration information.
const char* Config;
bool HasConfig;
std::string Config;
cmTarget::LinkLibraryType LinkType;
// Output information.
......
......@@ -239,7 +239,7 @@ because this need be done only for shared libraries without soname-s.
//----------------------------------------------------------------------------
cmComputeLinkInformation
::cmComputeLinkInformation(cmTarget const* target, const char* config,
::cmComputeLinkInformation(cmTarget const* target, const std::string& config,
cmTarget const* headTarget)
{
// Store context information.
......@@ -505,7 +505,8 @@ bool cmComputeLinkInformation::Compute()
}
// Compute the ordered link line items.
cmComputeLinkDepends cld(this->Target, this->Config, this->HeadTarget);
cmComputeLinkDepends cld(this->Target, this->Config.c_str(),
this->HeadTarget);
cld.SetOldLinkDirMode(this->OldLinkDirMode);
cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
......@@ -624,7 +625,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
cmTarget const* tgt)
{
// Compute the proper name to use to link this library.
const char* config = this->Config;
const std::string& config = this->Config;
bool impexe = (tgt && tgt->IsExecutableWithExports());
if(impexe && !this->UseImportLibrary && !this->LoaderFlag)
{
......
......@@ -29,7 +29,7 @@ class cmOrderDirectories;
class cmComputeLinkInformation
{
public:
cmComputeLinkInformation(cmTarget const* target, const char* config,
cmComputeLinkInformation(cmTarget const* target, const std::string& config,
cmTarget const* headTarget);
~cmComputeLinkInformation();
bool Compute();
......@@ -82,7 +82,7 @@ private:
cmake* CMakeInstance;
// Configuration information.
const char* Config;
std::string Config;
std::string LinkLanguage;
bool LinkDependsNoShared;
......
......@@ -214,7 +214,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
std::set<std::string> emitted;
{
std::vector<std::string> tlibs;
depender->GetDirectLinkLibraries(0, tlibs, depender);
depender->GetDirectLinkLibraries("", tlibs, depender);
// A target should not depend on itself.
emitted.insert(depender->GetName());
for(std::vector<std::string>::const_iterator lib = tlibs.begin();
......@@ -274,7 +274,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
//----------------------------------------------------------------------------
void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
cmTarget const* dependee,
const char *config,
const std::string& config,
std::set<std::string> &emitted)
{
cmTarget const* depender = this->Targets[depender_index];
......@@ -317,7 +317,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
if(dependee)
{
this->AddInterfaceDepends(depender_index, dependee, 0, emitted);
this->AddInterfaceDepends(depender_index, dependee, "", emitted);
std::vector<std::string> configs;
depender->GetMakefile()->GetConfigurations(configs);
for (std::vector<std::string>::const_iterator it = configs.begin();
......
......@@ -55,7 +55,7 @@ private:
const std::string& dependee_name,
bool linking, std::set<std::string> &emitted);
void AddInterfaceDepends(int depender_index, cmTarget const* dependee,
const char *config,
const std::string& config,
std::set<std::string> &emitted);
cmGlobalGenerator* GlobalGenerator;
bool DebugMode;
......
......@@ -357,7 +357,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
cmExportTryCompileFileGenerator tcfg;
tcfg.SetExportFile((this->BinaryDirectory + fname).c_str());
tcfg.SetExports(targets);
tcfg.SetConfig(this->Makefile->GetDefinition(
tcfg.SetConfig(this->Makefile->GetSafeDefinition(
"CMAKE_TRY_COMPILE_CONFIGURATION"));
if(!tcfg.GenerateImportFile())
......
......@@ -18,7 +18,7 @@
//----------------------------------------------------------------------------
cmCustomCommandGenerator::cmCustomCommandGenerator(
cmCustomCommand const& cc, const char* config, cmMakefile* mf):
cmCustomCommand const& cc, const std::string& config, cmMakefile* mf):
CC(cc), Config(config), Makefile(mf), LG(mf->GetLocalGenerator()),
OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()),
GE(new cmGeneratorExpression(cc.GetBacktrace()))
......
......@@ -22,14 +22,15 @@ class cmGeneratorExpression;
class cmCustomCommandGenerator
{
cmCustomCommand const& CC;
const char* Config;
std::string Config;
cmMakefile* Makefile;
cmLocalGenerator* LG;
bool OldStyle;
bool MakeVars;
cmGeneratorExpression* GE;
public:
cmCustomCommandGenerator(cmCustomCommand const& cc, const char* config,
cmCustomCommandGenerator(cmCustomCommand const& cc,
const std::string& config,
cmMakefile* mf);
~cmCustomCommandGenerator();
unsigned int GetNumberOfCommands() const;
......
......@@ -118,8 +118,9 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
void
cmExportBuildFileGenerator
::GenerateImportTargetsConfig(std::ostream& os,
const char* config, std::string const& suffix,
std::vector<std::string> &missingTargets)
const std::string& config,
std::string const& suffix,
std::vector<std::string> &missingTargets)
{
for(std::vector<cmTarget*>::const_iterator
tei = this->Exports.begin();
......@@ -166,7 +167,8 @@ void cmExportBuildFileGenerator::SetExportSet(cmExportSet *exportSet)
//----------------------------------------------------------------------------
void
cmExportBuildFileGenerator
::SetImportLocationProperty(const char* config, std::string const& suffix,
::SetImportLocationProperty(const std::string& config,
std::string const& suffix,
cmTarget* target, ImportPropertyMap& properties)
{
// Get the makefile in which to lookup target information.
......
......@@ -52,7 +52,7 @@ protected:
// Implement virtual methods from the superclass.
virtual bool GenerateMainFile(std::ostream& os);
virtual void GenerateImportTargetsConfig(std::ostream& os,
const char* config,
const std::string& config,
std::string const& suffix,
std::vector<std::string> &missingTargets);
virtual void HandleMissingTarget(std::string& link_libs,
......@@ -66,7 +66,7 @@ protected:
int occurrences);
/** Fill in properties indicating built file locations. */
void SetImportLocationProperty(const char* config,
void SetImportLocationProperty(const std::string& config,
std::string const& suffix,
cmTarget* target,
ImportPropertyMap& properties);
......
......@@ -35,7 +35,7 @@ cmExportFileGenerator::cmExportFileGenerator()
}
//----------------------------------------------------------------------------
void cmExportFileGenerator::AddConfiguration(const char* config)
void cmExportFileGenerator::AddConfiguration(const std::string& config)
{
this->Configurations.push_back(config);
}
......@@ -117,12 +117,12 @@ bool cmExportFileGenerator::GenerateImportFile()
//----------------------------------------------------------------------------
void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
const char* config,
const std::string& config,
std::vector<std::string> &missingTargets)
{
// Construct the property configuration suffix.
std::string suffix = "_";
if(config && *config)
if(!config.empty())
{
suffix += cmSystemTools::UpperCase(config);
}
......@@ -345,7 +345,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
true);
this->ReplaceInstallPrefix(dirs);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs);
std::string exportDirs = cge->Evaluate(target->GetMakefile(), 0,
std::string exportDirs = cge->Evaluate(target->GetMakefile(), "",
false, target);
if (cge->GetHadContextSensitiveCondition())
......@@ -426,7 +426,7 @@ void getPropertyContents(cmTarget const* tgt, const std::string& prop,
//----------------------------------------------------------------------------
void getCompatibleInterfaceProperties(cmTarget *target,
std::set<std::string> &ifaceProperties,
const char *config)
const std::string& config)
{
cmComputeLinkInformation *info = target->GetLinkInformation(config);
......@@ -490,7 +490,7 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
{
getCompatibleInterfaceProperties(target, ifaceProperties, 0);
getCompatibleInterfaceProperties(target, ifaceProperties, "");
std::vector<std::string> configNames;
target->GetMakefile()->GetConfigurations(configNames);
......@@ -687,7 +687,7 @@ cmExportFileGenerator::ReplaceInstallPrefix(std::string &)
//----------------------------------------------------------------------------
void
cmExportFileGenerator
::SetImportLinkInterface(const char* config, std::string const& suffix,
::SetImportLinkInterface(const std::string& config, std::string const& suffix,
cmGeneratorExpression::PreprocessContext preprocessRule,
cmTarget* target, ImportPropertyMap& properties,
std::vector<std::string>& missingTargets)
......@@ -762,7 +762,8 @@ cmExportFileGenerator
//----------------------------------------------------------------------------
void
cmExportFileGenerator
::SetImportDetailProperties(const char* config, std::string const& suffix,
::SetImportDetailProperties(const std::string& config,
std::string const& suffix,
cmTarget* target, ImportPropertyMap& properties,
std::vector<std::string>& missingTargets
)
......@@ -864,11 +865,11 @@ cmExportFileGenerator
//----------------------------------------------------------------------------
void cmExportFileGenerator::GenerateImportHeaderCode(std::ostream& os,
const char* config)
const std::string& config)
{
os << "#----------------------------------------------------------------\n"
<< "# Generated CMake target import file";
if(config)
if(!config.empty())
{
os << " for configuration \"" << config << "\".\n";
}
......@@ -999,7 +1000,7 @@ cmExportFileGenerator
//----------------------------------------------------------------------------
void
cmExportFileGenerator
::GenerateImportPropertyCode(std::ostream& os, const char* config,
::GenerateImportPropertyCode(std::ostream& os, const std::string& config,
cmTarget const* target,
ImportPropertyMap const& properties)
{
......@@ -1013,7 +1014,7 @@ cmExportFileGenerator
<< config << "\"\n";
os << "set_property(TARGET " << targetName
<< " APPEND PROPERTY IMPORTED_CONFIGURATIONS ";
if(config && *config)
if(!config.empty())
{
os << cmSystemTools::UpperCase(config);
}
......
......@@ -56,7 +56,7 @@ public:
void SetExportOld(bool exportOld) { this->ExportOld = exportOld; }
/** Add a configuration to be exported. */
void AddConfiguration(const char* config);
void AddConfiguration(const std::string& config);
/** Actually generate the export file. Returns whether there was an
error. */
......@@ -67,15 +67,16 @@ protected:
// Generate per-configuration target information to the given output
// stream.
void GenerateImportConfig(std::ostream& os, const char* config,
void GenerateImportConfig(std::ostream& os, const std::string& config,
std::vector<std::string> &missingTargets);
// Methods to implement export file code generation.
void GenerateImportHeaderCode(std::ostream& os, const char* config = 0);
void GenerateImportHeaderCode(std::ostream& os,
const std::string& config = "");
void GenerateImportFooterCode(std::ostream& os);
void GenerateImportVersionCode(std::ostream& os);
void GenerateImportTargetCode(std::ostream& os, cmTarget const* target);
void GenerateImportPropertyCode(std::ostream& os, const char* config,
void GenerateImportPropertyCode(std::ostream& os, const std::string& config,
cmTarget const* target,
ImportPropertyMap const& properties);
void GenerateImportedFileChecksCode(std::ostream& os, cmTarget* target,
......@@ -90,7 +91,7 @@ protected:
// Collect properties with detailed information about targets beyond
// their location on disk.
void SetImportDetailProperties(const char* config,
void SetImportDetailProperties(const std::string& config,
std::string const& suffix, cmTarget* target,
ImportPropertyMap& properties,
std::vector<std::string>& missingTargets);
......@@ -105,7 +106,7 @@ protected:
/** Each subclass knows where the target files are located. */
virtual void GenerateImportTargetsConfig(std::ostream& os,
const char* config,
const std::string& config,
std::string const& suffix,
std::vector<std::string> &missingTargets) = 0;
......@@ -137,7 +138,8 @@ protected:
ImportPropertyMap &properties,
std::vector<std::string> &missingTargets);
void SetImportLinkInterface(const char* config, std::string const& suffix,
void SetImportLinkInterface(const std::string& config,
std::string const& suffix,
cmGeneratorExpression::PreprocessContext preprocessRule,
cmTarget* target, ImportPropertyMap& properties,
std::vector<std::string>& missingTargets);
......
......@@ -240,7 +240,8 @@ cmExportInstallFileGenerator::ReplaceInstallPrefix(std::string &input)
//----------------------------------------------------------------------------
bool
cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config,
cmExportInstallFileGenerator::GenerateImportFileConfig(
const std::string& config,
std::vector<std::string> &missingTargets)
{
// Skip configurations not enabled for this export.
......@@ -254,7 +255,7 @@ cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config,
fileName += "/";
fileName += this->FileBase;
fileName += "-";
if(config && *config)
if(!config.empty())
{
fileName += cmSystemTools::LowerCase(config);
}
......@@ -296,7 +297,8 @@ cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config,
void
cmExportInstallFileGenerator
::GenerateImportTargetsConfig(std::ostream& os,
const char* config, std::string const& suffix,
const std::string& config,
std::string const& suffix,
std::vector<std::string> &missingTargets)
{
// Add each target in the set to the export.
......@@ -355,7 +357,8 @@ cmExportInstallFileGenerator
//----------------------------------------------------------------------------
void
cmExportInstallFileGenerator
::SetImportLocationProperty(const char* config, std::string const& suffix,
::SetImportLocationProperty(const std::string& config,
std::string const& suffix,
cmInstallTargetGenerator* itgen,
ImportPropertyMap& properties,
std::set<std::string>& importedLocations
......
......@@ -52,7 +52,7 @@ protected:
// Implement virtual methods from the superclass.
virtual bool GenerateMainFile(std::ostream& os);
virtual void GenerateImportTargetsConfig(std::ostream& os,
const char* config,
const std::string& config,
std::string const& suffix,
std::vector<std::string> &missingTargets);
virtual void HandleMissingTarget(std::string& link_libs,
......@@ -72,11 +72,11 @@ protected:
/** Generate a per-configuration file for the targets. */
bool GenerateImportFileConfig(const char* config,
bool GenerateImportFileConfig(const std::string& config,
std::vector<std::string> &missingTargets);
/** Fill in properties indicating installed file locations. */
void SetImportLocationProperty(const char* config,
void SetImportLocationProperty(const std::string& config,
std::string const& suffix,
cmInstallTargetGenerator* itgen,
ImportPropertyMap& properties,
......
......@@ -23,14 +23,14 @@ public:
/** Set the list of targets to export. */
void SetExports(const std::vector<cmTarget const*> &exports)
{ this->Exports = exports; }
void SetConfig(const char *config) { this->Config = config; }
void SetConfig(const std::string& config) { this->Config = config; }
protected:
// Implement virtual methods from the superclass.
virtual bool GenerateMainFile(std::ostream& os);
virtual void GenerateImportTargetsConfig(std::ostream&,
const char*,
const std::string&,
std::string const&,
std::vector<std::string>&) {}
virtual void HandleMissingTarget(std::string&,
......@@ -51,7 +51,7 @@ private:
std::vector<cmTarget const*> Exports;
const char *Config;
std::string Config;
};
#endif
......@@ -375,7 +375,7 @@ cmExtraSublimeTextGenerator::ComputeFlagsForObject(cmSourceFile* source,
{
language = "C";
}
const char* config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
const std::string& config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
// Add language-specific flags.
lg->AddLanguageFlags(flags, language, config);
......@@ -425,7 +425,7 @@ ComputeDefines(cmSourceFile *source, cmLocalGenerator* lg, cmTarget *target,
std::set<std::string> defines;
cmMakefile *makefile = lg->GetMakefile();
const std::string& language = source->GetLanguage();
const char* config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
const std::string& config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
// Add the export symbol definition for shared library objects.
if(const char* exportMacro = target->GetExportMacro())
......
......@@ -52,7 +52,7 @@ cmGeneratorExpression::~cmGeneratorExpression()
//----------------------------------------------------------------------------
const char *cmCompiledGeneratorExpression::Evaluate(
cmMakefile* mf, const char* config, bool quiet,
cmMakefile* mf, const std::string& config, bool quiet,
cmTarget const* headTarget,
cmGeneratorExpressionDAGChecker *dagChecker) const
{
......@@ -66,7 +66,7 @@ const char *cmCompiledGeneratorExpression::Evaluate(
//----------------------------------------------------------------------------
const char *cmCompiledGeneratorExpression::Evaluate(
cmMakefile* mf, const char* config, bool quiet,
cmMakefile* mf, const std::string& config, bool quiet,
cmTarget const* headTarget,
cmTarget const* currentTarget,
cmGeneratorExpressionDAGChecker *dagChecker) const
......
......@@ -78,12 +78,12 @@ private:
class cmCompiledGeneratorExpression
{
public:
const char* Evaluate(cmMakefile* mf, const char* config,
const char* Evaluate(cmMakefile* mf, const std::string& config,
bool quiet = false,
cmTarget const* headTarget = 0,
cmTarget const* currentTarget = 0,
cmGeneratorExpressionDAGChecker *dagChecker = 0) const;
const char* Evaluate(cmMakefile* mf, const char* config,
const char* Evaluate(cmMakefile* mf, const std::string& config,
bool quiet,
cmTarget const* headTarget,
cmGeneratorExpressionDAGChecker *dagChecker) const;
......
......@@ -33,7 +33,7 @@ cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
}
//----------------------------------------------------------------------------
void cmGeneratorExpressionEvaluationFile::Generate(const char *config,
void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
cmCompiledGeneratorExpression* inputExpression,
std::map<std::string, std::string> &outputFiles)
{
......@@ -135,7 +135,7 @@ void cmGeneratorExpressionEvaluationFile::Generate()
if (allConfigs.empty())
{
this->Generate(0, inputExpression.get(), outputFiles);
this->Generate("", inputExpression.get(), outputFiles);
}
else
{
......
......@@ -32,7 +32,7 @@ public:
std::vector<std::string> GetFiles() const { return this->Files; }
private:
void Generate(const char *config,
void Generate(const std::string& config,
cmCompiledGeneratorExpression* inputExpression,
std::map<std::string, std::string> &outputFiles);
......
......@@ -689,7 +689,7 @@ static const struct ConfigurationNode : public cmGeneratorExpressionNode
cmGeneratorExpressionDAGChecker *) const
{
context->HadContextSensitiveCondition = true;
return context->Config ? context->Config : "";
return context->Config;
}
} configurationNode;
......@@ -718,13 +718,13 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
return std::string();
}
context->HadContextSensitiveCondition = true;
if (!context->Config)
if (context->Config.empty())
{
return parameters.front().empty() ? "1" : "0";
}
if (cmsysString_strcasecmp(parameters.begin()->c_str(),
context->Config) == 0)
context->Config.c_str()) == 0)
{
return "1";
}
......
......@@ -27,7 +27,7 @@ struct cmGeneratorExpressionContext
std::set<cmTarget const*> AllTargets;
std::set<std::string> SeenTargetProperties;
cmMakefile *Makefile;
const char *Config;
std::string Config;
cmTarget const* HeadTarget; // The target whose property is being evaluated.
cmTarget const* CurrentTarget; // The dependent of HeadTarget which appears
// directly or indirectly in the property.
......
......@@ -252,7 +252,8 @@ cmGeneratorTarget::GetSourceDepends(cmSourceFile* sf) const
}
static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
const char *config, cmTarget *headTarget,
const std::string& config,
cmTarget *headTarget,
cmGeneratorExpressionDAGChecker *dagChecker,
std::vector<std::string>& result,
bool excludeImported)
......@@ -390,12 +391,12 @@ void cmGeneratorTarget::GetResxSources(std::vector<cmSourceFile*>& srcs) const
}
//----------------------------------------------------------------------------
bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir,
const char *config) const
bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
const std::string& config) const
{
assert(this->GetType() != cmTarget::INTERFACE_LIBRARY);
std::string config_upper;
if(config && *config)
if(!config.empty())
{
config_upper = cmSystemTools::UpperCase(config);
}
......@@ -802,7 +803,7 @@ cmTargetTraceDependencies
{
const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge
= ge.Parse(*cli);
cge->Evaluate(this->Makefile, 0, true);
cge->Evaluate(this->Makefile, "", true);
std::set<cmTarget*> geTargets = cge->GetTargets();
for(std::set<cmTarget*>::const_iterator it = geTargets.begin();
it != geTargets.end(); ++it)
......@@ -863,11 +864,11 @@ void cmGeneratorTarget::TraceDependencies()
}
//----------------------------------------------------------------------------
void cmGeneratorTarget::GetAppleArchs(const char* config,
void cmGeneratorTarget::GetAppleArchs(const std::string& config,
std::vector<std::string>& archVec) const
{
const char* archs = 0;
if(config && *config)
if(!config.empty())
{
std::string defVarName = "OSX_ARCHITECTURES_";
defVarName += cmSystemTools::UpperCase(config);
......@@ -904,13 +905,14 @@ const char* cmGeneratorTarget::GetCreateRuleVariable() const
//----------------------------------------------------------------------------
std::vector<std::string>
cmGeneratorTarget::GetIncludeDirectories(const char *config) const
cmGeneratorTarget::GetIncludeDirectories(const std::string& config) const
{
return this->Target->GetIncludeDirectories(config);
}
//----------------------------------------------------------------------------
void cmGeneratorTarget::GenerateTargetManifest(const char* config) const
void cmGeneratorTarget::GenerateTargetManifest(
const std::string& config) const
{
if (this->Target->IsImported())
{
......@@ -953,35 +955,35 @@ void cmGeneratorTarget::GenerateTargetManifest(const char* config) const
f = dir;
f += "/";
f += name;
gg->AddToManifest(config? config:"", f);
gg->AddToManifest(config, f);
}
if(!soName.empty())
{
f = dir;
f += "/";
f += soName;
gg->AddToManifest(config? config:"", f);
gg->AddToManifest(config, f);
}
if(!realName.empty())
{
f = dir;
f += "/";
f += realName;
gg->AddToManifest(config? config:"", f);
gg->AddToManifest(config, f);
}
if(!pdbName.empty())
{
f = dir;
f += "/";
f += pdbName;
gg->AddToManifest(config? config:"", f);