stringapi: Pass configuration names as strings

This commit is contained in:
Ben Boeckel 2014-02-09 22:48:34 -05:00 committed by Brad King
parent f154475b65
commit 84fdc9921c
74 changed files with 539 additions and 485 deletions

View File

@ -623,7 +623,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
componentsVector.push_back(installComponent); 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 cmGlobalGenerator* globalGenerator
= this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator( = this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator(
cmakeGenerator); cmakeGenerator);
@ -822,9 +823,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
<< "'" << std::endl); << "'" << std::endl);
} }
if ( buildConfig && *buildConfig ) if (!buildConfig.empty())
{ {
mf->AddDefinition("BUILD_TYPE", buildConfig); mf->AddDefinition("BUILD_TYPE", buildConfig.c_str());
} }
std::string installComponentLowerCase std::string installComponentLowerCase
= cmSystemTools::LowerCase(installComponent); = cmSystemTools::LowerCase(installComponent);

View File

@ -172,7 +172,7 @@ satisfy dependencies.
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmComputeLinkDepends cmComputeLinkDepends
::cmComputeLinkDepends(cmTarget const* target, const char* config, ::cmComputeLinkDepends(cmTarget const* target, const std::string& config,
cmTarget const* head) cmTarget const* head)
{ {
// Store context information. // Store context information.
@ -184,7 +184,8 @@ cmComputeLinkDepends
this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance(); this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
// The configuration being linked. // 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); this->LinkType = this->Target->ComputeLinkType(this->Config);
// Enable debug mode if requested. // Enable debug mode if requested.
@ -255,7 +256,7 @@ cmComputeLinkDepends::Compute()
"---------------------------------------\n"); "---------------------------------------\n");
fprintf(stderr, "Link dependency analysis for target %s, config %s\n", fprintf(stderr, "Link dependency analysis for target %s, config %s\n",
this->Target->GetName().c_str(), this->Target->GetName().c_str(),
this->Config?this->Config:"noconfig"); this->HasConfig?this->Config.c_str():"noconfig");
this->DisplayConstraintGraph(); this->DisplayConstraintGraph();
} }

View File

@ -32,7 +32,7 @@ class cmake;
class cmComputeLinkDepends class cmComputeLinkDepends
{ {
public: public:
cmComputeLinkDepends(cmTarget const* target, const char* config, cmComputeLinkDepends(cmTarget const* target, const std::string& config,
cmTarget const* head); cmTarget const* head);
~cmComputeLinkDepends(); ~cmComputeLinkDepends();
@ -68,7 +68,8 @@ private:
bool DebugMode; bool DebugMode;
// Configuration information. // Configuration information.
const char* Config; bool HasConfig;
std::string Config;
cmTarget::LinkLibraryType LinkType; cmTarget::LinkLibraryType LinkType;
// Output information. // Output information.

View File

@ -239,7 +239,7 @@ because this need be done only for shared libraries without soname-s.
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmComputeLinkInformation cmComputeLinkInformation
::cmComputeLinkInformation(cmTarget const* target, const char* config, ::cmComputeLinkInformation(cmTarget const* target, const std::string& config,
cmTarget const* headTarget) cmTarget const* headTarget)
{ {
// Store context information. // Store context information.
@ -505,7 +505,8 @@ bool cmComputeLinkInformation::Compute()
} }
// Compute the ordered link line items. // 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); cld.SetOldLinkDirMode(this->OldLinkDirMode);
cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute(); cmComputeLinkDepends::EntryVector const& linkEntries = cld.Compute();
@ -624,7 +625,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item,
cmTarget const* tgt) cmTarget const* tgt)
{ {
// Compute the proper name to use to link this library. // 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()); bool impexe = (tgt && tgt->IsExecutableWithExports());
if(impexe && !this->UseImportLibrary && !this->LoaderFlag) if(impexe && !this->UseImportLibrary && !this->LoaderFlag)
{ {

View File

@ -29,7 +29,7 @@ class cmOrderDirectories;
class cmComputeLinkInformation class cmComputeLinkInformation
{ {
public: public:
cmComputeLinkInformation(cmTarget const* target, const char* config, cmComputeLinkInformation(cmTarget const* target, const std::string& config,
cmTarget const* headTarget); cmTarget const* headTarget);
~cmComputeLinkInformation(); ~cmComputeLinkInformation();
bool Compute(); bool Compute();
@ -82,7 +82,7 @@ private:
cmake* CMakeInstance; cmake* CMakeInstance;
// Configuration information. // Configuration information.
const char* Config; std::string Config;
std::string LinkLanguage; std::string LinkLanguage;
bool LinkDependsNoShared; bool LinkDependsNoShared;

View File

@ -214,7 +214,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
std::set<std::string> emitted; std::set<std::string> emitted;
{ {
std::vector<std::string> tlibs; std::vector<std::string> tlibs;
depender->GetDirectLinkLibraries(0, tlibs, depender); depender->GetDirectLinkLibraries("", tlibs, depender);
// A target should not depend on itself. // A target should not depend on itself.
emitted.insert(depender->GetName()); emitted.insert(depender->GetName());
for(std::vector<std::string>::const_iterator lib = tlibs.begin(); 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, void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
cmTarget const* dependee, cmTarget const* dependee,
const char *config, const std::string& config,
std::set<std::string> &emitted) std::set<std::string> &emitted)
{ {
cmTarget const* depender = this->Targets[depender_index]; cmTarget const* depender = this->Targets[depender_index];
@ -317,7 +317,7 @@ void cmComputeTargetDepends::AddInterfaceDepends(int depender_index,
if(dependee) if(dependee)
{ {
this->AddInterfaceDepends(depender_index, dependee, 0, emitted); this->AddInterfaceDepends(depender_index, dependee, "", emitted);
std::vector<std::string> configs; std::vector<std::string> configs;
depender->GetMakefile()->GetConfigurations(configs); depender->GetMakefile()->GetConfigurations(configs);
for (std::vector<std::string>::const_iterator it = configs.begin(); for (std::vector<std::string>::const_iterator it = configs.begin();

View File

@ -55,7 +55,7 @@ private:
const std::string& dependee_name, const std::string& dependee_name,
bool linking, std::set<std::string> &emitted); bool linking, std::set<std::string> &emitted);
void AddInterfaceDepends(int depender_index, cmTarget const* dependee, void AddInterfaceDepends(int depender_index, cmTarget const* dependee,
const char *config, const std::string& config,
std::set<std::string> &emitted); std::set<std::string> &emitted);
cmGlobalGenerator* GlobalGenerator; cmGlobalGenerator* GlobalGenerator;
bool DebugMode; bool DebugMode;

View File

@ -357,7 +357,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
cmExportTryCompileFileGenerator tcfg; cmExportTryCompileFileGenerator tcfg;
tcfg.SetExportFile((this->BinaryDirectory + fname).c_str()); tcfg.SetExportFile((this->BinaryDirectory + fname).c_str());
tcfg.SetExports(targets); tcfg.SetExports(targets);
tcfg.SetConfig(this->Makefile->GetDefinition( tcfg.SetConfig(this->Makefile->GetSafeDefinition(
"CMAKE_TRY_COMPILE_CONFIGURATION")); "CMAKE_TRY_COMPILE_CONFIGURATION"));
if(!tcfg.GenerateImportFile()) if(!tcfg.GenerateImportFile())

View File

@ -18,7 +18,7 @@
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmCustomCommandGenerator::cmCustomCommandGenerator( 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()), CC(cc), Config(config), Makefile(mf), LG(mf->GetLocalGenerator()),
OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()), OldStyle(cc.GetEscapeOldStyle()), MakeVars(cc.GetEscapeAllowMakeVars()),
GE(new cmGeneratorExpression(cc.GetBacktrace())) GE(new cmGeneratorExpression(cc.GetBacktrace()))

View File

@ -22,14 +22,15 @@ class cmGeneratorExpression;
class cmCustomCommandGenerator class cmCustomCommandGenerator
{ {
cmCustomCommand const& CC; cmCustomCommand const& CC;
const char* Config; std::string Config;
cmMakefile* Makefile; cmMakefile* Makefile;
cmLocalGenerator* LG; cmLocalGenerator* LG;
bool OldStyle; bool OldStyle;
bool MakeVars; bool MakeVars;
cmGeneratorExpression* GE; cmGeneratorExpression* GE;
public: public:
cmCustomCommandGenerator(cmCustomCommand const& cc, const char* config, cmCustomCommandGenerator(cmCustomCommand const& cc,
const std::string& config,
cmMakefile* mf); cmMakefile* mf);
~cmCustomCommandGenerator(); ~cmCustomCommandGenerator();
unsigned int GetNumberOfCommands() const; unsigned int GetNumberOfCommands() const;

View File

@ -118,7 +118,8 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
void void
cmExportBuildFileGenerator cmExportBuildFileGenerator
::GenerateImportTargetsConfig(std::ostream& os, ::GenerateImportTargetsConfig(std::ostream& os,
const char* config, std::string const& suffix, const std::string& config,
std::string const& suffix,
std::vector<std::string> &missingTargets) std::vector<std::string> &missingTargets)
{ {
for(std::vector<cmTarget*>::const_iterator for(std::vector<cmTarget*>::const_iterator
@ -166,7 +167,8 @@ void cmExportBuildFileGenerator::SetExportSet(cmExportSet *exportSet)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmExportBuildFileGenerator cmExportBuildFileGenerator
::SetImportLocationProperty(const char* config, std::string const& suffix, ::SetImportLocationProperty(const std::string& config,
std::string const& suffix,
cmTarget* target, ImportPropertyMap& properties) cmTarget* target, ImportPropertyMap& properties)
{ {
// Get the makefile in which to lookup target information. // Get the makefile in which to lookup target information.

View File

@ -52,7 +52,7 @@ protected:
// Implement virtual methods from the superclass. // Implement virtual methods from the superclass.
virtual bool GenerateMainFile(std::ostream& os); virtual bool GenerateMainFile(std::ostream& os);
virtual void GenerateImportTargetsConfig(std::ostream& os, virtual void GenerateImportTargetsConfig(std::ostream& os,
const char* config, const std::string& config,
std::string const& suffix, std::string const& suffix,
std::vector<std::string> &missingTargets); std::vector<std::string> &missingTargets);
virtual void HandleMissingTarget(std::string& link_libs, virtual void HandleMissingTarget(std::string& link_libs,
@ -66,7 +66,7 @@ protected:
int occurrences); int occurrences);
/** Fill in properties indicating built file locations. */ /** Fill in properties indicating built file locations. */
void SetImportLocationProperty(const char* config, void SetImportLocationProperty(const std::string& config,
std::string const& suffix, std::string const& suffix,
cmTarget* target, cmTarget* target,
ImportPropertyMap& properties); ImportPropertyMap& properties);

View File

@ -35,7 +35,7 @@ cmExportFileGenerator::cmExportFileGenerator()
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmExportFileGenerator::AddConfiguration(const char* config) void cmExportFileGenerator::AddConfiguration(const std::string& config)
{ {
this->Configurations.push_back(config); this->Configurations.push_back(config);
} }
@ -117,12 +117,12 @@ bool cmExportFileGenerator::GenerateImportFile()
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmExportFileGenerator::GenerateImportConfig(std::ostream& os, void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
const char* config, const std::string& config,
std::vector<std::string> &missingTargets) std::vector<std::string> &missingTargets)
{ {
// Construct the property configuration suffix. // Construct the property configuration suffix.
std::string suffix = "_"; std::string suffix = "_";
if(config && *config) if(!config.empty())
{ {
suffix += cmSystemTools::UpperCase(config); suffix += cmSystemTools::UpperCase(config);
} }
@ -345,7 +345,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
true); true);
this->ReplaceInstallPrefix(dirs); this->ReplaceInstallPrefix(dirs);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(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); false, target);
if (cge->GetHadContextSensitiveCondition()) if (cge->GetHadContextSensitiveCondition())
@ -426,7 +426,7 @@ void getPropertyContents(cmTarget const* tgt, const std::string& prop,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void getCompatibleInterfaceProperties(cmTarget *target, void getCompatibleInterfaceProperties(cmTarget *target,
std::set<std::string> &ifaceProperties, std::set<std::string> &ifaceProperties,
const char *config) const std::string& config)
{ {
cmComputeLinkInformation *info = target->GetLinkInformation(config); cmComputeLinkInformation *info = target->GetLinkInformation(config);
@ -490,7 +490,7 @@ void cmExportFileGenerator::PopulateCompatibleInterfaceProperties(
if (target->GetType() != cmTarget::INTERFACE_LIBRARY) if (target->GetType() != cmTarget::INTERFACE_LIBRARY)
{ {
getCompatibleInterfaceProperties(target, ifaceProperties, 0); getCompatibleInterfaceProperties(target, ifaceProperties, "");
std::vector<std::string> configNames; std::vector<std::string> configNames;
target->GetMakefile()->GetConfigurations(configNames); target->GetMakefile()->GetConfigurations(configNames);
@ -687,7 +687,7 @@ cmExportFileGenerator::ReplaceInstallPrefix(std::string &)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmExportFileGenerator cmExportFileGenerator
::SetImportLinkInterface(const char* config, std::string const& suffix, ::SetImportLinkInterface(const std::string& config, std::string const& suffix,
cmGeneratorExpression::PreprocessContext preprocessRule, cmGeneratorExpression::PreprocessContext preprocessRule,
cmTarget* target, ImportPropertyMap& properties, cmTarget* target, ImportPropertyMap& properties,
std::vector<std::string>& missingTargets) std::vector<std::string>& missingTargets)
@ -762,7 +762,8 @@ cmExportFileGenerator
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmExportFileGenerator cmExportFileGenerator
::SetImportDetailProperties(const char* config, std::string const& suffix, ::SetImportDetailProperties(const std::string& config,
std::string const& suffix,
cmTarget* target, ImportPropertyMap& properties, cmTarget* target, ImportPropertyMap& properties,
std::vector<std::string>& missingTargets std::vector<std::string>& missingTargets
) )
@ -864,11 +865,11 @@ cmExportFileGenerator
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmExportFileGenerator::GenerateImportHeaderCode(std::ostream& os, void cmExportFileGenerator::GenerateImportHeaderCode(std::ostream& os,
const char* config) const std::string& config)
{ {
os << "#----------------------------------------------------------------\n" os << "#----------------------------------------------------------------\n"
<< "# Generated CMake target import file"; << "# Generated CMake target import file";
if(config) if(!config.empty())
{ {
os << " for configuration \"" << config << "\".\n"; os << " for configuration \"" << config << "\".\n";
} }
@ -999,7 +1000,7 @@ cmExportFileGenerator
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmExportFileGenerator cmExportFileGenerator
::GenerateImportPropertyCode(std::ostream& os, const char* config, ::GenerateImportPropertyCode(std::ostream& os, const std::string& config,
cmTarget const* target, cmTarget const* target,
ImportPropertyMap const& properties) ImportPropertyMap const& properties)
{ {
@ -1013,7 +1014,7 @@ cmExportFileGenerator
<< config << "\"\n"; << config << "\"\n";
os << "set_property(TARGET " << targetName os << "set_property(TARGET " << targetName
<< " APPEND PROPERTY IMPORTED_CONFIGURATIONS "; << " APPEND PROPERTY IMPORTED_CONFIGURATIONS ";
if(config && *config) if(!config.empty())
{ {
os << cmSystemTools::UpperCase(config); os << cmSystemTools::UpperCase(config);
} }

View File

@ -56,7 +56,7 @@ public:
void SetExportOld(bool exportOld) { this->ExportOld = exportOld; } void SetExportOld(bool exportOld) { this->ExportOld = exportOld; }
/** Add a configuration to be exported. */ /** 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 /** Actually generate the export file. Returns whether there was an
error. */ error. */
@ -67,15 +67,16 @@ protected:
// Generate per-configuration target information to the given output // Generate per-configuration target information to the given output
// stream. // stream.
void GenerateImportConfig(std::ostream& os, const char* config, void GenerateImportConfig(std::ostream& os, const std::string& config,
std::vector<std::string> &missingTargets); std::vector<std::string> &missingTargets);
// Methods to implement export file code generation. // 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 GenerateImportFooterCode(std::ostream& os);
void GenerateImportVersionCode(std::ostream& os); void GenerateImportVersionCode(std::ostream& os);
void GenerateImportTargetCode(std::ostream& os, cmTarget const* target); 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, cmTarget const* target,
ImportPropertyMap const& properties); ImportPropertyMap const& properties);
void GenerateImportedFileChecksCode(std::ostream& os, cmTarget* target, void GenerateImportedFileChecksCode(std::ostream& os, cmTarget* target,
@ -90,7 +91,7 @@ protected:
// Collect properties with detailed information about targets beyond // Collect properties with detailed information about targets beyond
// their location on disk. // their location on disk.
void SetImportDetailProperties(const char* config, void SetImportDetailProperties(const std::string& config,
std::string const& suffix, cmTarget* target, std::string const& suffix, cmTarget* target,
ImportPropertyMap& properties, ImportPropertyMap& properties,
std::vector<std::string>& missingTargets); std::vector<std::string>& missingTargets);
@ -105,7 +106,7 @@ protected:
/** Each subclass knows where the target files are located. */ /** Each subclass knows where the target files are located. */
virtual void GenerateImportTargetsConfig(std::ostream& os, virtual void GenerateImportTargetsConfig(std::ostream& os,
const char* config, const std::string& config,
std::string const& suffix, std::string const& suffix,
std::vector<std::string> &missingTargets) = 0; std::vector<std::string> &missingTargets) = 0;
@ -137,7 +138,8 @@ protected:
ImportPropertyMap &properties, ImportPropertyMap &properties,
std::vector<std::string> &missingTargets); 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, cmGeneratorExpression::PreprocessContext preprocessRule,
cmTarget* target, ImportPropertyMap& properties, cmTarget* target, ImportPropertyMap& properties,
std::vector<std::string>& missingTargets); std::vector<std::string>& missingTargets);

View File

@ -240,7 +240,8 @@ cmExportInstallFileGenerator::ReplaceInstallPrefix(std::string &input)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool bool
cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config, cmExportInstallFileGenerator::GenerateImportFileConfig(
const std::string& config,
std::vector<std::string> &missingTargets) std::vector<std::string> &missingTargets)
{ {
// Skip configurations not enabled for this export. // Skip configurations not enabled for this export.
@ -254,7 +255,7 @@ cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config,
fileName += "/"; fileName += "/";
fileName += this->FileBase; fileName += this->FileBase;
fileName += "-"; fileName += "-";
if(config && *config) if(!config.empty())
{ {
fileName += cmSystemTools::LowerCase(config); fileName += cmSystemTools::LowerCase(config);
} }
@ -296,7 +297,8 @@ cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config,
void void
cmExportInstallFileGenerator cmExportInstallFileGenerator
::GenerateImportTargetsConfig(std::ostream& os, ::GenerateImportTargetsConfig(std::ostream& os,
const char* config, std::string const& suffix, const std::string& config,
std::string const& suffix,
std::vector<std::string> &missingTargets) std::vector<std::string> &missingTargets)
{ {
// Add each target in the set to the export. // Add each target in the set to the export.
@ -355,7 +357,8 @@ cmExportInstallFileGenerator
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmExportInstallFileGenerator cmExportInstallFileGenerator
::SetImportLocationProperty(const char* config, std::string const& suffix, ::SetImportLocationProperty(const std::string& config,
std::string const& suffix,
cmInstallTargetGenerator* itgen, cmInstallTargetGenerator* itgen,
ImportPropertyMap& properties, ImportPropertyMap& properties,
std::set<std::string>& importedLocations std::set<std::string>& importedLocations

View File

@ -52,7 +52,7 @@ protected:
// Implement virtual methods from the superclass. // Implement virtual methods from the superclass.
virtual bool GenerateMainFile(std::ostream& os); virtual bool GenerateMainFile(std::ostream& os);
virtual void GenerateImportTargetsConfig(std::ostream& os, virtual void GenerateImportTargetsConfig(std::ostream& os,
const char* config, const std::string& config,
std::string const& suffix, std::string const& suffix,
std::vector<std::string> &missingTargets); std::vector<std::string> &missingTargets);
virtual void HandleMissingTarget(std::string& link_libs, virtual void HandleMissingTarget(std::string& link_libs,
@ -72,11 +72,11 @@ protected:
/** Generate a per-configuration file for the targets. */ /** Generate a per-configuration file for the targets. */
bool GenerateImportFileConfig(const char* config, bool GenerateImportFileConfig(const std::string& config,
std::vector<std::string> &missingTargets); std::vector<std::string> &missingTargets);
/** Fill in properties indicating installed file locations. */ /** Fill in properties indicating installed file locations. */
void SetImportLocationProperty(const char* config, void SetImportLocationProperty(const std::string& config,
std::string const& suffix, std::string const& suffix,
cmInstallTargetGenerator* itgen, cmInstallTargetGenerator* itgen,
ImportPropertyMap& properties, ImportPropertyMap& properties,

View File

@ -23,14 +23,14 @@ public:
/** Set the list of targets to export. */ /** Set the list of targets to export. */
void SetExports(const std::vector<cmTarget const*> &exports) void SetExports(const std::vector<cmTarget const*> &exports)
{ this->Exports = exports; } { this->Exports = exports; }
void SetConfig(const char *config) { this->Config = config; } void SetConfig(const std::string& config) { this->Config = config; }
protected: protected:
// Implement virtual methods from the superclass. // Implement virtual methods from the superclass.
virtual bool GenerateMainFile(std::ostream& os); virtual bool GenerateMainFile(std::ostream& os);
virtual void GenerateImportTargetsConfig(std::ostream&, virtual void GenerateImportTargetsConfig(std::ostream&,
const char*, const std::string&,
std::string const&, std::string const&,
std::vector<std::string>&) {} std::vector<std::string>&) {}
virtual void HandleMissingTarget(std::string&, virtual void HandleMissingTarget(std::string&,
@ -51,7 +51,7 @@ private:
std::vector<cmTarget const*> Exports; std::vector<cmTarget const*> Exports;
const char *Config; std::string Config;
}; };
#endif #endif

View File

@ -375,7 +375,7 @@ cmExtraSublimeTextGenerator::ComputeFlagsForObject(cmSourceFile* source,
{ {
language = "C"; language = "C";
} }
const char* config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); const std::string& config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
// Add language-specific flags. // Add language-specific flags.
lg->AddLanguageFlags(flags, language, config); lg->AddLanguageFlags(flags, language, config);
@ -425,7 +425,7 @@ ComputeDefines(cmSourceFile *source, cmLocalGenerator* lg, cmTarget *target,
std::set<std::string> defines; std::set<std::string> defines;
cmMakefile *makefile = lg->GetMakefile(); cmMakefile *makefile = lg->GetMakefile();
const std::string& language = source->GetLanguage(); 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. // Add the export symbol definition for shared library objects.
if(const char* exportMacro = target->GetExportMacro()) if(const char* exportMacro = target->GetExportMacro())

View File

@ -52,7 +52,7 @@ cmGeneratorExpression::~cmGeneratorExpression()
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
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* headTarget,
cmGeneratorExpressionDAGChecker *dagChecker) const cmGeneratorExpressionDAGChecker *dagChecker) const
{ {
@ -66,7 +66,7 @@ const char *cmCompiledGeneratorExpression::Evaluate(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
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* headTarget,
cmTarget const* currentTarget, cmTarget const* currentTarget,
cmGeneratorExpressionDAGChecker *dagChecker) const cmGeneratorExpressionDAGChecker *dagChecker) const

View File

@ -78,12 +78,12 @@ private:
class cmCompiledGeneratorExpression class cmCompiledGeneratorExpression
{ {
public: public:
const char* Evaluate(cmMakefile* mf, const char* config, const char* Evaluate(cmMakefile* mf, const std::string& config,
bool quiet = false, bool quiet = false,
cmTarget const* headTarget = 0, cmTarget const* headTarget = 0,
cmTarget const* currentTarget = 0, cmTarget const* currentTarget = 0,
cmGeneratorExpressionDAGChecker *dagChecker = 0) const; cmGeneratorExpressionDAGChecker *dagChecker = 0) const;
const char* Evaluate(cmMakefile* mf, const char* config, const char* Evaluate(cmMakefile* mf, const std::string& config,
bool quiet, bool quiet,
cmTarget const* headTarget, cmTarget const* headTarget,
cmGeneratorExpressionDAGChecker *dagChecker) const; cmGeneratorExpressionDAGChecker *dagChecker) const;

View File

@ -33,7 +33,7 @@ cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmGeneratorExpressionEvaluationFile::Generate(const char *config, void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
cmCompiledGeneratorExpression* inputExpression, cmCompiledGeneratorExpression* inputExpression,
std::map<std::string, std::string> &outputFiles) std::map<std::string, std::string> &outputFiles)
{ {
@ -135,7 +135,7 @@ void cmGeneratorExpressionEvaluationFile::Generate()
if (allConfigs.empty()) if (allConfigs.empty())
{ {
this->Generate(0, inputExpression.get(), outputFiles); this->Generate("", inputExpression.get(), outputFiles);
} }
else else
{ {

View File

@ -32,7 +32,7 @@ public:
std::vector<std::string> GetFiles() const { return this->Files; } std::vector<std::string> GetFiles() const { return this->Files; }
private: private:
void Generate(const char *config, void Generate(const std::string& config,
cmCompiledGeneratorExpression* inputExpression, cmCompiledGeneratorExpression* inputExpression,
std::map<std::string, std::string> &outputFiles); std::map<std::string, std::string> &outputFiles);

View File

@ -689,7 +689,7 @@ static const struct ConfigurationNode : public cmGeneratorExpressionNode
cmGeneratorExpressionDAGChecker *) const cmGeneratorExpressionDAGChecker *) const
{ {
context->HadContextSensitiveCondition = true; context->HadContextSensitiveCondition = true;
return context->Config ? context->Config : ""; return context->Config;
} }
} configurationNode; } configurationNode;
@ -718,13 +718,13 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
return std::string(); return std::string();
} }
context->HadContextSensitiveCondition = true; context->HadContextSensitiveCondition = true;
if (!context->Config) if (context->Config.empty())
{ {
return parameters.front().empty() ? "1" : "0"; return parameters.front().empty() ? "1" : "0";
} }
if (cmsysString_strcasecmp(parameters.begin()->c_str(), if (cmsysString_strcasecmp(parameters.begin()->c_str(),
context->Config) == 0) context->Config.c_str()) == 0)
{ {
return "1"; return "1";
} }

View File

@ -27,7 +27,7 @@ struct cmGeneratorExpressionContext
std::set<cmTarget const*> AllTargets; std::set<cmTarget const*> AllTargets;
std::set<std::string> SeenTargetProperties; std::set<std::string> SeenTargetProperties;
cmMakefile *Makefile; cmMakefile *Makefile;
const char *Config; std::string Config;
cmTarget const* HeadTarget; // The target whose property is being evaluated. cmTarget const* HeadTarget; // The target whose property is being evaluated.
cmTarget const* CurrentTarget; // The dependent of HeadTarget which appears cmTarget const* CurrentTarget; // The dependent of HeadTarget which appears
// directly or indirectly in the property. // directly or indirectly in the property.

View File

@ -252,7 +252,8 @@ cmGeneratorTarget::GetSourceDepends(cmSourceFile* sf) const
} }
static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt, static void handleSystemIncludesDep(cmMakefile *mf, cmTarget* depTgt,
const char *config, cmTarget *headTarget, const std::string& config,
cmTarget *headTarget,
cmGeneratorExpressionDAGChecker *dagChecker, cmGeneratorExpressionDAGChecker *dagChecker,
std::vector<std::string>& result, std::vector<std::string>& result,
bool excludeImported) bool excludeImported)
@ -390,12 +391,12 @@ void cmGeneratorTarget::GetResxSources(std::vector<cmSourceFile*>& srcs) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir, bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir,
const char *config) const const std::string& config) const
{ {
assert(this->GetType() != cmTarget::INTERFACE_LIBRARY); assert(this->GetType() != cmTarget::INTERFACE_LIBRARY);
std::string config_upper; std::string config_upper;
if(config && *config) if(!config.empty())
{ {
config_upper = cmSystemTools::UpperCase(config); config_upper = cmSystemTools::UpperCase(config);
} }
@ -802,7 +803,7 @@ cmTargetTraceDependencies
{ {
const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge
= ge.Parse(*cli); = ge.Parse(*cli);
cge->Evaluate(this->Makefile, 0, true); cge->Evaluate(this->Makefile, "", true);
std::set<cmTarget*> geTargets = cge->GetTargets(); std::set<cmTarget*> geTargets = cge->GetTargets();
for(std::set<cmTarget*>::const_iterator it = geTargets.begin(); for(std::set<cmTarget*>::const_iterator it = geTargets.begin();
it != geTargets.end(); ++it) 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 std::vector<std::string>& archVec) const
{ {
const char* archs = 0; const char* archs = 0;
if(config && *config) if(!config.empty())
{ {
std::string defVarName = "OSX_ARCHITECTURES_"; std::string defVarName = "OSX_ARCHITECTURES_";
defVarName += cmSystemTools::UpperCase(config); defVarName += cmSystemTools::UpperCase(config);
@ -904,13 +905,14 @@ const char* cmGeneratorTarget::GetCreateRuleVariable() const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::vector<std::string> std::vector<std::string>
cmGeneratorTarget::GetIncludeDirectories(const char *config) const cmGeneratorTarget::GetIncludeDirectories(const std::string& config) const
{ {
return this->Target->GetIncludeDirectories(config); return this->Target->GetIncludeDirectories(config);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmGeneratorTarget::GenerateTargetManifest(const char* config) const void cmGeneratorTarget::GenerateTargetManifest(
const std::string& config) const
{ {
if (this->Target->IsImported()) if (this->Target->IsImported())
{ {
@ -953,35 +955,35 @@ void cmGeneratorTarget::GenerateTargetManifest(const char* config) const
f = dir; f = dir;
f += "/"; f += "/";
f += name; f += name;
gg->AddToManifest(config? config:"", f); gg->AddToManifest(config, f);
} }
if(!soName.empty()) if(!soName.empty())
{ {
f = dir; f = dir;
f += "/"; f += "/";
f += soName; f += soName;
gg->AddToManifest(config? config:"", f); gg->AddToManifest(config, f);
} }
if(!realName.empty()) if(!realName.empty())
{ {
f = dir; f = dir;
f += "/"; f += "/";
f += realName; f += realName;
gg->AddToManifest(config? config:"", f); gg->AddToManifest(config, f);
} }
if(!pdbName.empty()) if(!pdbName.empty())
{ {
f = dir; f = dir;
f += "/"; f += "/";
f += pdbName; f += pdbName;
gg->AddToManifest(config? config:"", f); gg->AddToManifest(config, f);
} }
if(!impName.empty()) if(!impName.empty())
{ {
f = this->Target->GetDirectory(config, true); f = this->Target->GetDirectory(config, true);
f += "/"; f += "/";
f += impName; f += impName;
gg->AddToManifest(config? config:"", f); gg->AddToManifest(config, f);
} }
} }

View File

@ -61,7 +61,7 @@ public:
void UseObjectLibraries(std::vector<std::string>& objs) const; void UseObjectLibraries(std::vector<std::string>& objs) const;
void GetAppleArchs(const char* config, void GetAppleArchs(const std::string& config,
std::vector<std::string>& archVec) const; std::vector<std::string>& archVec) const;
///! Return the rule variable used to create this type of target, ///! Return the rule variable used to create this type of target,
@ -69,12 +69,14 @@ public:
const char* GetCreateRuleVariable() const; const char* GetCreateRuleVariable() const;
/** Get the include directories for this target. */ /** Get the include directories for this target. */
std::vector<std::string> GetIncludeDirectories(const char *config) const; std::vector<std::string> GetIncludeDirectories(
const std::string& config) const;
bool IsSystemIncludeDirectory(const char *dir, const char *config) const; bool IsSystemIncludeDirectory(const std::string& dir,
const std::string& config) const;
/** Add the target output files to the global generator manifest. */ /** Add the target output files to the global generator manifest. */
void GenerateTargetManifest(const char* config) const; void GenerateTargetManifest(const std::string& config) const;
/** /**
* Trace through the source files in this target and add al source files * Trace through the source files in this target and add al source files

View File

@ -1655,7 +1655,8 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
#endif // WIN32 #endif // WIN32
#endif #endif
} }
const char* config = mf->GetDefinition("CMAKE_TRY_COMPILE_CONFIGURATION"); std::string config =
mf->GetSafeDefinition("CMAKE_TRY_COMPILE_CONFIGURATION");
return this->Build(srcdir,bindir,projectName, return this->Build(srcdir,bindir,projectName,
newTarget.c_str(), newTarget.c_str(),
output,0,config,false,fast, output,0,config,false,fast,
@ -1664,7 +1665,7 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
void cmGlobalGenerator::GenerateBuildCommand( void cmGlobalGenerator::GenerateBuildCommand(
std::vector<std::string>& makeCommand, const char*, const std::string&, std::vector<std::string>& makeCommand, const char*, const std::string&,
const char*, const std::string&, const char*, bool, const char*, const std::string&, const std::string&, bool,
std::vector<std::string> const&) std::vector<std::string> const&)
{ {
makeCommand.push_back( makeCommand.push_back(
@ -1676,7 +1677,7 @@ int cmGlobalGenerator::Build(
const std::string& projectName, const std::string& target, const std::string& projectName, const std::string& target,
std::string *output, std::string *output,
const char *makeCommandCSTR, const char *makeCommandCSTR,
const char *config, const std::string& config,
bool clean, bool fast, bool clean, bool fast,
double timeout, double timeout,
cmSystemTools::OutputOption outputflag, cmSystemTools::OutputOption outputflag,
@ -1788,13 +1789,14 @@ int cmGlobalGenerator::Build(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmGlobalGenerator::GenerateCMakeBuildCommand( std::string cmGlobalGenerator::GenerateCMakeBuildCommand(
const std::string& target, const char* config, const char* native, const std::string& target, const std::string& config,
const char* native,
bool ignoreErrors) bool ignoreErrors)
{ {
std::string makeCommand = cmSystemTools::GetCMakeCommand(); std::string makeCommand = cmSystemTools::GetCMakeCommand();
makeCommand = cmSystemTools::ConvertToOutputPath(makeCommand.c_str()); makeCommand = cmSystemTools::ConvertToOutputPath(makeCommand.c_str());
makeCommand += " --build ."; makeCommand += " --build .";
if(config && *config) if(!config.empty())
{ {
makeCommand += " --config \""; makeCommand += " --config \"";
makeCommand += config; makeCommand += config;
@ -2526,7 +2528,8 @@ std::string cmGlobalGenerator::GetSharedLibFlagsForLanguage(
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*, void cmGlobalGenerator::AppendDirectoryForConfig(const char*,
const std::string&,
const char*, std::string&) const char*, std::string&)
{ {
// Subclasses that support multiple configurations should implement // Subclasses that support multiple configurations should implement
@ -2677,7 +2680,7 @@ void cmGlobalGenerator::AddTargetDepends(cmTarget const* target,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmGlobalGenerator::AddToManifest(const char* config, void cmGlobalGenerator::AddToManifest(const std::string& config,
std::string const& f) std::string const& f)
{ {
// Add to the main manifest for this configuration. // Add to the main manifest for this configuration.

View File

@ -120,7 +120,7 @@ public:
int Build(const char *srcdir, const char *bindir, int Build(const char *srcdir, const char *bindir,
const std::string& projectName, const std::string& targetName, const std::string& projectName, const std::string& targetName,
std::string *output, std::string *output,
const char *makeProgram, const char *config, const char *makeProgram, const std::string& config,
bool clean, bool fast, bool clean, bool fast,
double timeout, double timeout,
cmSystemTools::OutputOption outputflag=cmSystemTools::OUTPUT_NONE, cmSystemTools::OutputOption outputflag=cmSystemTools::OUTPUT_NONE,
@ -131,13 +131,13 @@ public:
std::vector<std::string>& makeCommand, std::vector<std::string>& makeCommand,
const char* makeProgram, const char* makeProgram,
const std::string& projectName, const char *projectDir, const std::string& projectName, const char *projectDir,
const std::string& targetName, const char* config, bool fast, const std::string& targetName, const std::string& config, bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>() std::vector<std::string> const& makeOptions = std::vector<std::string>()
); );
/** Generate a "cmake --build" call for a given target and config. */ /** Generate a "cmake --build" call for a given target and config. */
std::string GenerateCMakeBuildCommand(const std::string& target, std::string GenerateCMakeBuildCommand(const std::string& target,
const char* config, const std::string& config,
const char* native, const char* native,
bool ignoreErrors); bool ignoreErrors);
@ -173,7 +173,7 @@ public:
cmExportSetMap& GetExportSets() {return this->ExportSets;} cmExportSetMap& GetExportSets() {return this->ExportSets;}
/** Add a file to the manifest of generated targets for a configuration. */ /** Add a file to the manifest of generated targets for a configuration. */
void AddToManifest(const char* config, std::string const& f); void AddToManifest(const std::string& config, std::string const& f);
void EnableInstallTarget(); void EnableInstallTarget();
@ -231,7 +231,7 @@ public:
appended the given prefix and suffix will be appended around it, which appended the given prefix and suffix will be appended around it, which
is useful for leading or trailing slashes. */ is useful for leading or trailing slashes. */
virtual void AppendDirectoryForConfig(const char* prefix, virtual void AppendDirectoryForConfig(const char* prefix,
const char* config, const std::string& config,
const char* suffix, const char* suffix,
std::string& dir); std::string& dir);

View File

@ -555,7 +555,7 @@ void cmGlobalNinjaGenerator
const std::string& /*projectName*/, const std::string& /*projectName*/,
const char* /*projectDir*/, const char* /*projectDir*/,
const std::string& targetName, const std::string& targetName,
const char* /*config*/, const std::string& /*config*/,
bool /*fast*/, bool /*fast*/,
std::vector<std::string> const& makeOptions) std::vector<std::string> const& makeOptions)
{ {
@ -834,8 +834,8 @@ void
cmGlobalNinjaGenerator cmGlobalNinjaGenerator
::AppendTargetOutputs(cmTarget const* target, cmNinjaDeps& outputs) ::AppendTargetOutputs(cmTarget const* target, cmNinjaDeps& outputs)
{ {
const char* configName = std::string configName =
target->GetMakefile()->GetDefinition("CMAKE_BUILD_TYPE"); target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
cmLocalNinjaGenerator *ng = cmLocalNinjaGenerator *ng =
static_cast<cmLocalNinjaGenerator *>(this->LocalGenerators[0]); static_cast<cmLocalNinjaGenerator *>(this->LocalGenerators[0]);

View File

@ -197,7 +197,7 @@ public:
const std::string& projectName, const std::string& projectName,
const char* projectDir, const char* projectDir,
const std::string& targetName, const std::string& targetName,
const char* config, const std::string& config,
bool fast, bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>() std::vector<std::string> const& makeOptions = std::vector<std::string>()
); );

View File

@ -569,7 +569,7 @@ void cmGlobalUnixMakefileGenerator3
const std::string& /*projectName*/, const std::string& /*projectName*/,
const char* /*projectDir*/, const char* /*projectDir*/,
const std::string& targetName, const std::string& targetName,
const char* /*config*/, const std::string& /*config*/,
bool fast, bool fast,
std::vector<std::string> const& makeOptions) std::vector<std::string> const& makeOptions)
{ {

View File

@ -113,7 +113,7 @@ public:
const std::string& projectName, const std::string& projectName,
const char* projectDir, const char* projectDir,
const std::string& targetName, const std::string& targetName,
const char* config, const std::string& config,
bool fast, bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>() std::vector<std::string> const& makeOptions = std::vector<std::string>()
); );

View File

@ -314,7 +314,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
const std::string& projectName, const std::string& projectName,
const char* projectDir, const char* projectDir,
const std::string& targetName, const std::string& targetName,
const char* config, const std::string& config,
bool fast, bool fast,
std::vector<std::string> const& makeOptions) std::vector<std::string> const& makeOptions)
{ {
@ -397,7 +397,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
makeCommand.push_back(targetProject); makeCommand.push_back(targetProject);
} }
std::string configArg = "/p:Configuration="; std::string configArg = "/p:Configuration=";
if(config && strlen(config)) if(!config.empty())
{ {
configArg += config; configArg += config;
} }

View File

@ -38,7 +38,7 @@ public:
const std::string& projectName, const std::string& projectName,
const char* projectDir, const char* projectDir,
const std::string& targetName, const std::string& targetName,
const char* config, const std::string& config,
bool fast, bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>() std::vector<std::string> const& makeOptions = std::vector<std::string>()
); );

View File

@ -120,7 +120,7 @@ cmGlobalVisualStudio6Generator::GenerateBuildCommand(
const std::string& projectName, const std::string& projectName,
const char* /*projectDir*/, const char* /*projectDir*/,
const std::string& targetName, const std::string& targetName,
const char* config, const std::string& config,
bool /*fast*/, bool /*fast*/,
std::vector<std::string> const& makeOptions std::vector<std::string> const& makeOptions
) )
@ -149,7 +149,7 @@ cmGlobalVisualStudio6Generator::GenerateBuildCommand(
targetArg += "ALL_BUILD"; targetArg += "ALL_BUILD";
} }
targetArg += " - "; targetArg += " - ";
if(config && strlen(config)) if(!config.empty())
{ {
targetArg += config; targetArg += config;
} }
@ -419,11 +419,11 @@ void cmGlobalVisualStudio6Generator
void void
cmGlobalVisualStudio6Generator cmGlobalVisualStudio6Generator
::AppendDirectoryForConfig(const char* prefix, ::AppendDirectoryForConfig(const char* prefix,
const char* config, const std::string& config,
const char* suffix, const char* suffix,
std::string& dir) std::string& dir)
{ {
if(config) if(!config.empty())
{ {
dir += prefix; dir += prefix;
dir += config; dir += config;

View File

@ -58,7 +58,7 @@ public:
const std::string& projectName, const std::string& projectName,
const char* projectDir, const char* projectDir,
const std::string& targetName, const std::string& targetName,
const char* config, const std::string& config,
bool fast, bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>() std::vector<std::string> const& makeOptions = std::vector<std::string>()
); );
@ -82,7 +82,7 @@ public:
/** Append the subdirectory for the given configuration. */ /** Append the subdirectory for the given configuration. */
virtual void AppendDirectoryForConfig(const char* prefix, virtual void AppendDirectoryForConfig(const char* prefix,
const char* config, const std::string& config,
const char* suffix, const char* suffix,
std::string& dir); std::string& dir);

View File

@ -187,7 +187,7 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
const std::string& projectName, const std::string& projectName,
const char* /*projectDir*/, const char* /*projectDir*/,
const std::string& targetName, const std::string& targetName,
const char* config, const std::string& config,
bool /*fast*/, bool /*fast*/,
std::vector<std::string> const& makeOptions) std::vector<std::string> const& makeOptions)
{ {
@ -224,7 +224,7 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
makeCommand.push_back("/build"); makeCommand.push_back("/build");
} }
if(config && strlen(config)) if(!config.empty())
{ {
makeCommand.push_back(config); makeCommand.push_back(config);
} }
@ -962,11 +962,11 @@ void cmGlobalVisualStudio7Generator
void void
cmGlobalVisualStudio7Generator cmGlobalVisualStudio7Generator
::AppendDirectoryForConfig(const char* prefix, ::AppendDirectoryForConfig(const char* prefix,
const char* config, const std::string& config,
const char* suffix, const char* suffix,
std::string& dir) std::string& dir)
{ {
if(config) if(!config.empty())
{ {
dir += prefix; dir += prefix;
dir += config; dir += config;

View File

@ -66,7 +66,7 @@ public:
const std::string& projectName, const std::string& projectName,
const char* projectDir, const char* projectDir,
const std::string& targetName, const std::string& targetName,
const char* config, const std::string& config,
bool fast, bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>() std::vector<std::string> const& makeOptions = std::vector<std::string>()
); );
@ -94,7 +94,7 @@ public:
/** Append the subdirectory for the given configuration. */ /** Append the subdirectory for the given configuration. */
virtual void AppendDirectoryForConfig(const char* prefix, virtual void AppendDirectoryForConfig(const char* prefix,
const char* config, const std::string& config,
const char* suffix, const char* suffix,
std::string& dir); std::string& dir);

View File

@ -264,7 +264,7 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
const std::string& projectName, const std::string& projectName,
const char* /*projectDir*/, const char* /*projectDir*/,
const std::string& targetName, const std::string& targetName,
const char* config, const std::string& config,
bool /*fast*/, bool /*fast*/,
std::vector<std::string> const& makeOptions) std::vector<std::string> const& makeOptions)
{ {
@ -298,11 +298,6 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
makeCommand.push_back("build"); makeCommand.push_back("build");
} }
makeCommand.push_back("-target"); makeCommand.push_back("-target");
// if it is a null string for config don't use it
if(config && *config == 0)
{
config = 0;
}
if (!realTarget.empty()) if (!realTarget.empty())
{ {
makeCommand.push_back(realTarget); makeCommand.push_back(realTarget);
@ -319,7 +314,7 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
else else
{ {
makeCommand.push_back("-configuration"); makeCommand.push_back("-configuration");
makeCommand.push_back(config?config:"Debug"); makeCommand.push_back(!config.empty()?config:"Debug");
} }
makeCommand.insert(makeCommand.end(), makeCommand.insert(makeCommand.end(),
makeOptions.begin(), makeOptions.end()); makeOptions.begin(), makeOptions.end());
@ -1547,7 +1542,7 @@ void cmGlobalXCodeGenerator
cmTarget& target, cmTarget& target,
std::vector<cmCustomCommand> std::vector<cmCustomCommand>
const & commands, const & commands,
const char* configName, const std::string& configName,
const std::map<std::string, const std::map<std::string,
std::string>& multipleOutputPairs std::string>& multipleOutputPairs
) )
@ -1691,7 +1686,7 @@ void cmGlobalXCodeGenerator
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
cmXCodeObject* buildSettings, cmXCodeObject* buildSettings,
const char* configName) const std::string& configName)
{ {
if(target.GetType() == cmTarget::INTERFACE_LIBRARY) if(target.GetType() == cmTarget::INTERFACE_LIBRARY)
{ {
@ -1804,7 +1799,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
this->CurrentLocalGenerator-> this->CurrentLocalGenerator->
AppendFlags(extraLinkOptions, targetLinkFlags); AppendFlags(extraLinkOptions, targetLinkFlags);
} }
if(configName && *configName) if(!configName.empty())
{ {
std::string linkFlagsVar = "LINK_FLAGS_"; std::string linkFlagsVar = "LINK_FLAGS_";
linkFlagsVar += cmSystemTools::UpperCase(configName); linkFlagsVar += cmSystemTools::UpperCase(configName);
@ -2738,7 +2733,7 @@ void cmGlobalXCodeGenerator
::AppendBuildSettingAttribute(cmXCodeObject* target, ::AppendBuildSettingAttribute(cmXCodeObject* target,
const char* attribute, const char* attribute,
const char* value, const char* value,
const char* configName) const std::string& configName)
{ {
if(this->XcodeVersion < 21) if(this->XcodeVersion < 21)
{ {
@ -2761,9 +2756,9 @@ void cmGlobalXCodeGenerator
for(std::vector<cmXCodeObject*>::iterator i = list.begin(); for(std::vector<cmXCodeObject*>::iterator i = list.begin();
i != list.end(); ++i) i != list.end(); ++i)
{ {
if(configName) if(!configName.empty())
{ {
if(strcmp((*i)->GetObject("name")->GetString(), configName) == 0) if((*i)->GetObject("name")->GetString() == configName)
{ {
cmXCodeObject* settings = (*i)->GetObject("buildSettings"); cmXCodeObject* settings = (*i)->GetObject("buildSettings");
this->AppendOrAddBuildSetting(settings, attribute, value); this->AppendOrAddBuildSetting(settings, attribute, value);
@ -3777,13 +3772,13 @@ std::string cmGlobalXCodeGenerator::XCodeEscapePath(const char* p)
void void
cmGlobalXCodeGenerator cmGlobalXCodeGenerator
::AppendDirectoryForConfig(const char* prefix, ::AppendDirectoryForConfig(const char* prefix,
const char* config, const std::string& config,
const char* suffix, const char* suffix,
std::string& dir) std::string& dir)
{ {
if(this->XcodeVersion > 20) if(this->XcodeVersion > 20)
{ {
if(config) if(!config.empty())
{ {
dir += prefix; dir += prefix;
dir += config; dir += config;

View File

@ -59,7 +59,7 @@ public:
const std::string& projectName, const std::string& projectName,
const char* projectDir, const char* projectDir,
const std::string& targetName, const std::string& targetName,
const char* config, const std::string& config,
bool fast, bool fast,
std::vector<std::string> const& makeOptions = std::vector<std::string>() std::vector<std::string> const& makeOptions = std::vector<std::string>()
); );
@ -73,7 +73,7 @@ public:
/** Append the subdirectory for the given configuration. */ /** Append the subdirectory for the given configuration. */
virtual void AppendDirectoryForConfig(const char* prefix, virtual void AppendDirectoryForConfig(const char* prefix,
const char* config, const std::string& config,
const char* suffix, const char* suffix,
std::string& dir); std::string& dir);
@ -123,7 +123,7 @@ private:
void CreateCustomRulesMakefile(const char* makefileBasename, void CreateCustomRulesMakefile(const char* makefileBasename,
cmTarget& target, cmTarget& target,
std::vector<cmCustomCommand> const & commands, std::vector<cmCustomCommand> const & commands,
const char* configName, const std::string& configName,
const std::map<std::string, std::string>& const std::map<std::string, std::string>&
multipleOutputPairs multipleOutputPairs
); );
@ -147,12 +147,13 @@ private:
void AppendOrAddBuildSetting(cmXCodeObject* settings, const char* attr, void AppendOrAddBuildSetting(cmXCodeObject* settings, const char* attr,
const char* value); const char* value);
void AppendBuildSettingAttribute(cmXCodeObject* target, const char* attr, void AppendBuildSettingAttribute(cmXCodeObject* target, const char* attr,
const char* value, const char* configName); const char* value,
const std::string& configName);
cmXCodeObject* CreateUtilityTarget(cmTarget& target); cmXCodeObject* CreateUtilityTarget(cmTarget& target);
void AddDependAndLinkInformation(cmXCodeObject* target); void AddDependAndLinkInformation(cmXCodeObject* target);
void CreateBuildSettings(cmTarget& target, void CreateBuildSettings(cmTarget& target,
cmXCodeObject* buildSettings, cmXCodeObject* buildSettings,
const char* buildType); const std::string& buildType);
std::string ExtractFlag(const char* flag, std::string& flags); std::string ExtractFlag(const char* flag, std::string& flags);
// delete all objects in the this->XCodeObjects vector. // delete all objects in the this->XCodeObjects vector.
void ClearXCodeObjects(); void ClearXCodeObjects();

View File

@ -142,7 +142,7 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os)
this->EFGen->SetExportOld(this->ExportOld); this->EFGen->SetExportOld(this->ExportOld);
if(this->ConfigurationTypes->empty()) if(this->ConfigurationTypes->empty())
{ {
if(this->ConfigurationName && *this->ConfigurationName) if(!this->ConfigurationName.empty())
{ {
this->EFGen->AddConfiguration(this->ConfigurationName); this->EFGen->AddConfiguration(this->ConfigurationName);
} }

View File

@ -80,7 +80,7 @@ void cmInstallFilesGenerator::GenerateScriptActions(std::ostream& os,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmInstallFilesGenerator::GenerateScriptForConfig(std::ostream& os, void cmInstallFilesGenerator::GenerateScriptForConfig(std::ostream& os,
const char* config, const std::string& config,
Indent const& indent) Indent const& indent)
{ {
std::vector<std::string> files; std::vector<std::string> files;

View File

@ -35,7 +35,7 @@ public:
protected: protected:
virtual void GenerateScriptActions(std::ostream& os, Indent const& indent); virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
virtual void GenerateScriptForConfig(std::ostream& os, virtual void GenerateScriptForConfig(std::ostream& os,
const char* config, const std::string& config,
Indent const& indent); Indent const& indent);
void AddFilesInstallRule(std::ostream& os, Indent const& indent, void AddFilesInstallRule(std::ostream& os, Indent const& indent,
std::vector<std::string> const& files); std::vector<std::string> const& files);

View File

@ -163,7 +163,7 @@ void cmInstallGenerator::GenerateScript(std::ostream& os)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmInstallGenerator::InstallsForConfig(const char* config) bool cmInstallGenerator::InstallsForConfig(const std::string& config)
{ {
return this->GeneratesForConfig(config); return this->GeneratesForConfig(config);
} }

View File

@ -48,7 +48,7 @@ public:
std::string GetInstallDestination() const; std::string GetInstallDestination() const;
/** Test if this generator installs something for a given configuration. */ /** Test if this generator installs something for a given configuration. */
bool InstallsForConfig(const char*); bool InstallsForConfig(const std::string& config);
protected: protected:
virtual void GenerateScript(std::ostream& os); virtual void GenerateScript(std::ostream& os);

View File

@ -59,7 +59,7 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os, void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
const char* config, const std::string& config,
Indent const& indent) Indent const& indent)
{ {
// Compute the build tree directory from which to copy the target. // Compute the build tree directory from which to copy the target.
@ -319,7 +319,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(std::ostream& os,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string std::string
cmInstallTargetGenerator::GetInstallFilename(const char* config) const cmInstallTargetGenerator::GetInstallFilename(const std::string& config) const
{ {
NameType nameType = this->ImportLibrary? NameImplib : NameNormal; NameType nameType = this->ImportLibrary? NameImplib : NameNormal;
return return
@ -330,7 +330,7 @@ cmInstallTargetGenerator::GetInstallFilename(const char* config) const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string std::string
cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target, cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
const char* config, const std::string& config,
NameType nameType) NameType nameType)
{ {
std::string fname; std::string fname;
@ -405,7 +405,7 @@ cmInstallTargetGenerator::GetInstallFilename(cmTarget const* target,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmInstallTargetGenerator cmInstallTargetGenerator
::AddTweak(std::ostream& os, Indent const& indent, const char* config, ::AddTweak(std::ostream& os, Indent const& indent, const std::string& config,
std::string const& file, TweakMethod tweak) std::string const& file, TweakMethod tweak)
{ {
cmOStringStream tw; cmOStringStream tw;
@ -423,7 +423,7 @@ cmInstallTargetGenerator
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmInstallTargetGenerator cmInstallTargetGenerator
::AddTweak(std::ostream& os, Indent const& indent, const char* config, ::AddTweak(std::ostream& os, Indent const& indent, const std::string& config,
std::vector<std::string> const& files, TweakMethod tweak) std::vector<std::string> const& files, TweakMethod tweak)
{ {
if(files.size() == 1) if(files.size() == 1)
@ -470,7 +470,7 @@ std::string cmInstallTargetGenerator::GetDestDirPath(std::string const& file)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmInstallTargetGenerator::PreReplacementTweaks(std::ostream& os, void cmInstallTargetGenerator::PreReplacementTweaks(std::ostream& os,
Indent const& indent, Indent const& indent,
const char* config, const std::string& config,
std::string const& file) std::string const& file)
{ {
this->AddRPathCheckRule(os, indent, config, file); this->AddRPathCheckRule(os, indent, config, file);
@ -479,7 +479,7 @@ void cmInstallTargetGenerator::PreReplacementTweaks(std::ostream& os,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os, void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
Indent const& indent, Indent const& indent,
const char* config, const std::string& config,
std::string const& file) std::string const& file)
{ {
this->AddInstallNamePatchRule(os, indent, config, file); this->AddInstallNamePatchRule(os, indent, config, file);
@ -492,7 +492,8 @@ void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
void void
cmInstallTargetGenerator cmInstallTargetGenerator
::AddInstallNamePatchRule(std::ostream& os, Indent const& indent, ::AddInstallNamePatchRule(std::ostream& os, Indent const& indent,
const char* config, std::string const& toDestDirPath) const std::string& config,
std::string const& toDestDirPath)
{ {
if(this->ImportLibrary || if(this->ImportLibrary ||
!(this->Target->GetType() == cmTarget::SHARED_LIBRARY || !(this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
@ -605,7 +606,8 @@ cmInstallTargetGenerator
void void
cmInstallTargetGenerator cmInstallTargetGenerator
::AddRPathCheckRule(std::ostream& os, Indent const& indent, ::AddRPathCheckRule(std::ostream& os, Indent const& indent,
const char* config, std::string const& toDestDirPath) const std::string& config,
std::string const& toDestDirPath)
{ {
// Skip the chrpath if the target does not need it. // Skip the chrpath if the target does not need it.
if(this->ImportLibrary || !this->Target->IsChrpathUsed(config)) if(this->ImportLibrary || !this->Target->IsChrpathUsed(config))
@ -642,7 +644,8 @@ cmInstallTargetGenerator
void void
cmInstallTargetGenerator cmInstallTargetGenerator
::AddChrpathPatchRule(std::ostream& os, Indent const& indent, ::AddChrpathPatchRule(std::ostream& os, Indent const& indent,
const char* config, std::string const& toDestDirPath) const std::string& config,
std::string const& toDestDirPath)
{ {
// Skip the chrpath if the target does not need it. // Skip the chrpath if the target does not need it.
if(this->ImportLibrary || !this->Target->IsChrpathUsed(config)) if(this->ImportLibrary || !this->Target->IsChrpathUsed(config))

View File

@ -43,7 +43,7 @@ public:
void SetNamelinkMode(NamelinkModeType mode) { this->NamelinkMode = mode; } void SetNamelinkMode(NamelinkModeType mode) { this->NamelinkMode = mode; }
NamelinkModeType GetNamelinkMode() const { return this->NamelinkMode; } NamelinkModeType GetNamelinkMode() const { return this->NamelinkMode; }
std::string GetInstallFilename(const char* config) const; std::string GetInstallFilename(const std::string& config) const;
enum NameType enum NameType
{ {
@ -54,7 +54,7 @@ public:
}; };
static std::string GetInstallFilename(cmTarget const* target, static std::string GetInstallFilename(cmTarget const* target,
const char* config, const std::string& config,
NameType nameType = NameNormal); NameType nameType = NameNormal);
cmTarget* GetTarget() const { return this->Target; } cmTarget* GetTarget() const { return this->Target; }
@ -63,30 +63,33 @@ public:
protected: protected:
virtual void GenerateScript(std::ostream& os); virtual void GenerateScript(std::ostream& os);
virtual void GenerateScriptForConfig(std::ostream& os, virtual void GenerateScriptForConfig(std::ostream& os,
const char* config, const std::string& config,
Indent const& indent); Indent const& indent);
typedef void (cmInstallTargetGenerator::*TweakMethod)( typedef void (cmInstallTargetGenerator::*TweakMethod)(
std::ostream&, Indent const&, const char*, std::string const& std::ostream&, Indent const&, const std::string&, std::string const&
); );
void AddTweak(std::ostream& os, Indent const& indent, void AddTweak(std::ostream& os, Indent const& indent,
const char* config, std::string const& file, const std::string& config, std::string const& file,
TweakMethod tweak); TweakMethod tweak);
void AddTweak(std::ostream& os, Indent const& indent, void AddTweak(std::ostream& os, Indent const& indent,
const char* config, std::vector<std::string> const& files, const std::string& config,
std::vector<std::string> const& files,
TweakMethod tweak); TweakMethod tweak);
std::string GetDestDirPath(std::string const& file); std::string GetDestDirPath(std::string const& file);
void PreReplacementTweaks(std::ostream& os, Indent const& indent, void PreReplacementTweaks(std::ostream& os, Indent const& indent,
const char* config, std::string const& file); const std::string& config,
std::string const& file);
void PostReplacementTweaks(std::ostream& os, Indent const& indent, void PostReplacementTweaks(std::ostream& os, Indent const& indent,
const char* config, std::string const& file); const std::string& config,
std::string const& file);
void AddInstallNamePatchRule(std::ostream& os, Indent const& indent, void AddInstallNamePatchRule(std::ostream& os, Indent const& indent,
const char* config, const std::string& config,
const std::string& toDestDirPath); const std::string& toDestDirPath);
void AddChrpathPatchRule(std::ostream& os, Indent const& indent, void AddChrpathPatchRule(std::ostream& os, Indent const& indent,
const char* config, const std::string& config,
std::string const& toDestDirPath); std::string const& toDestDirPath);
void AddRPathCheckRule(std::ostream& os, Indent const& indent, void AddRPathCheckRule(std::ostream& os, Indent const& indent,
const char* config, const std::string& config,
std::string const& toDestDirPath); std::string const& toDestDirPath);
void AddStripRule(std::ostream& os, Indent const& indent, void AddStripRule(std::ostream& os, Indent const& indent,

View File

@ -280,7 +280,7 @@ void cmLocalGenerator::GenerateTestFiles()
// Compute the set of configurations. // Compute the set of configurations.
std::vector<std::string> configurationTypes; std::vector<std::string> configurationTypes;
const char* config = const std::string& config =
this->Makefile->GetConfigurations(configurationTypes, false); this->Makefile->GetConfigurations(configurationTypes, false);
std::string file = this->Makefile->GetStartOutputDirectory(); std::string file = this->Makefile->GetStartOutputDirectory();
@ -384,11 +384,11 @@ void cmLocalGenerator::GenerateInstallRules()
// Compute the set of configurations. // Compute the set of configurations.
std::vector<std::string> configurationTypes; std::vector<std::string> configurationTypes;
const char* config = const std::string& config =
this->Makefile->GetConfigurations(configurationTypes, false); this->Makefile->GetConfigurations(configurationTypes, false);
// Choose a default install configuration. // Choose a default install configuration.
const char* default_config = config; const char* default_config = config.c_str();
const char* default_order[] = {"RELEASE", "MINSIZEREL", const char* default_order[] = {"RELEASE", "MINSIZEREL",
"RELWITHDEBINFO", "DEBUG", 0}; "RELWITHDEBINFO", "DEBUG", 0};
for(const char** c = default_order; *c && !default_config; ++c) for(const char** c = default_order; *c && !default_config; ++c)
@ -557,7 +557,7 @@ void cmLocalGenerator::GenerateTargetManifest()
} }
if(configNames.empty()) if(configNames.empty())
{ {
target.GenerateTargetManifest(0); target.GenerateTargetManifest("");
} }
else else
{ {
@ -712,8 +712,8 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang,
vars.LinkFlags = linkFlags.c_str(); vars.LinkFlags = linkFlags.c_str();
std::string langFlags; std::string langFlags;
this->AddLanguageFlags(langFlags, llang, 0); this->AddLanguageFlags(langFlags, llang, "");
this->AddArchitectureFlags(langFlags, &target, llang, 0); this->AddArchitectureFlags(langFlags, &target, llang, "");
vars.LanguageCompileFlags = langFlags.c_str(); vars.LanguageCompileFlags = langFlags.c_str();
cmCustomCommandLines commandLines; cmCustomCommandLines commandLines;
@ -1292,7 +1292,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
cmGeneratorTarget* target, cmGeneratorTarget* target,
const std::string& lang, const std::string& lang,
bool forResponseFile, bool forResponseFile,
const char *config) const std::string& config)
{ {
if(lang.empty()) if(lang.empty())
{ {
@ -1370,7 +1370,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
if(!flagUsed || repeatFlag) if(!flagUsed || repeatFlag)
{ {
if(sysIncludeFlag && target && if(sysIncludeFlag && target &&
target->IsSystemIncludeDirectory(i->c_str(), config)) target->IsSystemIncludeDirectory(*i, config))
{ {
includeFlags << sysIncludeFlag; includeFlags << sysIncludeFlag;
} }
@ -1405,7 +1405,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines, void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines,
cmTarget const* target, cmTarget const* target,
const char* config) const std::string& config)
{ {
std::vector<std::string> targetDefines; std::vector<std::string> targetDefines;
target->GetCompileDefinitions(targetDefines, target->GetCompileDefinitions(targetDefines,
@ -1416,7 +1416,7 @@ void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalGenerator::AddCompileOptions( void cmLocalGenerator::AddCompileOptions(
std::string& flags, cmTarget* target, std::string& flags, cmTarget* target,
const std::string& lang, const char* config const std::string& lang, const std::string& config
) )
{ {
std::string langFlagRegexVar = std::string("CMAKE_")+lang+"_FLAG_REGEX"; std::string langFlagRegexVar = std::string("CMAKE_")+lang+"_FLAG_REGEX";
@ -1465,7 +1465,7 @@ void cmLocalGenerator::AddCompileOptions(
void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs, void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
cmGeneratorTarget* target, cmGeneratorTarget* target,
const std::string& lang, const std::string& lang,
const char *config, const std::string& config,
bool stripImplicitInclDirs bool stripImplicitInclDirs
) )
{ {
@ -1698,7 +1698,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
target->Target->GetName().c_str()); target->Target->GetName().c_str());
return; return;
} }
this->AddLanguageFlags(flags, linkLanguage, buildType.c_str()); this->AddLanguageFlags(flags, linkLanguage, buildType);
this->OutputLinkLibraries(linkLibs, frameworkPath, linkPath, this->OutputLinkLibraries(linkLibs, frameworkPath, linkPath,
*target, false, false); *target, false, false);
if(cmSystemTools::IsOn if(cmSystemTools::IsOn
@ -1945,7 +1945,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
void cmLocalGenerator::AddArchitectureFlags(std::string& flags, void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
cmGeneratorTarget* target, cmGeneratorTarget* target,
const std::string& lang, const std::string& lang,
const char* config) const std::string& config)
{ {
// Only add Mac OS X specific flags on Darwin platforms (OSX and iphone): // Only add Mac OS X specific flags on Darwin platforms (OSX and iphone):
if(!this->Makefile->IsOn("APPLE")) if(!this->Makefile->IsOn("APPLE"))
@ -2002,7 +2002,7 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalGenerator::AddLanguageFlags(std::string& flags, void cmLocalGenerator::AddLanguageFlags(std::string& flags,
const std::string& lang, const std::string& lang,
const char* config) const std::string& config)
{ {
// Add language-specific flags. // Add language-specific flags.
std::string flagsVar = "CMAKE_"; std::string flagsVar = "CMAKE_";
@ -2013,7 +2013,7 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmLocalGenerator::GetRealDependency(const std::string& inName, bool cmLocalGenerator::GetRealDependency(const std::string& inName,
const char* config, const std::string& config,
std::string& dep) std::string& dep)
{ {
// Older CMake code may specify the dependency using the target // Older CMake code may specify the dependency using the target
@ -2211,7 +2211,7 @@ void cmLocalGenerator
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target, void cmLocalGenerator::AddCMP0018Flags(std::string &flags, cmTarget* target,
std::string const& lang, std::string const& lang,
const char *config) const std::string& config)
{ {
int targetType = target->GetType(); int targetType = target->GetType();
@ -2327,13 +2327,13 @@ void cmLocalGenerator::AddPositionIndependentFlags(std::string& flags,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalGenerator::AddConfigVariableFlags(std::string& flags, void cmLocalGenerator::AddConfigVariableFlags(std::string& flags,
const std::string& var, const std::string& var,
const char* config) const std::string& config)
{ {
// Add the flags from the variable itself. // Add the flags from the variable itself.
std::string flagsVar = var; std::string flagsVar = var;
this->AppendFlags(flags, this->Makefile->GetDefinition(flagsVar.c_str())); this->AppendFlags(flags, this->Makefile->GetDefinition(flagsVar.c_str()));
// Add the flags from the build-type specific variable. // Add the flags from the build-type specific variable.
if(config && *config) if(!config.empty())
{ {
flagsVar += "_"; flagsVar += "_";
flagsVar += cmSystemTools::UpperCase(config); flagsVar += cmSystemTools::UpperCase(config);
@ -2837,7 +2837,7 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
void void
cmLocalGenerator cmLocalGenerator
::GenerateTargetInstallRules( ::GenerateTargetInstallRules(
std::ostream& os, const char* config, std::ostream& os, const std::string& config,
std::vector<std::string> const& configurationTypes) std::vector<std::string> const& configurationTypes)
{ {
// Convert the old-style install specification from each target to // Convert the old-style install specification from each target to

View File

@ -138,16 +138,16 @@ public:
void AddArchitectureFlags(std::string& flags, cmGeneratorTarget* target, void AddArchitectureFlags(std::string& flags, cmGeneratorTarget* target,
const std::string&lang, const char* config); const std::string&lang, const std::string& config);
void AddLanguageFlags(std::string& flags, const std::string& lang, void AddLanguageFlags(std::string& flags, const std::string& lang,
const char* config); const std::string& config);
void AddCMP0018Flags(std::string &flags, cmTarget* target, void AddCMP0018Flags(std::string &flags, cmTarget* target,
std::string const& lang, const char *config); std::string const& lang, const std::string& config);
void AddVisibilityPresetFlags(std::string &flags, cmTarget* target, void AddVisibilityPresetFlags(std::string &flags, cmTarget* target,
const std::string& lang); const std::string& lang);
void AddConfigVariableFlags(std::string& flags, const std::string& var, void AddConfigVariableFlags(std::string& flags, const std::string& var,
const char* config); const std::string& config);
///! Append flags to a string. ///! Append flags to a string.
virtual void AppendFlags(std::string& flags, const char* newFlags); virtual void AppendFlags(std::string& flags, const char* newFlags);
virtual void AppendFlagEscape(std::string& flags, virtual void AppendFlagEscape(std::string& flags,
@ -157,7 +157,7 @@ public:
cmGeneratorTarget* target, cmGeneratorTarget* target,
const std::string& lang, const std::string& lang,
bool forResponseFile = false, bool forResponseFile = false,
const char *config = 0); const std::string& config = "");
/** /**
* Encode a list of preprocessor definitions for the compiler * Encode a list of preprocessor definitions for the compiler
@ -196,7 +196,7 @@ public:
* the source directory of this generator. This should only be * the source directory of this generator. This should only be
* used for dependencies of custom commands. * used for dependencies of custom commands.
*/ */
bool GetRealDependency(const std::string& name, const char* config, bool GetRealDependency(const std::string& name, const std::string& config,
std::string& dep); std::string& dep);
///! for existing files convert to output path and short path if spaces ///! for existing files convert to output path and short path if spaces
@ -227,13 +227,13 @@ public:
void GetIncludeDirectories(std::vector<std::string>& dirs, void GetIncludeDirectories(std::vector<std::string>& dirs,
cmGeneratorTarget* target, cmGeneratorTarget* target,
const std::string& lang = "C", const std::string& lang = "C",
const char *config = 0, const std::string& config = "",
bool stripImplicitInclDirs = true); bool stripImplicitInclDirs = true);
void AddCompileOptions(std::string& flags, cmTarget* target, void AddCompileOptions(std::string& flags, cmTarget* target,
const std::string& lang, const char* config); const std::string& lang, const std::string& config);
void AddCompileDefinitions(std::set<std::string>& defines, void AddCompileDefinitions(std::set<std::string>& defines,
cmTarget const* target, cmTarget const* target,
const char* config); const std::string& config);
/** Compute the language used to compile the given source file. */ /** Compute the language used to compile the given source file. */
std::string GetSourceFileLanguage(const cmSourceFile& source); std::string GetSourceFileLanguage(const cmSourceFile& source);
@ -410,7 +410,7 @@ protected:
// Handle old-style install rules stored in the targets. // Handle old-style install rules stored in the targets.
void GenerateTargetInstallRules( void GenerateTargetInstallRules(
std::ostream& os, const char* config, std::ostream& os, const std::string& config,
std::vector<std::string> const& configurationTypes); std::vector<std::string> const& configurationTypes);
std::string& CreateSafeUniqueObjectFileName(const std::string& sin, std::string& CreateSafeUniqueObjectFileName(const std::string& sin,

View File

@ -38,7 +38,7 @@ class cmLocalVisualStudio6Generator::EventWriter
{ {
public: public:
EventWriter(cmLocalVisualStudio6Generator* lg, EventWriter(cmLocalVisualStudio6Generator* lg,
const char* config, std::string& code): const std::string& config, std::string& code):
LG(lg), Config(config), Code(code), First(true) {} LG(lg), Config(config), Code(code), First(true) {}
void Start(const char* event) void Start(const char* event)
{ {
@ -72,7 +72,7 @@ public:
} }
private: private:
cmLocalVisualStudio6Generator* LG; cmLocalVisualStudio6Generator* LG;
const char* Config; std::string Config;
std::string& Code; std::string& Code;
bool First; bool First;
std::string Event; std::string Event;
@ -785,7 +785,7 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmsys::auto_ptr<cmCustomCommand> cmsys::auto_ptr<cmCustomCommand>
cmLocalVisualStudio6Generator::MaybeCreateOutputDir(cmTarget& target, cmLocalVisualStudio6Generator::MaybeCreateOutputDir(cmTarget& target,
const char* config) const std::string& config)
{ {
cmsys::auto_ptr<cmCustomCommand> pcc; cmsys::auto_ptr<cmCustomCommand> pcc;
@ -813,7 +813,7 @@ cmLocalVisualStudio6Generator::MaybeCreateOutputDir(cmTarget& target,
// look for custom rules on a target and collect them together // look for custom rules on a target and collect them together
std::string std::string
cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target, cmLocalVisualStudio6Generator::CreateTargetRules(cmTarget &target,
const char* configName, const std::string& configName,
const std::string& /* libName */) const std::string& /* libName */)
{ {
if (target.GetType() >= cmTarget::UTILITY ) if (target.GetType() >= cmTarget::UTILITY )
@ -863,7 +863,7 @@ inline std::string removeQuotes(const std::string& s)
std::string std::string
cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target, cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target,
const char *config) const std::string& config)
{ {
std::string includeOptions; std::string includeOptions;
@ -1704,7 +1704,7 @@ void cmLocalVisualStudio6Generator
flagsRelWithDebInfo = this->Makefile->GetSafeDefinition(flagVar.c_str()); flagsRelWithDebInfo = this->Makefile->GetSafeDefinition(flagVar.c_str());
flagsRelWithDebInfo += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" "; flagsRelWithDebInfo += " -DCMAKE_INTDIR=\\\"RelWithDebInfo\\\" ";
this->AddCompileOptions(flags, &target, linkLanguage, 0); this->AddCompileOptions(flags, &target, linkLanguage, "");
this->AddCompileOptions(flagsDebug, &target, linkLanguage, "Debug"); this->AddCompileOptions(flagsDebug, &target, linkLanguage, "Debug");
this->AddCompileOptions(flagsRelease, &target, linkLanguage, "Release"); this->AddCompileOptions(flagsRelease, &target, linkLanguage, "Release");
this->AddCompileOptions(flagsMinSizeRel, &target, linkLanguage, this->AddCompileOptions(flagsMinSizeRel, &target, linkLanguage,
@ -1730,7 +1730,7 @@ void cmLocalVisualStudio6Generator
std::set<std::string> minsizeDefinesSet; std::set<std::string> minsizeDefinesSet;
std::set<std::string> debugrelDefinesSet; std::set<std::string> debugrelDefinesSet;
this->AddCompileDefinitions(definesSet, &target, 0); this->AddCompileDefinitions(definesSet, &target, "");
this->AddCompileDefinitions(debugDefinesSet, &target, "DEBUG"); this->AddCompileDefinitions(debugDefinesSet, &target, "DEBUG");
this->AddCompileDefinitions(releaseDefinesSet, &target, "RELEASE"); this->AddCompileDefinitions(releaseDefinesSet, &target, "RELEASE");
this->AddCompileDefinitions(minsizeDefinesSet, &target, "MINSIZEREL"); this->AddCompileDefinitions(minsizeDefinesSet, &target, "MINSIZEREL");
@ -1800,7 +1800,7 @@ void cmLocalVisualStudio6Generator::WriteDSPFooter(std::ostream& fout)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalVisualStudio6Generator void cmLocalVisualStudio6Generator
::ComputeLinkOptions(cmTarget& target, ::ComputeLinkOptions(cmTarget& target,
const char* configName, const std::string& configName,
const std::string extraOptions, const std::string extraOptions,
std::string& options) std::string& options)
{ {

View File

@ -81,16 +81,17 @@ private:
class EventWriter; class EventWriter;
friend class EventWriter; friend class EventWriter;
cmsys::auto_ptr<cmCustomCommand> cmsys::auto_ptr<cmCustomCommand>
MaybeCreateOutputDir(cmTarget& target, const char* config); MaybeCreateOutputDir(cmTarget& target, const std::string& config);
std::string CreateTargetRules(cmTarget &target, std::string CreateTargetRules(cmTarget &target,
const char* configName, const std::string& configName,
const std::string& libName); const std::string& libName);
void ComputeLinkOptions(cmTarget& target, const char* configName, void ComputeLinkOptions(cmTarget& target, const std::string& configName,
const std::string extraOptions, const std::string extraOptions,
std::string& options); std::string& options);
void OutputObjects(cmTarget& target, const char* tool, void OutputObjects(cmTarget& target, const char* tool,
std::string& options); std::string& options);
std::string GetTargetIncludeOptions(cmTarget &target, const char *config); std::string GetTargetIncludeOptions(cmTarget &target,
const std::string& config);
std::vector<std::string> Configurations; std::vector<std::string> Configurations;
std::string GetConfigName(std::string const& configuration) const; std::string GetConfigName(std::string const& configuration) const;

View File

@ -588,7 +588,7 @@ class cmLocalVisualStudio7Generator::EventWriter
{ {
public: public:
EventWriter(cmLocalVisualStudio7Generator* lg, EventWriter(cmLocalVisualStudio7Generator* lg,
const char* config, std::ostream& os): const std::string& config, std::ostream& os):
LG(lg), Config(config), Stream(os), First(true) {} LG(lg), Config(config), Stream(os), First(true) {}
void Start(const char* tool) void Start(const char* tool)
{ {
@ -629,14 +629,14 @@ public:
} }
private: private:
cmLocalVisualStudio7Generator* LG; cmLocalVisualStudio7Generator* LG;
const char* Config; std::string Config;
std::ostream& Stream; std::ostream& Stream;
bool First; bool First;
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
const char* configName, const std::string& configName,
const std::string& libName, const std::string& libName,
cmTarget &target) cmTarget &target)
{ {
@ -745,7 +745,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
table, table,
this->ExtraFlagTable); this->ExtraFlagTable);
targetOptions.FixExceptionHandlingDefault(); targetOptions.FixExceptionHandlingDefault();
std::string asmLocation = std::string(configName) + "/"; std::string asmLocation = configName + "/";
targetOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str()); targetOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str());
targetOptions.Parse(flags.c_str()); targetOptions.Parse(flags.c_str());
targetOptions.Parse(defineFlags.c_str()); targetOptions.Parse(defineFlags.c_str());
@ -944,7 +944,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string std::string
cmLocalVisualStudio7Generator cmLocalVisualStudio7Generator
::GetBuildTypeLinkerFlags(std::string rootLinkerFlags, const char* configName) ::GetBuildTypeLinkerFlags(std::string rootLinkerFlags,
const std::string& configName)
{ {
std::string configTypeUpper = cmSystemTools::UpperCase(configName); std::string configTypeUpper = cmSystemTools::UpperCase(configName);
std::string extraLinkOptionsBuildTypeDef = std::string extraLinkOptionsBuildTypeDef =
@ -958,7 +959,8 @@ cmLocalVisualStudio7Generator
} }
void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
const char* configName, cmTarget &target, const Options& targetOptions) const std::string& configName, cmTarget &target,
const Options& targetOptions)
{ {
cmGlobalVisualStudio7Generator* gg = cmGlobalVisualStudio7Generator* gg =
static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator); static_cast<cmGlobalVisualStudio7Generator*>(this->GlobalGenerator);
@ -1903,7 +1905,7 @@ void cmLocalVisualStudio7Generator::WriteVCProjEndGroup(std::ostream& fout)
// look for custom rules on a target and collect them together // look for custom rules on a target and collect them together
void cmLocalVisualStudio7Generator void cmLocalVisualStudio7Generator
::OutputTargetRules(std::ostream& fout, ::OutputTargetRules(std::ostream& fout,
const char* configName, const std::string& configName,
cmTarget &target, cmTarget &target,
const std::string& /*libName*/) const std::string& /*libName*/)
{ {

View File

@ -71,7 +71,7 @@ private:
typedef cmVisualStudioGeneratorOptions Options; typedef cmVisualStudioGeneratorOptions Options;
typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo; typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo;
std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags, std::string GetBuildTypeLinkerFlags(std::string rootLinkerFlags,
const char* configName); const std::string& configName);
void FixGlobalTargets(); void FixGlobalTargets();
void WriteProjectFiles(); void WriteProjectFiles();
void WriteVCProjHeader(std::ostream& fout, const std::string& libName, void WriteVCProjHeader(std::ostream& fout, const std::string& libName,
@ -82,14 +82,14 @@ private:
void WriteConfigurations(std::ostream& fout, void WriteConfigurations(std::ostream& fout,
const std::string& libName, cmTarget &tgt); const std::string& libName, cmTarget &tgt);
void WriteConfiguration(std::ostream& fout, void WriteConfiguration(std::ostream& fout,
const char* configName, const std::string& configName,
const std::string& libName, cmTarget &tgt); const std::string& libName, cmTarget &tgt);
std::string EscapeForXML(const std::string& s); std::string EscapeForXML(const std::string& s);
std::string ConvertToXMLOutputPath(const char* path); std::string ConvertToXMLOutputPath(const char* path);
std::string ConvertToXMLOutputPathSingle(const char* path); std::string ConvertToXMLOutputPathSingle(const char* path);
void OutputTargetRules(std::ostream& fout, const char* configName, void OutputTargetRules(std::ostream& fout, const std::string& configName,
cmTarget &target, const std::string& libName); cmTarget &target, const std::string& libName);
void OutputBuildTool(std::ostream& fout, const char* configName, void OutputBuildTool(std::ostream& fout, const std::string& configName,
cmTarget& t, const Options& targetOptions); cmTarget& t, const Options& targetOptions);
void OutputLibraryDirectories(std::ostream& fout, void OutputLibraryDirectories(std::ostream& fout,
std::vector<std::string> const& dirs); std::vector<std::string> const& dirs);

View File

@ -33,7 +33,7 @@ cmLocalVisualStudioGenerator::~cmLocalVisualStudioGenerator()
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmsys::auto_ptr<cmCustomCommand> cmsys::auto_ptr<cmCustomCommand>
cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target, cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmTarget& target,
const char* config, const std::string& config,
bool isFortran) bool isFortran)
{ {
cmsys::auto_ptr<cmCustomCommand> pcc; cmsys::auto_ptr<cmCustomCommand> pcc;
@ -80,7 +80,7 @@ const char* cmLocalVisualStudioGenerator::GetReportErrorLabel() const
std::string std::string
cmLocalVisualStudioGenerator cmLocalVisualStudioGenerator
::ConstructScript(cmCustomCommand const& cc, ::ConstructScript(cmCustomCommand const& cc,
const char* configName, const std::string& configName,
const char* newline_text) const char* newline_text)
{ {
bool useLocal = this->CustomCommandUseLocal(); bool useLocal = this->CustomCommandUseLocal();

View File

@ -47,7 +47,7 @@ public:
/** Construct a script from the given list of command lines. */ /** Construct a script from the given list of command lines. */
std::string ConstructScript(cmCustomCommand const& cc, std::string ConstructScript(cmCustomCommand const& cc,
const char* configName, const std::string& configName,
const char* newline = "\n"); const char* newline = "\n");
/** Label to which to jump in a batch file after a failed step in a /** Label to which to jump in a batch file after a failed step in a
@ -67,7 +67,8 @@ protected:
/** Construct a custom command to make exe import lib dir. */ /** Construct a custom command to make exe import lib dir. */
cmsys::auto_ptr<cmCustomCommand> cmsys::auto_ptr<cmCustomCommand>
MaybeCreateImplibDir(cmTarget& target, const char* config, bool isFortran); MaybeCreateImplibDir(cmTarget& target, const std::string& config,
bool isFortran);
VSVersion Version; VSVersion Version;
}; };

View File

@ -54,7 +54,7 @@ void cmLocalXCodeGenerator::Generate()
iter != targets.end(); ++iter) iter != targets.end(); ++iter)
{ {
cmTarget* t = &iter->second; cmTarget* t = &iter->second;
t->HasMacOSXRpathInstallNameDir(NULL); t->HasMacOSXRpathInstallNameDir("");
} }
} }
@ -68,6 +68,6 @@ void cmLocalXCodeGenerator::GenerateInstallRules()
iter != targets.end(); ++iter) iter != targets.end(); ++iter)
{ {
cmTarget* t = &iter->second; cmTarget* t = &iter->second;
t->HasMacOSXRpathInstallNameDir(NULL); t->HasMacOSXRpathInstallNameDir("");
} }
} }

View File

@ -2734,7 +2734,7 @@ void cmMakefile::AddDefaultDefinitions()
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char* std::string
cmMakefile::GetConfigurations(std::vector<std::string>& configs, cmMakefile::GetConfigurations(std::vector<std::string>& configs,
bool single) const bool single) const
{ {
@ -2745,12 +2745,12 @@ cmMakefile::GetConfigurations(std::vector<std::string>& configs,
{ {
cmSystemTools::ExpandListArgument(configTypes, configs); cmSystemTools::ExpandListArgument(configTypes, configs);
} }
return 0; return "";
} }
else else
{ {
const char* buildType = this->GetDefinition("CMAKE_BUILD_TYPE"); const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE");
if(single && buildType && *buildType) if(single && !buildType.empty())
{ {
configs.push_back(buildType); configs.push_back(buildType);
} }
@ -3801,11 +3801,12 @@ bool cmMakefile::GetPropertyAsBool(const std::string& prop) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char* cmMakefile::GetFeature(const char* feature, const char* config) const char* cmMakefile::GetFeature(const char* feature,
const std::string& config)
{ {
// TODO: Define accumulation policy for features (prepend, append, replace). // TODO: Define accumulation policy for features (prepend, append, replace).
// Currently we always replace. // Currently we always replace.
if(config && *config) if(!config.empty())
{ {
std::string featureConfig = feature; std::string featureConfig = feature;
featureConfig += "_"; featureConfig += "_";

View File

@ -320,7 +320,7 @@ public:
} }
/** Get the configurations to be generated. */ /** Get the configurations to be generated. */
const char* GetConfigurations(std::vector<std::string>& configs, std::string GetConfigurations(std::vector<std::string>& configs,
bool single = true) const; bool single = true) const;
/** /**
@ -811,7 +811,7 @@ public:
cmProperty::ScopeType scope) const; cmProperty::ScopeType scope) const;
bool GetPropertyAsBool(const std::string& prop) const; bool GetPropertyAsBool(const std::string& prop) const;
const char* GetFeature(const char* feature, const char* config); const char* GetFeature(const char* feature, const std::string& config);
// Get the properties // Get the properties
cmPropertyMap &GetProperties() { return this->Properties; }; cmPropertyMap &GetProperties() { return this->Properties; };

View File

@ -133,7 +133,8 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
this->Makefile->GetProperty this->Makefile->GetProperty
("ADDITIONAL_MAKE_CLEAN_FILES")) ("ADDITIONAL_MAKE_CLEAN_FILES"))
{ {
const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); const std::string& config =
this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
cmListFileBacktrace lfbt; cmListFileBacktrace lfbt;
cmGeneratorExpression ge(lfbt); cmGeneratorExpression ge(lfbt);
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
@ -1070,7 +1071,8 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
<< "set(CMAKE_C_TARGET_INCLUDE_PATH\n"; << "set(CMAKE_C_TARGET_INCLUDE_PATH\n";
std::vector<std::string> includes; std::vector<std::string> includes;
const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); const std::string& config =
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
this->LocalGenerator->GetIncludeDirectories(includes, this->LocalGenerator->GetIncludeDirectories(includes,
this->GeneratorTarget, this->GeneratorTarget,
"C", config); "C", config);
@ -1567,7 +1569,8 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags(std::string const& l)
#endif #endif
std::vector<std::string> includes; std::vector<std::string> includes;
const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); const std::string& config =
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
this->LocalGenerator->GetIncludeDirectories(includes, this->LocalGenerator->GetIncludeDirectories(includes,
this->GeneratorTarget, this->GeneratorTarget,
"C", config); "C", config);
@ -1952,7 +1955,8 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
std::vector<std::string> includes; std::vector<std::string> includes;
const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); const std::string& config =
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
this->LocalGenerator->GetIncludeDirectories(includes, this->LocalGenerator->GetIncludeDirectories(includes,
this->GeneratorTarget, this->GeneratorTarget,
lang, config); lang, config);
@ -2059,7 +2063,8 @@ void cmMakefileTargetGenerator::AddFortranFlags(std::string& flags)
this->Makefile->GetDefinition("CMAKE_Fortran_MODPATH_FLAG")) this->Makefile->GetDefinition("CMAKE_Fortran_MODPATH_FLAG"))
{ {
std::vector<std::string> includes; std::vector<std::string> includes;
const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); const std::string& config =
this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
this->LocalGenerator->GetIncludeDirectories(includes, this->LocalGenerator->GetIncludeDirectories(includes,
this->GeneratorTarget, this->GeneratorTarget,
"C", config); "C", config);

View File

@ -183,7 +183,7 @@ protected:
cmLocalUnixMakefileGenerator3 *LocalGenerator; cmLocalUnixMakefileGenerator3 *LocalGenerator;
cmGlobalUnixMakefileGenerator3 *GlobalGenerator; cmGlobalUnixMakefileGenerator3 *GlobalGenerator;
cmMakefile *Makefile; cmMakefile *Makefile;
const char *ConfigName; std::string ConfigName;
enum CustomCommandDriveType { OnBuild, OnDepends, OnUtility }; enum CustomCommandDriveType { OnBuild, OnDepends, OnUtility };
CustomCommandDriveType CustomCommandDriver; CustomCommandDriveType CustomCommandDriver;

View File

@ -19,7 +19,7 @@
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmOSXBundleGenerator:: cmOSXBundleGenerator::
cmOSXBundleGenerator(cmGeneratorTarget* target, cmOSXBundleGenerator(cmGeneratorTarget* target,
const char* configName) const std::string& configName)
: GT(target) : GT(target)
, Makefile(target->Target->GetMakefile()) , Makefile(target->Target->GetMakefile())
, LocalGenerator(Makefile->GetLocalGenerator()) , LocalGenerator(Makefile->GetLocalGenerator())

View File

@ -27,7 +27,7 @@ class cmOSXBundleGenerator
{ {
public: public:
cmOSXBundleGenerator(cmGeneratorTarget* target, cmOSXBundleGenerator(cmGeneratorTarget* target,
const char* configName); const std::string& configName);
// create an app bundle at a given root, and return // create an app bundle at a given root, and return
// the directory within the bundle that contains the executable // the directory within the bundle that contains the executable
@ -62,7 +62,7 @@ private:
cmGeneratorTarget* GT; cmGeneratorTarget* GT;
cmMakefile* Makefile; cmMakefile* Makefile;
cmLocalGenerator* LocalGenerator; cmLocalGenerator* LocalGenerator;
const char* ConfigName; std::string ConfigName;
std::set<std::string>* MacContentFolders; std::set<std::string>* MacContentFolders;
}; };

View File

@ -306,7 +306,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
} }
static void GetCompileDefinitionsAndDirectories(cmTarget const* target, static void GetCompileDefinitionsAndDirectories(cmTarget const* target,
const char * config, const std::string& config,
std::string &incs, std::string &incs,
std::string &defs) std::string &defs)
{ {
@ -366,7 +366,7 @@ void cmQtAutoGenerators::SetupAutoGenerateTarget(cmTarget const* target)
qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR"); qtVersion = makefile->GetDefinition("QT_VERSION_MAJOR");
} }
if (const char *targetQtVersion = if (const char *targetQtVersion =
target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", 0)) target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", ""))
{ {
qtVersion = targetQtVersion; qtVersion = targetQtVersion;
} }
@ -563,7 +563,7 @@ void cmQtAutoGenerators::SetupAutoMocTarget(cmTarget const* target,
std::string _moc_incs; std::string _moc_incs;
std::string _moc_compile_defs; std::string _moc_compile_defs;
std::vector<std::string> configs; std::vector<std::string> configs;
const char *config = makefile->GetConfigurations(configs); const std::string& config = makefile->GetConfigurations(configs);
GetCompileDefinitionsAndDirectories(target, config, GetCompileDefinitionsAndDirectories(target, config,
_moc_incs, _moc_compile_defs); _moc_incs, _moc_compile_defs);
@ -675,7 +675,7 @@ void cmQtAutoGenerators::MergeUicOptions(std::vector<std::string> &opts,
opts.insert(opts.end(), extraOpts.begin(), extraOpts.end()); opts.insert(opts.end(), extraOpts.begin(), extraOpts.end());
} }
static void GetUicOpts(cmTarget const* target, const char * config, static void GetUicOpts(cmTarget const* target, const std::string& config,
std::string &optString) std::string &optString)
{ {
std::vector<std::string> opts; std::vector<std::string> opts;
@ -717,7 +717,7 @@ void cmQtAutoGenerators::SetupAutoUicTarget(cmTarget const* target,
std::string _uic_opts; std::string _uic_opts;
std::vector<std::string> configs; std::vector<std::string> configs;
const char *config = makefile->GetConfigurations(configs); const std::string& config = makefile->GetConfigurations(configs);
GetUicOpts(target, config, _uic_opts); GetUicOpts(target, config, _uic_opts);
if (!_uic_opts.empty()) if (!_uic_opts.empty())
@ -967,7 +967,8 @@ static cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
return gg; return gg;
} }
bool cmQtAutoGenerators::Run(const char* targetDirectory, const char *config) bool cmQtAutoGenerators::Run(const char* targetDirectory,
const std::string& config)
{ {
bool success = true; bool success = true;
cmake cm; cmake cm;
@ -994,7 +995,7 @@ bool cmQtAutoGenerators::Run(const char* targetDirectory, const char *config)
bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile, bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
const char* targetDirectory, const char* targetDirectory,
const char *config) const std::string& config)
{ {
std::string filename(cmSystemTools::CollapseFullPath(targetDirectory)); std::string filename(cmSystemTools::CollapseFullPath(targetDirectory));
cmSystemTools::ConvertToUnixSlashes(filename); cmSystemTools::ConvertToUnixSlashes(filename);
@ -1027,7 +1028,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
{ {
std::string compileDefsPropOrig = "AM_MOC_COMPILE_DEFINITIONS"; std::string compileDefsPropOrig = "AM_MOC_COMPILE_DEFINITIONS";
std::string compileDefsProp = compileDefsPropOrig; std::string compileDefsProp = compileDefsPropOrig;
if(config) if(!config.empty())
{ {
compileDefsProp += "_"; compileDefsProp += "_";
compileDefsProp += config; compileDefsProp += config;
@ -1039,7 +1040,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
{ {
std::string includesPropOrig = "AM_MOC_INCLUDES"; std::string includesPropOrig = "AM_MOC_INCLUDES";
std::string includesProp = includesPropOrig; std::string includesProp = includesPropOrig;
if(config) if(!config.empty())
{ {
includesProp += "_"; includesProp += "_";
includesProp += config; includesProp += config;
@ -1058,7 +1059,7 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(cmMakefile* makefile,
= makefile->GetSafeDefinition("AM_UIC_OPTIONS_FILES"); = makefile->GetSafeDefinition("AM_UIC_OPTIONS_FILES");
std::string uicOptionsPropOrig = "AM_UIC_TARGET_OPTIONS"; std::string uicOptionsPropOrig = "AM_UIC_TARGET_OPTIONS";
std::string uicOptionsProp = uicOptionsPropOrig; std::string uicOptionsProp = uicOptionsPropOrig;
if(config) if(!config.empty())
{ {
uicOptionsProp += "_"; uicOptionsProp += "_";
uicOptionsProp += config; uicOptionsProp += config;

View File

@ -21,7 +21,7 @@ class cmQtAutoGenerators
{ {
public: public:
cmQtAutoGenerators(); cmQtAutoGenerators();
bool Run(const char* targetDirectory, const char *config); bool Run(const char* targetDirectory, const std::string& config);
bool InitializeAutogenTarget(cmTarget* target); bool InitializeAutogenTarget(cmTarget* target);
void SetupAutoGenerateTarget(cmTarget const* target); void SetupAutoGenerateTarget(cmTarget const* target);
@ -38,7 +38,7 @@ private:
bool ReadAutogenInfoFile(cmMakefile* makefile, bool ReadAutogenInfoFile(cmMakefile* makefile,
const char* targetDirectory, const char* targetDirectory,
const char *config); const std::string& config);
bool ReadOldMocDefinitionsFile(cmMakefile* makefile, bool ReadOldMocDefinitionsFile(cmMakefile* makefile,
const char* targetDirectory); const char* targetDirectory);
void WriteOldMocDefinitionsFile(const char* targetDirectory); void WriteOldMocDefinitionsFile(const char* targetDirectory);

View File

@ -19,7 +19,7 @@ cmScriptGenerator
std::vector<std::string> const& configurations): std::vector<std::string> const& configurations):
RuntimeConfigVariable(config_var), RuntimeConfigVariable(config_var),
Configurations(configurations), Configurations(configurations),
ConfigurationName(0), ConfigurationName(""),
ConfigurationTypes(0), ConfigurationTypes(0),
ActionsPerConfig(false) ActionsPerConfig(false)
{ {
@ -34,21 +34,21 @@ cmScriptGenerator
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmScriptGenerator cmScriptGenerator
::Generate(std::ostream& os, const char* config, ::Generate(std::ostream& os, const std::string& config,
std::vector<std::string> const& configurationTypes) std::vector<std::string> const& configurationTypes)
{ {
this->ConfigurationName = config; this->ConfigurationName = config;
this->ConfigurationTypes = &configurationTypes; this->ConfigurationTypes = &configurationTypes;
this->GenerateScript(os); this->GenerateScript(os);
this->ConfigurationName = 0; this->ConfigurationName = "";
this->ConfigurationTypes = 0; this->ConfigurationTypes = 0;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static void cmScriptGeneratorEncodeConfig(const char* config, static void cmScriptGeneratorEncodeConfig(const std::string& config,
std::string& result) std::string& result)
{ {
for(const char* c = config; *c; ++c) for(const char* c = config.c_str(); *c; ++c)
{ {
if(*c >= 'a' && *c <= 'z') if(*c >= 'a' && *c <= 'z')
{ {
@ -73,12 +73,12 @@ static void cmScriptGeneratorEncodeConfig(const char* config,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string std::string
cmScriptGenerator::CreateConfigTest(const char* config) cmScriptGenerator::CreateConfigTest(const std::string& config)
{ {
std::string result = "\"${"; std::string result = "\"${";
result += this->RuntimeConfigVariable; result += this->RuntimeConfigVariable;
result += "}\" MATCHES \"^("; result += "}\" MATCHES \"^(";
if(config && *config) if(!config.empty())
{ {
cmScriptGeneratorEncodeConfig(config, result); cmScriptGeneratorEncodeConfig(config, result);
} }
@ -142,14 +142,15 @@ void cmScriptGenerator::GenerateScriptActions(std::ostream& os,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmScriptGenerator::GenerateScriptForConfig(std::ostream&, const char*, void cmScriptGenerator::GenerateScriptForConfig(std::ostream&,
const std::string&,
Indent const&) Indent const&)
{ {
// No actions for this generator. // No actions for this generator.
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmScriptGenerator::GeneratesForConfig(const char* config) bool cmScriptGenerator::GeneratesForConfig(const std::string& config)
{ {
// If this is not a configuration-specific rule then we install. // If this is not a configuration-specific rule then we install.
if(this->Configurations.empty()) if(this->Configurations.empty())
@ -159,7 +160,7 @@ bool cmScriptGenerator::GeneratesForConfig(const char* config)
// This is a configuration-specific rule. Check if the config // This is a configuration-specific rule. Check if the config
// matches this rule. // matches this rule.
std::string config_upper = cmSystemTools::UpperCase(config?config:""); std::string config_upper = cmSystemTools::UpperCase(config);
for(std::vector<std::string>::const_iterator i = for(std::vector<std::string>::const_iterator i =
this->Configurations.begin(); this->Configurations.begin();
i != this->Configurations.end(); ++i) i != this->Configurations.end(); ++i)

View File

@ -51,7 +51,7 @@ public:
std::vector<std::string> const& configurations); std::vector<std::string> const& configurations);
virtual ~cmScriptGenerator(); virtual ~cmScriptGenerator();
void Generate(std::ostream& os, const char* config, void Generate(std::ostream& os, const std::string& config,
std::vector<std::string> const& configurationTypes); std::vector<std::string> const& configurationTypes);
const std::vector<std::string>& GetConfigurations() const const std::vector<std::string>& GetConfigurations() const
@ -63,15 +63,15 @@ protected:
virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent); virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent);
virtual void GenerateScriptActions(std::ostream& os, Indent const& indent); virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
virtual void GenerateScriptForConfig(std::ostream& os, virtual void GenerateScriptForConfig(std::ostream& os,
const char* config, const std::string& config,
Indent const& indent); Indent const& indent);
virtual void GenerateScriptNoConfig(std::ostream&, Indent const&) {} virtual void GenerateScriptNoConfig(std::ostream&, Indent const&) {}
virtual bool NeedsScriptNoConfig() const { return false; } virtual bool NeedsScriptNoConfig() const { return false; }
// Test if this generator does something for a given configuration. // Test if this generator does something for a given configuration.
bool GeneratesForConfig(const char*); bool GeneratesForConfig(const std::string&);
std::string CreateConfigTest(const char* config); std::string CreateConfigTest(const std::string& config);
std::string CreateConfigTest(std::vector<std::string> const& configs); std::string CreateConfigTest(std::vector<std::string> const& configs);
std::string CreateComponentTest(const char* component); std::string CreateComponentTest(const char* component);
@ -80,7 +80,7 @@ protected:
std::vector<std::string> const Configurations; std::vector<std::string> const Configurations;
// Information used during generation. // Information used during generation.
const char* ConfigurationName; std::string ConfigurationName;
std::vector<std::string> const* ConfigurationTypes; std::vector<std::string> const* ConfigurationTypes;
// True if the subclass needs to generate an explicit rule for each // True if the subclass needs to generate an explicit rule for each

View File

@ -109,7 +109,8 @@ public:
const char* ExplicitLibraries; const char* ExplicitLibraries;
}; };
void ComputeLinkInterface(cmTarget const* thisTarget, void ComputeLinkInterface(cmTarget const* thisTarget,
const char* config, OptionalLinkInterface& iface, const std::string& config,
OptionalLinkInterface& iface,
cmTarget const* head, cmTarget const* head,
const char *explicitLibraries) const; const char *explicitLibraries) const;
@ -692,10 +693,11 @@ const std::vector<std::string>& cmTarget::GetLinkDirectories() const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget::LinkLibraryType cmTarget::ComputeLinkType(const char* config) const cmTarget::LinkLibraryType cmTarget::ComputeLinkType(
const std::string& config) const
{ {
// No configuration is always optimized. // No configuration is always optimized.
if(!(config && *config)) if(config.empty())
{ {
return cmTarget::OPTIMIZED; return cmTarget::OPTIMIZED;
} }
@ -755,7 +757,7 @@ bool cmTarget::NameResolvesToFramework(const std::string& libname) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::GetDirectLinkLibraries(const char *config, void cmTarget::GetDirectLinkLibraries(const std::string& config,
std::vector<std::string> &libs, std::vector<std::string> &libs,
cmTarget const* head) const cmTarget const* head) const
{ {
@ -789,7 +791,7 @@ void cmTarget::GetDirectLinkLibraries(const char *config,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::GetInterfaceLinkLibraries(const char *config, void cmTarget::GetInterfaceLinkLibraries(const std::string& config,
std::vector<std::string> &libs, std::vector<std::string> &libs,
cmTarget const* head) const cmTarget const* head) const
{ {
@ -1565,7 +1567,7 @@ static void processIncludeDirectories(cmTarget const* tgt,
std::vector<std::string> &includes, std::vector<std::string> &includes,
std::set<std::string> &uniqueIncludes, std::set<std::string> &uniqueIncludes,
cmGeneratorExpressionDAGChecker *dagChecker, cmGeneratorExpressionDAGChecker *dagChecker,
const char *config, bool debugIncludes) const std::string& config, bool debugIncludes)
{ {
cmMakefile *mf = tgt->GetMakefile(); cmMakefile *mf = tgt->GetMakefile();
@ -1730,7 +1732,7 @@ static void processIncludeDirectories(cmTarget const* tgt,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::vector<std::string> std::vector<std::string>
cmTarget::GetIncludeDirectories(const char *config) const cmTarget::GetIncludeDirectories(const std::string& config) const
{ {
std::vector<std::string> includes; std::vector<std::string> includes;
std::set<std::string> uniqueIncludes; std::set<std::string> uniqueIncludes;
@ -1767,8 +1769,7 @@ cmTarget::GetIncludeDirectories(const char *config) const
config, config,
debugIncludes); debugIncludes);
std::string configString = config ? config : ""; if (!this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[config])
if (!this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString])
{ {
for (std::vector<cmValueWithOrigin>::const_iterator for (std::vector<cmValueWithOrigin>::const_iterator
it = this->Internal->LinkImplementationPropertyEntries.begin(), it = this->Internal->LinkImplementationPropertyEntries.begin(),
@ -1805,7 +1806,7 @@ cmTarget::GetIncludeDirectories(const char *config) const
includeGenex); includeGenex);
this->Internal this->Internal
->CachedLinkInterfaceIncludeDirectoriesEntries[configString].push_back( ->CachedLinkInterfaceIncludeDirectoriesEntries[config].push_back(
new cmTargetInternals::TargetPropertyEntry(cge, new cmTargetInternals::TargetPropertyEntry(cge,
it->Value)); it->Value));
} }
@ -1833,14 +1834,14 @@ cmTarget::GetIncludeDirectories(const char *config) const
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(libDir.c_str()); ge.Parse(libDir.c_str());
this->Internal this->Internal
->CachedLinkInterfaceIncludeDirectoriesEntries[configString] ->CachedLinkInterfaceIncludeDirectoriesEntries[config]
.push_back(new cmTargetInternals::TargetPropertyEntry(cge)); .push_back(new cmTargetInternals::TargetPropertyEntry(cge));
} }
} }
} }
processIncludeDirectories(this, processIncludeDirectories(this,
this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries[configString], this->Internal->CachedLinkInterfaceIncludeDirectoriesEntries[config],
includes, includes,
uniqueIncludes, uniqueIncludes,
&dagChecker, &dagChecker,
@ -1854,7 +1855,7 @@ cmTarget::GetIncludeDirectories(const char *config) const
} }
else else
{ {
this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[configString] this->Internal->CacheLinkInterfaceIncludeDirectoriesDone[config]
= true; = true;
} }
@ -1867,7 +1868,7 @@ static void processCompileOptionsInternal(cmTarget const* tgt,
std::vector<std::string> &options, std::vector<std::string> &options,
std::set<std::string> &uniqueOptions, std::set<std::string> &uniqueOptions,
cmGeneratorExpressionDAGChecker *dagChecker, cmGeneratorExpressionDAGChecker *dagChecker,
const char *config, bool debugOptions, const char *logName) const std::string& config, bool debugOptions, const char *logName)
{ {
cmMakefile *mf = tgt->GetMakefile(); cmMakefile *mf = tgt->GetMakefile();
@ -1926,7 +1927,7 @@ static void processCompileOptions(cmTarget const* tgt,
std::vector<std::string> &options, std::vector<std::string> &options,
std::set<std::string> &uniqueOptions, std::set<std::string> &uniqueOptions,
cmGeneratorExpressionDAGChecker *dagChecker, cmGeneratorExpressionDAGChecker *dagChecker,
const char *config, bool debugOptions) const std::string& config, bool debugOptions)
{ {
processCompileOptionsInternal(tgt, entries, options, uniqueOptions, processCompileOptionsInternal(tgt, entries, options, uniqueOptions,
dagChecker, config, debugOptions, "options"); dagChecker, config, debugOptions, "options");
@ -1934,7 +1935,7 @@ static void processCompileOptions(cmTarget const* tgt,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::GetAutoUicOptions(std::vector<std::string> &result, void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
const char *config) const const std::string& config) const
{ {
const char *prop const char *prop
= this->GetLinkInterfaceDependentStringProperty("AUTOUIC_OPTIONS", = this->GetLinkInterfaceDependentStringProperty("AUTOUIC_OPTIONS",
@ -1960,7 +1961,7 @@ void cmTarget::GetAutoUicOptions(std::vector<std::string> &result,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::GetCompileOptions(std::vector<std::string> &result, void cmTarget::GetCompileOptions(std::vector<std::string> &result,
const char *config) const const std::string& config) const
{ {
std::set<std::string> uniqueOptions; std::set<std::string> uniqueOptions;
cmListFileBacktrace lfbt; cmListFileBacktrace lfbt;
@ -1996,8 +1997,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
config, config,
debugOptions); debugOptions);
std::string configString = config ? config : ""; if (!this->Internal->CacheLinkInterfaceCompileOptionsDone[config])
if (!this->Internal->CacheLinkInterfaceCompileOptionsDone[configString])
{ {
for (std::vector<cmValueWithOrigin>::const_iterator for (std::vector<cmValueWithOrigin>::const_iterator
it = this->Internal->LinkImplementationPropertyEntries.begin(), it = this->Internal->LinkImplementationPropertyEntries.begin(),
@ -2034,14 +2034,14 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
optionGenex); optionGenex);
this->Internal this->Internal
->CachedLinkInterfaceCompileOptionsEntries[configString].push_back( ->CachedLinkInterfaceCompileOptionsEntries[config].push_back(
new cmTargetInternals::TargetPropertyEntry(cge, new cmTargetInternals::TargetPropertyEntry(cge,
it->Value)); it->Value));
} }
} }
processCompileOptions(this, processCompileOptions(this,
this->Internal->CachedLinkInterfaceCompileOptionsEntries[configString], this->Internal->CachedLinkInterfaceCompileOptionsEntries[config],
result, result,
uniqueOptions, uniqueOptions,
&dagChecker, &dagChecker,
@ -2054,7 +2054,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
} }
else else
{ {
this->Internal->CacheLinkInterfaceCompileOptionsDone[configString] = true; this->Internal->CacheLinkInterfaceCompileOptionsDone[config] = true;
} }
} }
@ -2064,7 +2064,7 @@ static void processCompileDefinitions(cmTarget const* tgt,
std::vector<std::string> &options, std::vector<std::string> &options,
std::set<std::string> &uniqueOptions, std::set<std::string> &uniqueOptions,
cmGeneratorExpressionDAGChecker *dagChecker, cmGeneratorExpressionDAGChecker *dagChecker,
const char *config, bool debugOptions) const std::string& config, bool debugOptions)
{ {
processCompileOptionsInternal(tgt, entries, options, uniqueOptions, processCompileOptionsInternal(tgt, entries, options, uniqueOptions,
dagChecker, config, debugOptions, dagChecker, config, debugOptions,
@ -2073,7 +2073,7 @@ static void processCompileDefinitions(cmTarget const* tgt,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::GetCompileDefinitions(std::vector<std::string> &list, void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
const char *config) const const std::string& config) const
{ {
std::set<std::string> uniqueOptions; std::set<std::string> uniqueOptions;
cmListFileBacktrace lfbt; cmListFileBacktrace lfbt;
@ -2109,8 +2109,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
config, config,
debugDefines); debugDefines);
std::string configString = config ? config : ""; if (!this->Internal->CacheLinkInterfaceCompileDefinitionsDone[config])
if (!this->Internal->CacheLinkInterfaceCompileDefinitionsDone[configString])
{ {
for (std::vector<cmValueWithOrigin>::const_iterator for (std::vector<cmValueWithOrigin>::const_iterator
it = this->Internal->LinkImplementationPropertyEntries.begin(), it = this->Internal->LinkImplementationPropertyEntries.begin(),
@ -2147,11 +2146,11 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
defsGenex); defsGenex);
this->Internal this->Internal
->CachedLinkInterfaceCompileDefinitionsEntries[configString].push_back( ->CachedLinkInterfaceCompileDefinitionsEntries[config].push_back(
new cmTargetInternals::TargetPropertyEntry(cge, new cmTargetInternals::TargetPropertyEntry(cge,
it->Value)); it->Value));
} }
if (config) if (!config.empty())
{ {
std::string configPropName = "COMPILE_DEFINITIONS_" std::string configPropName = "COMPILE_DEFINITIONS_"
+ cmSystemTools::UpperCase(config); + cmSystemTools::UpperCase(config);
@ -2174,7 +2173,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
ge.Parse(configProp); ge.Parse(configProp);
this->Internal this->Internal
->CachedLinkInterfaceCompileDefinitionsEntries[configString] ->CachedLinkInterfaceCompileDefinitionsEntries[config]
.push_back(new cmTargetInternals::TargetPropertyEntry(cge)); .push_back(new cmTargetInternals::TargetPropertyEntry(cge));
} }
break; break;
@ -2189,7 +2188,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
} }
processCompileDefinitions(this, processCompileDefinitions(this,
this->Internal->CachedLinkInterfaceCompileDefinitionsEntries[configString], this->Internal->CachedLinkInterfaceCompileDefinitionsEntries[config],
list, list,
uniqueOptions, uniqueOptions,
&dagChecker, &dagChecker,
@ -2203,7 +2202,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
} }
else else
{ {
this->Internal->CacheLinkInterfaceCompileDefinitionsDone[configString] this->Internal->CacheLinkInterfaceCompileDefinitionsDone[config]
= true; = true;
} }
} }
@ -2333,7 +2332,8 @@ bool cmTarget::HaveWellDefinedOutputFiles() const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config) const cmTarget::OutputInfo const* cmTarget::GetOutputInfo(
const std::string& config) const
{ {
// There is no output information for imported targets. // There is no output information for imported targets.
if(this->IsImported()) if(this->IsImported())
@ -2355,7 +2355,7 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config) const
// Lookup/compute/cache the output information for this configuration. // Lookup/compute/cache the output information for this configuration.
std::string config_upper; std::string config_upper;
if(config && *config) if(!config.empty())
{ {
config_upper = cmSystemTools::UpperCase(config); config_upper = cmSystemTools::UpperCase(config);
} }
@ -2378,7 +2378,8 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget::CompileInfo const* cmTarget::GetCompileInfo(const char* config) const cmTarget::CompileInfo const* cmTarget::GetCompileInfo(
const std::string& config) const
{ {
// There is no compile information for imported targets. // There is no compile information for imported targets.
if(this->IsImported()) if(this->IsImported())
@ -2399,7 +2400,7 @@ cmTarget::CompileInfo const* cmTarget::GetCompileInfo(const char* config) const
// Lookup/compute/cache the compile information for this configuration. // Lookup/compute/cache the compile information for this configuration.
std::string config_upper; std::string config_upper;
if(config && *config) if(!config.empty())
{ {
config_upper = cmSystemTools::UpperCase(config); config_upper = cmSystemTools::UpperCase(config);
} }
@ -2417,7 +2418,8 @@ cmTarget::CompileInfo const* cmTarget::GetCompileInfo(const char* config) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetDirectory(const char* config, bool implib) const std::string cmTarget::GetDirectory(const std::string& config,
bool implib) const
{ {
if (this->IsImported()) if (this->IsImported())
{ {
@ -2435,7 +2437,7 @@ std::string cmTarget::GetDirectory(const char* config, bool implib) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetPDBDirectory(const char* config) const std::string cmTarget::GetPDBDirectory(const std::string& config) const
{ {
if(OutputInfo const* info = this->GetOutputInfo(config)) if(OutputInfo const* info = this->GetOutputInfo(config))
{ {
@ -2446,7 +2448,7 @@ std::string cmTarget::GetPDBDirectory(const char* config) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetCompilePDBDirectory(const char* config) const std::string cmTarget::GetCompilePDBDirectory(const std::string& config) const
{ {
if(CompileInfo const* info = this->GetCompileInfo(config)) if(CompileInfo const* info = this->GetCompileInfo(config))
{ {
@ -2456,7 +2458,7 @@ std::string cmTarget::GetCompilePDBDirectory(const char* config) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char* cmTarget::GetLocation(const char* config) const const char* cmTarget::GetLocation(const std::string& config) const
{ {
static std::string location; static std::string location;
if (this->IsImported()) if (this->IsImported())
@ -2547,9 +2549,10 @@ void cmTarget::GetTargetVersion(bool soversion,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char* cmTarget::GetFeature(const char* feature, const char* config) const const char* cmTarget::GetFeature(const char* feature,
const std::string& config) const
{ {
if(config && *config) if(!config.empty())
{ {
std::string featureConfig = feature; std::string featureConfig = feature;
featureConfig += "_"; featureConfig += "_";
@ -2798,7 +2801,8 @@ bool cmTarget::GetPropertyAsBool(const std::string& prop) const
class cmTargetCollectLinkLanguages class cmTargetCollectLinkLanguages
{ {
public: public:
cmTargetCollectLinkLanguages(cmTarget const* target, const char* config, cmTargetCollectLinkLanguages(cmTarget const* target,
const std::string& config,
std::set<std::string>& languages, std::set<std::string>& languages,
cmTarget const* head): cmTarget const* head):
Config(config), Languages(languages), HeadTarget(head), Config(config), Languages(languages), HeadTarget(head),
@ -2870,7 +2874,7 @@ public:
} }
} }
private: private:
const char* Config; std::string Config;
std::set<std::string>& Languages; std::set<std::string>& Languages;
cmTarget const* HeadTarget; cmTarget const* HeadTarget;
cmMakefile* Makefile; cmMakefile* Makefile;
@ -2879,7 +2883,7 @@ private:
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetLinkerLanguage(const char* config, std::string cmTarget::GetLinkerLanguage(const std::string& config,
cmTarget const* head) const cmTarget const* head) const
{ {
cmTarget const* headTarget = head ? head : this; cmTarget const* headTarget = head ? head : this;
@ -2887,10 +2891,11 @@ std::string cmTarget::GetLinkerLanguage(const char* config,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget::LinkClosure const* cmTarget::GetLinkClosure(const char* config, cmTarget::LinkClosure const* cmTarget::GetLinkClosure(
const std::string& config,
cmTarget const* head) const cmTarget const* head) const
{ {
TargetConfigPair key(head, cmSystemTools::UpperCase(config ? config : "")); TargetConfigPair key(head, cmSystemTools::UpperCase(config));
cmTargetInternals::LinkClosureMapType::iterator cmTargetInternals::LinkClosureMapType::iterator
i = this->Internal->LinkClosureMap.find(key); i = this->Internal->LinkClosureMap.find(key);
if(i == this->Internal->LinkClosureMap.end()) if(i == this->Internal->LinkClosureMap.end())
@ -2957,7 +2962,7 @@ public:
}; };
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::ComputeLinkClosure(const char* config, LinkClosure& lc, void cmTarget::ComputeLinkClosure(const std::string& config, LinkClosure& lc,
cmTarget const* head) const cmTarget const* head) const
{ {
// Get languages built in this target. // Get languages built in this target.
@ -3070,7 +3075,7 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetPDBName(const char* config) const std::string cmTarget::GetPDBName(const std::string& config) const
{ {
std::string prefix; std::string prefix;
std::string base; std::string base;
@ -3078,8 +3083,7 @@ std::string cmTarget::GetPDBName(const char* config) const
this->GetFullNameInternal(config, false, prefix, base, suffix); this->GetFullNameInternal(config, false, prefix, base, suffix);
std::vector<std::string> props; std::vector<std::string> props;
std::string configUpper = std::string configUpper = cmSystemTools::UpperCase(config);
cmSystemTools::UpperCase(config? config : "");
if(!configUpper.empty()) if(!configUpper.empty())
{ {
// PDB_NAME_<CONFIG> // PDB_NAME_<CONFIG>
@ -3102,7 +3106,7 @@ std::string cmTarget::GetPDBName(const char* config) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetCompilePDBName(const char* config) const std::string cmTarget::GetCompilePDBName(const std::string& config) const
{ {
std::string prefix; std::string prefix;
std::string base; std::string base;
@ -3110,7 +3114,7 @@ std::string cmTarget::GetCompilePDBName(const char* config) const
this->GetFullNameInternal(config, false, prefix, base, suffix); this->GetFullNameInternal(config, false, prefix, base, suffix);
// Check for a per-configuration output directory target property. // Check for a per-configuration output directory target property.
std::string configUpper = cmSystemTools::UpperCase(config? config : ""); std::string configUpper = cmSystemTools::UpperCase(config);
std::string configProp = "COMPILE_PDB_NAME_"; std::string configProp = "COMPILE_PDB_NAME_";
configProp += configUpper; configProp += configUpper;
const char* config_name = this->GetProperty(configProp.c_str()); const char* config_name = this->GetProperty(configProp.c_str());
@ -3129,7 +3133,7 @@ std::string cmTarget::GetCompilePDBName(const char* config) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetCompilePDBPath(const char* config) const std::string cmTarget::GetCompilePDBPath(const std::string& config) const
{ {
std::string dir = this->GetCompilePDBDirectory(config); std::string dir = this->GetCompilePDBDirectory(config);
std::string name = this->GetCompilePDBName(config); std::string name = this->GetCompilePDBName(config);
@ -3145,7 +3149,7 @@ std::string cmTarget::GetCompilePDBPath(const char* config) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::HasSOName(const char* config) const bool cmTarget::HasSOName(const std::string& config) const
{ {
// soname is supported only for shared libraries and modules, // soname is supported only for shared libraries and modules,
// and then only when the platform supports an soname flag. // and then only when the platform supports an soname flag.
@ -3157,7 +3161,7 @@ bool cmTarget::HasSOName(const char* config) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetSOName(const char* config) const std::string cmTarget::GetSOName(const std::string& config) const
{ {
if(this->IsImported()) if(this->IsImported())
{ {
@ -3199,7 +3203,7 @@ std::string cmTarget::GetSOName(const char* config) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::HasMacOSXRpathInstallNameDir(const char* config) const bool cmTarget::HasMacOSXRpathInstallNameDir(const std::string& config) const
{ {
bool install_name_is_rpath = false; bool install_name_is_rpath = false;
bool macosx_rpath = false; bool macosx_rpath = false;
@ -3311,7 +3315,8 @@ bool cmTarget::MacOSXRpathInstallNameDirDefault() const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config) const bool cmTarget::IsImportedSharedLibWithoutSOName(
const std::string& config) const
{ {
if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY) if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY)
{ {
@ -3324,7 +3329,7 @@ bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::NormalGetRealName(const char* config) const std::string cmTarget::NormalGetRealName(const std::string& config) const
{ {
// This should not be called for imported targets. // This should not be called for imported targets.
// TODO: Split cmTarget into a class hierarchy to get compile-time // TODO: Split cmTarget into a class hierarchy to get compile-time
@ -3362,7 +3367,8 @@ std::string cmTarget::NormalGetRealName(const char* config) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetFullName(const char* config, bool implib) const std::string cmTarget::GetFullName(const std::string& config,
bool implib) const
{ {
if(this->IsImported()) if(this->IsImported())
{ {
@ -3376,7 +3382,7 @@ std::string cmTarget::GetFullName(const char* config, bool implib) const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string std::string
cmTarget::GetFullNameImported(const char* config, bool implib) const cmTarget::GetFullNameImported(const std::string& config, bool implib) const
{ {
return cmSystemTools::GetFilenameName( return cmSystemTools::GetFilenameName(
this->ImportedGetFullPath(config, implib)); this->ImportedGetFullPath(config, implib));
@ -3384,14 +3390,15 @@ cmTarget::GetFullNameImported(const char* config, bool implib) const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::GetFullNameComponents(std::string& prefix, std::string& base, void cmTarget::GetFullNameComponents(std::string& prefix, std::string& base,
std::string& suffix, const char* config, std::string& suffix,
const std::string& config,
bool implib) const bool implib) const
{ {
this->GetFullNameInternal(config, implib, prefix, base, suffix); this->GetFullNameInternal(config, implib, prefix, base, suffix);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetFullPath(const char* config, bool implib, std::string cmTarget::GetFullPath(const std::string& config, bool implib,
bool realname) const bool realname) const
{ {
if(this->IsImported()) if(this->IsImported())
@ -3405,8 +3412,8 @@ std::string cmTarget::GetFullPath(const char* config, bool implib,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::NormalGetFullPath(const char* config, bool implib, std::string cmTarget::NormalGetFullPath(const std::string& config,
bool realname) const bool implib, bool realname) const
{ {
std::string fpath = this->GetDirectory(config, implib); std::string fpath = this->GetDirectory(config, implib);
fpath += "/"; fpath += "/";
@ -3434,7 +3441,7 @@ std::string cmTarget::NormalGetFullPath(const char* config, bool implib,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string std::string
cmTarget::ImportedGetFullPath(const char* config, bool implib) const cmTarget::ImportedGetFullPath(const std::string& config, bool implib) const
{ {
std::string result; std::string result;
if(cmTarget::ImportInfo const* info = this->GetImportInfo(config, this)) if(cmTarget::ImportInfo const* info = this->GetImportInfo(config, this))
@ -3451,7 +3458,7 @@ cmTarget::ImportedGetFullPath(const char* config, bool implib) const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string std::string
cmTarget::GetFullNameInternal(const char* config, bool implib) const cmTarget::GetFullNameInternal(const std::string& config, bool implib) const
{ {
std::string prefix; std::string prefix;
std::string base; std::string base;
@ -3461,7 +3468,7 @@ cmTarget::GetFullNameInternal(const char* config, bool implib) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::GetFullNameInternal(const char* config, void cmTarget::GetFullNameInternal(const std::string& config,
bool implib, bool implib,
std::string& outPrefix, std::string& outPrefix,
std::string& outBase, std::string& outBase,
@ -3507,7 +3514,7 @@ void cmTarget::GetFullNameInternal(const char* config,
? this->GetProperty("IMPORT_SUFFIX") ? this->GetProperty("IMPORT_SUFFIX")
: this->GetProperty("SUFFIX")); : this->GetProperty("SUFFIX"));
const char* configPostfix = 0; const char* configPostfix = 0;
if(config && *config) if(!config.empty())
{ {
std::string configProp = cmSystemTools::UpperCase(config); std::string configProp = cmSystemTools::UpperCase(config);
configProp += "_POSTFIX"; configProp += "_POSTFIX";
@ -3604,7 +3611,7 @@ void cmTarget::GetLibraryNames(std::string& name,
std::string& realName, std::string& realName,
std::string& impName, std::string& impName,
std::string& pdbName, std::string& pdbName,
const char* config) const const std::string& config) const
{ {
// This should not be called for imported targets. // This should not be called for imported targets.
// TODO: Split cmTarget into a class hierarchy to get compile-time // TODO: Split cmTarget into a class hierarchy to get compile-time
@ -3708,7 +3715,7 @@ void cmTarget::GetExecutableNames(std::string& name,
std::string& realName, std::string& realName,
std::string& impName, std::string& impName,
std::string& pdbName, std::string& pdbName,
const char* config) const const std::string& config) const
{ {
// This should not be called for imported targets. // This should not be called for imported targets.
// TODO: Split cmTarget into a class hierarchy to get compile-time // TODO: Split cmTarget into a class hierarchy to get compile-time
@ -3804,7 +3811,7 @@ void cmTarget::SetPropertyDefault(const std::string& property,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::HaveBuildTreeRPATH(const char *config) const bool cmTarget::HaveBuildTreeRPATH(const std::string& config) const
{ {
if (this->GetPropertyAsBool("SKIP_BUILD_RPATH")) if (this->GetPropertyAsBool("SKIP_BUILD_RPATH"))
{ {
@ -3824,7 +3831,7 @@ bool cmTarget::HaveInstallTreeRPATH() const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::NeedRelinkBeforeInstall(const char* config) const bool cmTarget::NeedRelinkBeforeInstall(const std::string& config) const
{ {
// Only executables and shared libraries can have an rpath and may // Only executables and shared libraries can have an rpath and may
// need relinking. // need relinking.
@ -3888,7 +3895,8 @@ bool cmTarget::NeedRelinkBeforeInstall(const char* config) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetInstallNameDirForBuildTree(const char* config) const std::string cmTarget::GetInstallNameDirForBuildTree(
const std::string& config) const
{ {
// If building directly for installation then the build tree install_name // If building directly for installation then the build tree install_name
// is the same as the install tree. // is the same as the install tree.
@ -4010,10 +4018,11 @@ const char* cmTarget::GetOutputTargetType(bool implib) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::ComputeOutputDir(const char* config, bool cmTarget::ComputeOutputDir(const std::string& config,
bool implib, std::string& out) const bool implib, std::string& out) const
{ {
bool usesDefaultOutputDir = false; bool usesDefaultOutputDir = false;
std::string conf = config;
// Look for a target property defining the target output directory // Look for a target property defining the target output directory
// based on the target type. // based on the target type.
@ -4027,7 +4036,7 @@ bool cmTarget::ComputeOutputDir(const char* config,
} }
// Check for a per-configuration output directory target property. // Check for a per-configuration output directory target property.
std::string configUpper = cmSystemTools::UpperCase(config? config : ""); std::string configUpper = cmSystemTools::UpperCase(conf);
const char* configProp = 0; const char* configProp = 0;
std::string configPropStr = targetTypeName; std::string configPropStr = targetTypeName;
if(!configPropStr.empty()) if(!configPropStr.empty())
@ -4044,7 +4053,7 @@ bool cmTarget::ComputeOutputDir(const char* config,
out = config_outdir; out = config_outdir;
// Skip per-configuration subdirectory. // Skip per-configuration subdirectory.
config = 0; conf = "";
} }
else if(const char* outdir = this->GetProperty(propertyName)) else if(const char* outdir = this->GetProperty(propertyName))
{ {
@ -4077,21 +4086,21 @@ bool cmTarget::ComputeOutputDir(const char* config,
(out.c_str(), this->Makefile->GetStartOutputDirectory())); (out.c_str(), this->Makefile->GetStartOutputDirectory()));
// The generator may add the configuration's subdirectory. // The generator may add the configuration's subdirectory.
if(config && *config) if(!conf.empty())
{ {
const char *platforms = this->Makefile->GetDefinition( const char *platforms = this->Makefile->GetDefinition(
"CMAKE_XCODE_EFFECTIVE_PLATFORMS"); "CMAKE_XCODE_EFFECTIVE_PLATFORMS");
std::string suffix = std::string suffix =
usesDefaultOutputDir && platforms ? "$(EFFECTIVE_PLATFORM_NAME)" : ""; usesDefaultOutputDir && platforms ? "$(EFFECTIVE_PLATFORM_NAME)" : "";
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()-> this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
AppendDirectoryForConfig("/", config, suffix.c_str(), out); AppendDirectoryForConfig("/", conf, suffix.c_str(), out);
} }
return usesDefaultOutputDir; return usesDefaultOutputDir;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::ComputePDBOutputDir(const char* kind, const char* config, bool cmTarget::ComputePDBOutputDir(const char* kind, const std::string& config,
std::string& out) const std::string& out) const
{ {
// Look for a target property defining the target output directory // Look for a target property defining the target output directory
@ -4103,9 +4112,10 @@ bool cmTarget::ComputePDBOutputDir(const char* kind, const char* config,
propertyNameStr += "_OUTPUT_DIRECTORY"; propertyNameStr += "_OUTPUT_DIRECTORY";
propertyName = propertyNameStr.c_str(); propertyName = propertyNameStr.c_str();
} }
std::string conf = config;
// Check for a per-configuration output directory target property. // Check for a per-configuration output directory target property.
std::string configUpper = cmSystemTools::UpperCase(config? config : ""); std::string configUpper = cmSystemTools::UpperCase(conf);
const char* configProp = 0; const char* configProp = 0;
std::string configPropStr = kind; std::string configPropStr = kind;
if(!configPropStr.empty()) if(!configPropStr.empty())
@ -4122,7 +4132,7 @@ bool cmTarget::ComputePDBOutputDir(const char* kind, const char* config,
out = config_outdir; out = config_outdir;
// Skip per-configuration subdirectory. // Skip per-configuration subdirectory.
config = 0; conf = "";
} }
else if(const char* outdir = this->GetProperty(propertyName)) else if(const char* outdir = this->GetProperty(propertyName))
{ {
@ -4141,27 +4151,29 @@ bool cmTarget::ComputePDBOutputDir(const char* kind, const char* config,
(out.c_str(), this->Makefile->GetStartOutputDirectory())); (out.c_str(), this->Makefile->GetStartOutputDirectory()));
// The generator may add the configuration's subdirectory. // The generator may add the configuration's subdirectory.
if(config && *config) if(!conf.empty())
{ {
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()-> this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
AppendDirectoryForConfig("/", config, "", out); AppendDirectoryForConfig("/", conf, "", out);
} }
return true; return true;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::UsesDefaultOutputDir(const char* config, bool implib) const bool cmTarget::UsesDefaultOutputDir(const std::string& config,
bool implib) const
{ {
std::string dir; std::string dir;
return this->ComputeOutputDir(config, implib, dir); return this->ComputeOutputDir(config, implib, dir);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetOutputName(const char* config, bool implib) const std::string cmTarget::GetOutputName(const std::string& config,
bool implib) const
{ {
std::vector<std::string> props; std::vector<std::string> props;
std::string type = this->GetOutputTargetType(implib); std::string type = this->GetOutputTargetType(implib);
std::string configUpper = cmSystemTools::UpperCase(config? config : ""); std::string configUpper = cmSystemTools::UpperCase(config);
if(!type.empty() && !configUpper.empty()) if(!type.empty() && !configUpper.empty())
{ {
// <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME_<CONFIG> // <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME_<CONFIG>
@ -4495,7 +4507,7 @@ std::string compatibilityAgree(CompatibleType t, bool dominant)
template<typename PropertyType> template<typename PropertyType>
PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
const std::string &p, const std::string &p,
const char *config, const std::string& config,
const char *defaultValue, const char *defaultValue,
CompatibleType t, CompatibleType t,
PropertyType *) PropertyType *)
@ -4679,7 +4691,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p, bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p,
const char *config) const const std::string& config) const
{ {
return checkInterfacePropertyCompatibility<bool>(this, p, config, "FALSE", return checkInterfacePropertyCompatibility<bool>(this, p, config, "FALSE",
BoolType, 0); BoolType, 0);
@ -4688,7 +4700,7 @@ bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char * cmTarget::GetLinkInterfaceDependentStringProperty( const char * cmTarget::GetLinkInterfaceDependentStringProperty(
const std::string &p, const std::string &p,
const char *config) const const std::string& config) const
{ {
return checkInterfacePropertyCompatibility<const char *>(this, return checkInterfacePropertyCompatibility<const char *>(this,
p, p,
@ -4700,7 +4712,7 @@ const char * cmTarget::GetLinkInterfaceDependentStringProperty(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char * cmTarget::GetLinkInterfaceDependentNumberMinProperty( const char * cmTarget::GetLinkInterfaceDependentNumberMinProperty(
const std::string &p, const std::string &p,
const char *config) const const std::string& config) const
{ {
return checkInterfacePropertyCompatibility<const char *>(this, return checkInterfacePropertyCompatibility<const char *>(this,
p, p,
@ -4712,7 +4724,7 @@ const char * cmTarget::GetLinkInterfaceDependentNumberMinProperty(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char * cmTarget::GetLinkInterfaceDependentNumberMaxProperty( const char * cmTarget::GetLinkInterfaceDependentNumberMaxProperty(
const std::string &p, const std::string &p,
const char *config) const const std::string& config) const
{ {
return checkInterfacePropertyCompatibility<const char *>(this, return checkInterfacePropertyCompatibility<const char *>(this,
p, p,
@ -4724,7 +4736,7 @@ const char * cmTarget::GetLinkInterfaceDependentNumberMaxProperty(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool isLinkDependentProperty(cmTarget const* tgt, const std::string &p, bool isLinkDependentProperty(cmTarget const* tgt, const std::string &p,
const std::string& interfaceProperty, const std::string& interfaceProperty,
const char *config) const std::string& config)
{ {
std::vector<cmTarget*> deps; std::vector<cmTarget*> deps;
tgt->GetTransitiveTargetClosure(config, tgt, deps); tgt->GetTransitiveTargetClosure(config, tgt, deps);
@ -4762,7 +4774,7 @@ bool isLinkDependentProperty(cmTarget const* tgt, const std::string &p,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p, bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p,
const char *config) const const std::string& config) const
{ {
if (this->TargetTypeValue == OBJECT_LIBRARY if (this->TargetTypeValue == OBJECT_LIBRARY
|| this->TargetTypeValue == INTERFACE_LIBRARY) || this->TargetTypeValue == INTERFACE_LIBRARY)
@ -4776,7 +4788,7 @@ bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::IsLinkInterfaceDependentStringProperty(const std::string &p, bool cmTarget::IsLinkInterfaceDependentStringProperty(const std::string &p,
const char *config) const const std::string& config) const
{ {
if (this->TargetTypeValue == OBJECT_LIBRARY if (this->TargetTypeValue == OBJECT_LIBRARY
|| this->TargetTypeValue == INTERFACE_LIBRARY) || this->TargetTypeValue == INTERFACE_LIBRARY)
@ -4790,7 +4802,7 @@ bool cmTarget::IsLinkInterfaceDependentStringProperty(const std::string &p,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::IsLinkInterfaceDependentNumberMinProperty(const std::string &p, bool cmTarget::IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
const char *config) const const std::string& config) const
{ {
if (this->TargetTypeValue == OBJECT_LIBRARY if (this->TargetTypeValue == OBJECT_LIBRARY
|| this->TargetTypeValue == INTERFACE_LIBRARY) || this->TargetTypeValue == INTERFACE_LIBRARY)
@ -4803,7 +4815,7 @@ bool cmTarget::IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::IsLinkInterfaceDependentNumberMaxProperty(const std::string &p, bool cmTarget::IsLinkInterfaceDependentNumberMaxProperty(const std::string &p,
const char *config) const const std::string& config) const
{ {
if (this->TargetTypeValue == OBJECT_LIBRARY if (this->TargetTypeValue == OBJECT_LIBRARY
|| this->TargetTypeValue == INTERFACE_LIBRARY) || this->TargetTypeValue == INTERFACE_LIBRARY)
@ -4829,7 +4841,7 @@ void cmTarget::GetLanguages(std::set<std::string>& languages) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmTarget::IsChrpathUsed(const char* config) const bool cmTarget::IsChrpathUsed(const std::string& config) const
{ {
// Only certain target types have an rpath. // Only certain target types have an rpath.
if(!(this->GetType() == cmTarget::SHARED_LIBRARY || if(!(this->GetType() == cmTarget::SHARED_LIBRARY ||
@ -4897,7 +4909,8 @@ bool cmTarget::IsChrpathUsed(const char* config) const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget::ImportInfo const* cmTarget::ImportInfo const*
cmTarget::GetImportInfo(const char* config, cmTarget const* headTarget) const cmTarget::GetImportInfo(const std::string& config,
cmTarget const* headTarget) const
{ {
// There is no imported information for non-imported targets. // There is no imported information for non-imported targets.
if(!this->IsImported()) if(!this->IsImported())
@ -4908,7 +4921,7 @@ cmTarget::GetImportInfo(const char* config, cmTarget const* headTarget) const
// Lookup/compute/cache the import information for this // Lookup/compute/cache the import information for this
// configuration. // configuration.
std::string config_upper; std::string config_upper;
if(config && *config) if(!config.empty())
{ {
config_upper = cmSystemTools::UpperCase(config); config_upper = cmSystemTools::UpperCase(config);
} }
@ -5262,7 +5275,8 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config, cmTarget::LinkInterface const* cmTarget::GetLinkInterface(
const std::string& config,
cmTarget const* head) const cmTarget const* head) const
{ {
// Imported targets have their own link interface. // Imported targets have their own link interface.
@ -5284,7 +5298,7 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config,
} }
// Lookup any existing link interface for this configuration. // Lookup any existing link interface for this configuration.
TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : "")); TargetConfigPair key(head, cmSystemTools::UpperCase(config));
cmTargetInternals::LinkInterfaceMapType::iterator cmTargetInternals::LinkInterfaceMapType::iterator
i = this->Internal->LinkInterfaceMap.find(key); i = this->Internal->LinkInterfaceMap.find(key);
@ -5315,7 +5329,7 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget::LinkInterface const* cmTarget::LinkInterface const*
cmTarget::GetLinkInterfaceLibraries(const char* config, cmTarget::GetLinkInterfaceLibraries(const std::string& config,
cmTarget const* head) const cmTarget const* head) const
{ {
// Imported targets have their own link interface. // Imported targets have their own link interface.
@ -5337,7 +5351,7 @@ cmTarget::GetLinkInterfaceLibraries(const char* config,
} }
// Lookup any existing link interface for this configuration. // Lookup any existing link interface for this configuration.
TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : "")); TargetConfigPair key(head, cmSystemTools::UpperCase(config));
cmTargetInternals::LinkInterfaceMapType::iterator cmTargetInternals::LinkInterfaceMapType::iterator
i = this->Internal->LinkInterfaceMap.find(key); i = this->Internal->LinkInterfaceMap.find(key);
@ -5359,7 +5373,7 @@ cmTarget::GetLinkInterfaceLibraries(const char* config,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void processILibs(const char* config, void processILibs(const std::string& config,
cmTarget const* headTarget, cmTarget const* headTarget,
std::string const& name, std::string const& name,
std::vector<cmTarget*>& tgts, std::set<cmTarget*>& emitted) std::vector<cmTarget*>& tgts, std::set<cmTarget*>& emitted)
@ -5387,7 +5401,7 @@ void processILibs(const char* config,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::GetTransitiveTargetClosure(const char* config, void cmTarget::GetTransitiveTargetClosure(const std::string& config,
cmTarget const* headTarget, cmTarget const* headTarget,
std::vector<cmTarget*> &tgts) const std::vector<cmTarget*> &tgts) const
{ {
@ -5404,7 +5418,7 @@ void cmTarget::GetTransitiveTargetClosure(const char* config,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::GetTransitivePropertyTargets(const char* config, void cmTarget::GetTransitivePropertyTargets(const std::string& config,
cmTarget const* headTarget, cmTarget const* headTarget,
std::vector<cmTarget*> &tgts) const std::vector<cmTarget*> &tgts) const
{ {
@ -5464,14 +5478,14 @@ void cmTarget::GetTransitivePropertyTargets(const char* config,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char* cmTarget::ComputeLinkInterfaceLibraries(const char* config, const char* cmTarget::ComputeLinkInterfaceLibraries(const std::string& config,
LinkInterface& iface, LinkInterface& iface,
cmTarget const* headTarget, cmTarget const* headTarget,
bool &exists) const bool &exists) const
{ {
// Construct the property name suffix for this configuration. // Construct the property name suffix for this configuration.
std::string suffix = "_"; std::string suffix = "_";
if(config && *config) if(!config.empty())
{ {
suffix += cmSystemTools::UpperCase(config); suffix += cmSystemTools::UpperCase(config);
} }
@ -5642,7 +5656,7 @@ const char* cmTarget::ComputeLinkInterfaceLibraries(const char* config,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget, void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
const char* config, const std::string& config,
OptionalLinkInterface& iface, OptionalLinkInterface& iface,
cmTarget const* headTarget, cmTarget const* headTarget,
const char* explicitLibraries) const const char* explicitLibraries) const
@ -5714,7 +5728,7 @@ void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
{ {
// Construct the property name suffix for this configuration. // Construct the property name suffix for this configuration.
std::string suffix = "_"; std::string suffix = "_";
if(config && *config) if(!config.empty())
{ {
suffix += cmSystemTools::UpperCase(config); suffix += cmSystemTools::UpperCase(config);
} }
@ -5742,7 +5756,8 @@ void cmTargetInternals::ComputeLinkInterface(cmTarget const* thisTarget,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget::LinkImplementation const* cmTarget::LinkImplementation const*
cmTarget::GetLinkImplementation(const char* config, cmTarget const* head) const cmTarget::GetLinkImplementation(const std::string& config,
cmTarget const* head) const
{ {
// There is no link implementation for imported targets. // There is no link implementation for imported targets.
if(this->IsImported()) if(this->IsImported())
@ -5751,7 +5766,7 @@ cmTarget::GetLinkImplementation(const char* config, cmTarget const* head) const
} }
// Lookup any existing link implementation for this configuration. // Lookup any existing link implementation for this configuration.
TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : "")); TargetConfigPair key(head, cmSystemTools::UpperCase(config));
cmTargetInternals::LinkImplMapType::iterator cmTargetInternals::LinkImplMapType::iterator
i = this->Internal->LinkImplMap.find(key); i = this->Internal->LinkImplMap.find(key);
@ -5776,7 +5791,7 @@ cmTarget::GetLinkImplementation(const char* config, cmTarget const* head) const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget::LinkImplementation const* cmTarget::LinkImplementation const*
cmTarget::GetLinkImplementationLibraries(const char* config, cmTarget::GetLinkImplementationLibraries(const std::string& config,
cmTarget const* head) const cmTarget const* head) const
{ {
// There is no link implementation for imported targets. // There is no link implementation for imported targets.
@ -5786,7 +5801,7 @@ cmTarget::GetLinkImplementationLibraries(const char* config,
} }
// Lookup any existing link implementation for this configuration. // Lookup any existing link implementation for this configuration.
TargetConfigPair key(head, cmSystemTools::UpperCase(config? config : "")); TargetConfigPair key(head, cmSystemTools::UpperCase(config));
cmTargetInternals::LinkImplMapType::iterator cmTargetInternals::LinkImplMapType::iterator
i = this->Internal->LinkImplMap.find(key); i = this->Internal->LinkImplMap.find(key);
@ -5805,7 +5820,7 @@ cmTarget::GetLinkImplementationLibraries(const char* config,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::ComputeLinkImplementation(const char* config, void cmTarget::ComputeLinkImplementation(const std::string& config,
LinkImplementation& impl, LinkImplementation& impl,
cmTarget const* head) const cmTarget const* head) const
{ {
@ -5970,14 +5985,14 @@ std::string cmTarget::CheckCMP0004(std::string const& item) const
template<typename PropertyType> template<typename PropertyType>
PropertyType getLinkInterfaceDependentProperty(cmTarget const* tgt, PropertyType getLinkInterfaceDependentProperty(cmTarget const* tgt,
const std::string& prop, const std::string& prop,
const char *config, const std::string& config,
CompatibleType, CompatibleType,
PropertyType *); PropertyType *);
template<> template<>
bool getLinkInterfaceDependentProperty(cmTarget const* tgt, bool getLinkInterfaceDependentProperty(cmTarget const* tgt,
const std::string& prop, const std::string& prop,
const char *config, const std::string& config,
CompatibleType, bool *) CompatibleType, bool *)
{ {
return tgt->GetLinkInterfaceDependentBoolProperty(prop, config); return tgt->GetLinkInterfaceDependentBoolProperty(prop, config);
@ -5986,7 +6001,7 @@ bool getLinkInterfaceDependentProperty(cmTarget const* tgt,
template<> template<>
const char * getLinkInterfaceDependentProperty(cmTarget const* tgt, const char * getLinkInterfaceDependentProperty(cmTarget const* tgt,
const std::string& prop, const std::string& prop,
const char *config, const std::string& config,
CompatibleType t, CompatibleType t,
const char **) const char **)
{ {
@ -6012,7 +6027,7 @@ void checkPropertyConsistency(cmTarget const* depender,
cmTarget const* dependee, cmTarget const* dependee,
const std::string& propName, const std::string& propName,
std::set<std::string> &emitted, std::set<std::string> &emitted,
const char *config, const std::string& config,
CompatibleType t, CompatibleType t,
PropertyType *) PropertyType *)
{ {
@ -6101,7 +6116,7 @@ static std::string intersect(const std::set<std::string> &s1,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info, void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
const char* config) const const std::string& config) const
{ {
const cmComputeLinkInformation::ItemVector &deps = info->GetItems(); const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
@ -6205,12 +6220,12 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmComputeLinkInformation* cmComputeLinkInformation*
cmTarget::GetLinkInformation(const char* config, cmTarget const* head) const cmTarget::GetLinkInformation(const std::string& config,
cmTarget const* head) const
{ {
cmTarget const* headTarget = head ? head : this; cmTarget const* headTarget = head ? head : this;
// Lookup any existing information for this configuration. // Lookup any existing information for this configuration.
TargetConfigPair key(headTarget, TargetConfigPair key(headTarget, cmSystemTools::UpperCase(config));
cmSystemTools::UpperCase(config?config:""));
cmTargetLinkInformationMap::iterator cmTargetLinkInformationMap::iterator
i = this->LinkInformation.find(key); i = this->LinkInformation.find(key);
if(i == this->LinkInformation.end()) if(i == this->LinkInformation.end())
@ -6237,7 +6252,7 @@ cmTarget::GetLinkInformation(const char* config, cmTarget const* head) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetFrameworkDirectory(const char* config, std::string cmTarget::GetFrameworkDirectory(const std::string& config,
bool rootDir) const bool rootDir) const
{ {
std::string fpath; std::string fpath;
@ -6252,7 +6267,7 @@ std::string cmTarget::GetFrameworkDirectory(const char* config,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetCFBundleDirectory(const char* config, std::string cmTarget::GetCFBundleDirectory(const std::string& config,
bool contentOnly) const bool contentOnly) const
{ {
std::string fpath; std::string fpath;
@ -6271,7 +6286,7 @@ std::string cmTarget::GetCFBundleDirectory(const char* config,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetAppBundleDirectory(const char* config, std::string cmTarget::GetAppBundleDirectory(const std::string& config,
bool contentOnly) const bool contentOnly) const
{ {
std::string fpath = this->GetFullName(config, false); std::string fpath = this->GetFullName(config, false);
@ -6283,7 +6298,7 @@ std::string cmTarget::GetAppBundleDirectory(const char* config,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::BuildMacContentDirectory(const std::string& base, std::string cmTarget::BuildMacContentDirectory(const std::string& base,
const char* config, const std::string& config,
bool contentOnly) const bool contentOnly) const
{ {
std::string fpath = base; std::string fpath = base;
@ -6303,7 +6318,7 @@ std::string cmTarget::BuildMacContentDirectory(const std::string& base,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmTarget::GetMacContentDirectory(const char* config, std::string cmTarget::GetMacContentDirectory(const std::string& config,
bool implib) const bool implib) const
{ {
// Start with the output directory for the target. // Start with the output directory for the target.

View File

@ -155,15 +155,15 @@ public:
return this->LinkLibraries;} return this->LinkLibraries;}
const LinkLibraryVectorType &GetOriginalLinkLibraries() const const LinkLibraryVectorType &GetOriginalLinkLibraries() const
{return this->OriginalLinkLibraries;} {return this->OriginalLinkLibraries;}
void GetDirectLinkLibraries(const char *config, void GetDirectLinkLibraries(const std::string& config,
std::vector<std::string> &, std::vector<std::string> &,
cmTarget const* head) const; cmTarget const* head) const;
void GetInterfaceLinkLibraries(const char *config, void GetInterfaceLinkLibraries(const std::string& config,
std::vector<std::string> &, std::vector<std::string> &,
cmTarget const* head) const; cmTarget const* head) const;
/** Compute the link type to use for the given configuration. */ /** Compute the link type to use for the given configuration. */
LinkLibraryType ComputeLinkType(const char* config) const; LinkLibraryType ComputeLinkType(const std::string& config) const;
/** /**
* Clear the dependency information recorded for this target, if any. * Clear the dependency information recorded for this target, if any.
@ -232,7 +232,8 @@ public:
bool GetPropertyAsBool(const std::string& prop) const; bool GetPropertyAsBool(const std::string& prop) const;
void CheckProperty(const std::string& prop, cmMakefile* context) const; void CheckProperty(const std::string& prop, cmMakefile* context) const;
const char* GetFeature(const char* feature, const char* config) const; const char* GetFeature(const char* feature,
const std::string& config) const;
bool IsImported() const {return this->IsImportedTarget;} bool IsImported() const {return this->IsImportedTarget;}
@ -264,14 +265,14 @@ public:
/** Get the link interface for the given configuration. Returns 0 /** Get the link interface for the given configuration. Returns 0
if the target cannot be linked. */ if the target cannot be linked. */
LinkInterface const* GetLinkInterface(const char* config, LinkInterface const* GetLinkInterface(const std::string& config,
cmTarget const* headTarget) const; cmTarget const* headTarget) const;
LinkInterface const* GetLinkInterfaceLibraries(const char* config, LinkInterface const* GetLinkInterfaceLibraries(const std::string& config,
cmTarget const* headTarget) const; cmTarget const* headTarget) const;
void GetTransitivePropertyTargets(const char* config, void GetTransitivePropertyTargets(const std::string& config,
cmTarget const* headTarget, cmTarget const* headTarget,
std::vector<cmTarget*> &libs) const; std::vector<cmTarget*> &libs) const;
void GetTransitiveTargetClosure(const char* config, void GetTransitiveTargetClosure(const std::string& config,
cmTarget const* headTarget, cmTarget const* headTarget,
std::vector<cmTarget*> &libs) const; std::vector<cmTarget*> &libs) const;
@ -289,10 +290,11 @@ public:
// Needed only for OLD behavior of CMP0003. // Needed only for OLD behavior of CMP0003.
std::vector<std::string> WrongConfigLibraries; std::vector<std::string> WrongConfigLibraries;
}; };
LinkImplementation const* GetLinkImplementation(const char* config, LinkImplementation const* GetLinkImplementation(const std::string& config,
cmTarget const* head) const; cmTarget const* head) const;
LinkImplementation const* GetLinkImplementationLibraries(const char* config, LinkImplementation const* GetLinkImplementationLibraries(
const std::string& config,
cmTarget const* head) const; cmTarget const* head) const;
/** Link information from the transitive closure of the link /** Link information from the transitive closure of the link
@ -305,7 +307,7 @@ public:
// Languages whose runtime libraries must be linked. // Languages whose runtime libraries must be linked.
std::vector<std::string> Languages; std::vector<std::string> Languages;
}; };
LinkClosure const* GetLinkClosure(const char* config, LinkClosure const* GetLinkClosure(const std::string& config,
cmTarget const* head) const; cmTarget const* head) const;
/** Strip off leading and trailing whitespace from an item named in /** Strip off leading and trailing whitespace from an item named in
@ -316,23 +318,24 @@ public:
configuration name is given then the generator will add its configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical subdirectory for that configuration. Otherwise just the canonical
output directory is given. */ output directory is given. */
std::string GetDirectory(const char* config = 0, bool implib = false) const; std::string GetDirectory(const std::string& config = "",
bool implib = false) const;
/** Get the directory in which this targets .pdb files will be placed. /** Get the directory in which this targets .pdb files will be placed.
If the configuration name is given then the generator will add its If the configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical subdirectory for that configuration. Otherwise just the canonical
pdb output directory is given. */ pdb output directory is given. */
std::string GetPDBDirectory(const char* config) const; std::string GetPDBDirectory(const std::string& config) const;
/** Get the directory in which to place the target compiler .pdb file. /** Get the directory in which to place the target compiler .pdb file.
If the configuration name is given then the generator will add its If the configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical subdirectory for that configuration. Otherwise just the canonical
compiler pdb output directory is given. */ compiler pdb output directory is given. */
std::string GetCompilePDBDirectory(const char* config = 0) const; std::string GetCompilePDBDirectory(const std::string& config = "") const;
/** Get the location of the target in the build tree for the given /** Get the location of the target in the build tree for the given
configuration. */ configuration. */
const char* GetLocation(const char* config) const; const char* GetLocation(const std::string& config) const;
/** Get the location of the target in the build tree with a placeholder /** Get the location of the target in the build tree with a placeholder
referencing the configuration in the native build system. This referencing the configuration in the native build system. This
@ -351,44 +354,46 @@ public:
GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const; GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
///! Return the preferred linker language for this target ///! Return the preferred linker language for this target
std::string GetLinkerLanguage(const char* config = 0, std::string GetLinkerLanguage(const std::string& config = "",
cmTarget const* head = 0) const; cmTarget const* head = 0) const;
/** Get the full name of the target according to the settings in its /** Get the full name of the target according to the settings in its
makefile. */ makefile. */
std::string GetFullName(const char* config=0, bool implib = false) const; std::string GetFullName(const std::string& config="",
bool implib = false) const;
void GetFullNameComponents(std::string& prefix, void GetFullNameComponents(std::string& prefix,
std::string& base, std::string& suffix, std::string& base, std::string& suffix,
const char* config=0, bool implib = false) const; const std::string& config="",
bool implib = false) const;
/** Get the name of the pdb file for the target. */ /** Get the name of the pdb file for the target. */
std::string GetPDBName(const char* config) const; std::string GetPDBName(const std::string& config) const;
/** Get the name of the compiler pdb file for the target. */ /** Get the name of the compiler pdb file for the target. */
std::string GetCompilePDBName(const char* config=0) const; std::string GetCompilePDBName(const std::string& config="") const;
/** Get the path for the MSVC /Fd option for this target. */ /** Get the path for the MSVC /Fd option for this target. */
std::string GetCompilePDBPath(const char* config=0) const; std::string GetCompilePDBPath(const std::string& config="") const;
/** Whether this library has soname enabled and platform supports it. */ /** Whether this library has soname enabled and platform supports it. */
bool HasSOName(const char* config) const; bool HasSOName(const std::string& config) const;
/** Get the soname of the target. Allowed only for a shared library. */ /** Get the soname of the target. Allowed only for a shared library. */
std::string GetSOName(const char* config) const; std::string GetSOName(const std::string& config) const;
/** Whether this library has \@rpath and platform supports it. */ /** Whether this library has \@rpath and platform supports it. */
bool HasMacOSXRpathInstallNameDir(const char* config) const; bool HasMacOSXRpathInstallNameDir(const std::string& config) const;
/** Whether this library defaults to \@rpath. */ /** Whether this library defaults to \@rpath. */
bool MacOSXRpathInstallNameDirDefault() const; bool MacOSXRpathInstallNameDirDefault() const;
/** Test for special case of a third-party shared library that has /** Test for special case of a third-party shared library that has
no soname at all. */ no soname at all. */
bool IsImportedSharedLibWithoutSOName(const char* config) const; bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
/** Get the full path to the target according to the settings in its /** Get the full path to the target according to the settings in its
makefile and the configuration type. */ makefile and the configuration type. */
std::string GetFullPath(const char* config=0, bool implib = false, std::string GetFullPath(const std::string& config="", bool implib = false,
bool realname = false) const; bool realname = false) const;
/** Get the names of the library needed to generate a build rule /** Get the names of the library needed to generate a build rule
@ -396,14 +401,15 @@ public:
should be called only on a library target. */ should be called only on a library target. */
void GetLibraryNames(std::string& name, std::string& soName, void GetLibraryNames(std::string& name, std::string& soName,
std::string& realName, std::string& impName, std::string& realName, std::string& impName,
std::string& pdbName, const char* config) const; std::string& pdbName, const std::string& config) const;
/** Get the names of the executable needed to generate a build rule /** Get the names of the executable needed to generate a build rule
that takes into account executable version numbers. This should that takes into account executable version numbers. This should
be called only on an executable target. */ be called only on an executable target. */
void GetExecutableNames(std::string& name, std::string& realName, void GetExecutableNames(std::string& name, std::string& realName,
std::string& impName, std::string& impName,
std::string& pdbName, const char* config) const; std::string& pdbName,
const std::string& config) const;
/** Does this target have a GNU implib to convert to MS format? */ /** Does this target have a GNU implib to convert to MS format? */
bool HasImplibGNUtoMS() const; bool HasImplibGNUtoMS() const;
@ -416,24 +422,24 @@ public:
/** /**
* Compute whether this target must be relinked before installing. * Compute whether this target must be relinked before installing.
*/ */
bool NeedRelinkBeforeInstall(const char* config) const; bool NeedRelinkBeforeInstall(const std::string& config) const;
bool HaveBuildTreeRPATH(const char *config) const; bool HaveBuildTreeRPATH(const std::string& config) const;
bool HaveInstallTreeRPATH() const; bool HaveInstallTreeRPATH() const;
/** Return true if builtin chrpath will work for this target */ /** Return true if builtin chrpath will work for this target */
bool IsChrpathUsed(const char* config) const; bool IsChrpathUsed(const std::string& config) const;
/** Return the install name directory for the target in the /** Return the install name directory for the target in the
* build tree. For example: "\@rpath/", "\@loader_path/", * build tree. For example: "\@rpath/", "\@loader_path/",
* or "/full/path/to/library". */ * or "/full/path/to/library". */
std::string GetInstallNameDirForBuildTree(const char* config) const; std::string GetInstallNameDirForBuildTree(const std::string& config) const;
/** Return the install name directory for the target in the /** Return the install name directory for the target in the
* install tree. For example: "\@rpath/" or "\@loader_path/". */ * install tree. For example: "\@rpath/" or "\@loader_path/". */
std::string GetInstallNameDirForInstallTree() const; std::string GetInstallNameDirForInstallTree() const;
cmComputeLinkInformation* GetLinkInformation(const char* config, cmComputeLinkInformation* GetLinkInformation(const std::string& config,
cmTarget const* head = 0) const; cmTarget const* head = 0) const;
// Get the properties // Get the properties
@ -452,7 +458,7 @@ public:
const char* GetExportMacro() const; const char* GetExportMacro() const;
void GetCompileDefinitions(std::vector<std::string> &result, void GetCompileDefinitions(std::vector<std::string> &result,
const char *config) const; const std::string& config) const;
// Compute the set of languages compiled by the target. This is // Compute the set of languages compiled by the target. This is
// computed every time it is called because the languages can change // computed every time it is called because the languages can change
@ -500,26 +506,29 @@ public:
/** Return whether this target uses the default value for its output /** Return whether this target uses the default value for its output
directory. */ directory. */
bool UsesDefaultOutputDir(const char* config, bool implib) const; bool UsesDefaultOutputDir(const std::string& config, bool implib) const;
/** @return the mac content directory for this target. */ /** @return the mac content directory for this target. */
std::string GetMacContentDirectory(const char* config, std::string GetMacContentDirectory(const std::string& config,
bool implib) const; bool implib) const;
/** @return whether this target have a well defined output file name. */ /** @return whether this target have a well defined output file name. */
bool HaveWellDefinedOutputFiles() const; bool HaveWellDefinedOutputFiles() const;
/** @return the Mac framework directory without the base. */ /** @return the Mac framework directory without the base. */
std::string GetFrameworkDirectory(const char* config, bool rootDir) const; std::string GetFrameworkDirectory(const std::string& config,
bool rootDir) const;
/** @return the Mac CFBundle directory without the base */ /** @return the Mac CFBundle directory without the base */
std::string GetCFBundleDirectory(const char* config, bool contentOnly) const; std::string GetCFBundleDirectory(const std::string& config,
/** @return the Mac App directory without the base */
std::string GetAppBundleDirectory(const char* config,
bool contentOnly) const; bool contentOnly) const;
std::vector<std::string> GetIncludeDirectories(const char *config) const; /** @return the Mac App directory without the base */
std::string GetAppBundleDirectory(const std::string& config,
bool contentOnly) const;
std::vector<std::string> GetIncludeDirectories(
const std::string& config) const;
void InsertInclude(const cmValueWithOrigin &entry, void InsertInclude(const cmValueWithOrigin &entry,
bool before = false); bool before = false);
void InsertCompileOption(const cmValueWithOrigin &entry, void InsertCompileOption(const cmValueWithOrigin &entry,
@ -529,29 +538,29 @@ public:
void AppendBuildInterfaceIncludes(); void AppendBuildInterfaceIncludes();
void GetCompileOptions(std::vector<std::string> &result, void GetCompileOptions(std::vector<std::string> &result,
const char *config) const; const std::string& config) const;
void GetAutoUicOptions(std::vector<std::string> &result, void GetAutoUicOptions(std::vector<std::string> &result,
const char *config) const; const std::string& config) const;
bool IsNullImpliedByLinkLibraries(const std::string &p) const; bool IsNullImpliedByLinkLibraries(const std::string &p) const;
bool IsLinkInterfaceDependentBoolProperty(const std::string &p, bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
const char *config) const; const std::string& config) const;
bool IsLinkInterfaceDependentStringProperty(const std::string &p, bool IsLinkInterfaceDependentStringProperty(const std::string &p,
const char *config) const; const std::string& config) const;
bool IsLinkInterfaceDependentNumberMinProperty(const std::string &p, bool IsLinkInterfaceDependentNumberMinProperty(const std::string &p,
const char *config) const; const std::string& config) const;
bool IsLinkInterfaceDependentNumberMaxProperty(const std::string &p, bool IsLinkInterfaceDependentNumberMaxProperty(const std::string &p,
const char *config) const; const std::string& config) const;
bool GetLinkInterfaceDependentBoolProperty(const std::string &p, bool GetLinkInterfaceDependentBoolProperty(const std::string &p,
const char *config) const; const std::string& config) const;
const char *GetLinkInterfaceDependentStringProperty(const std::string &p, const char *GetLinkInterfaceDependentStringProperty(const std::string &p,
const char *config) const; const std::string& config) const;
const char *GetLinkInterfaceDependentNumberMinProperty(const std::string &p, const char *GetLinkInterfaceDependentNumberMinProperty(const std::string &p,
const char *config) const; const std::string& config) const;
const char *GetLinkInterfaceDependentNumberMaxProperty(const std::string &p, const char *GetLinkInterfaceDependentNumberMaxProperty(const std::string &p,
const char *config) const; const std::string& config) const;
std::string GetDebugGeneratorExpressions(const std::string &value, std::string GetDebugGeneratorExpressions(const std::string &value,
cmTarget::LinkLibraryType llt) const; cmTarget::LinkLibraryType llt) const;
@ -631,8 +640,9 @@ private:
const char* GetSuffixVariableInternal(bool implib) const; const char* GetSuffixVariableInternal(bool implib) const;
const char* GetPrefixVariableInternal(bool implib) const; const char* GetPrefixVariableInternal(bool implib) const;
std::string GetFullNameInternal(const char* config, bool implib) const; std::string GetFullNameInternal(const std::string& config,
void GetFullNameInternal(const char* config, bool implib, bool implib) const;
void GetFullNameInternal(const std::string& config, bool implib,
std::string& outPrefix, std::string& outBase, std::string& outPrefix, std::string& outBase,
std::string& outSuffix) const; std::string& outSuffix) const;
@ -645,23 +655,25 @@ private:
const char* GetOutputTargetType(bool implib) const; const char* GetOutputTargetType(bool implib) const;
// Get the target base name. // Get the target base name.
std::string GetOutputName(const char* config, bool implib) const; std::string GetOutputName(const std::string& config, bool implib) const;
std::string GetFullNameImported(const char* config, bool implib) const; std::string GetFullNameImported(const std::string& config,
bool implib) const;
std::string ImportedGetFullPath(const char* config, bool implib) const; std::string ImportedGetFullPath(const std::string& config,
std::string NormalGetFullPath(const char* config, bool implib, bool implib) const;
std::string NormalGetFullPath(const std::string& config, bool implib,
bool realname) const; bool realname) const;
/** Get the real name of the target. Allowed only for non-imported /** Get the real name of the target. Allowed only for non-imported
targets. When a library or executable file is versioned this is targets. When a library or executable file is versioned this is
the full versioned name. If the target is not versioned this is the full versioned name. If the target is not versioned this is
the same as GetFullName. */ the same as GetFullName. */
std::string NormalGetRealName(const char* config) const; std::string NormalGetRealName(const std::string& config) const;
/** Append to @a base the mac content directory and return it. */ /** Append to @a base the mac content directory and return it. */
std::string BuildMacContentDirectory(const std::string& base, std::string BuildMacContentDirectory(const std::string& base,
const char* config, const std::string& config,
bool contentOnly) const; bool contentOnly) const;
private: private:
@ -698,37 +710,38 @@ private:
// Cache target output paths for each configuration. // Cache target output paths for each configuration.
struct OutputInfo; struct OutputInfo;
OutputInfo const* GetOutputInfo(const char* config) const; OutputInfo const* GetOutputInfo(const std::string& config) const;
bool bool
ComputeOutputDir(const char* config, bool implib, std::string& out) const; ComputeOutputDir(const std::string& config,
bool ComputePDBOutputDir(const char* kind, const char* config, bool implib, std::string& out) const;
bool ComputePDBOutputDir(const char* kind, const std::string& config,
std::string& out) const; std::string& out) const;
// Cache import information from properties for each configuration. // Cache import information from properties for each configuration.
struct ImportInfo; struct ImportInfo;
ImportInfo const* GetImportInfo(const char* config, ImportInfo const* GetImportInfo(const std::string& config,
cmTarget const* workingTarget) const; cmTarget const* workingTarget) const;
void ComputeImportInfo(std::string const& desired_config, ImportInfo& info, void ComputeImportInfo(std::string const& desired_config, ImportInfo& info,
cmTarget const* head) const; cmTarget const* head) const;
// Cache target compile paths for each configuration. // Cache target compile paths for each configuration.
struct CompileInfo; struct CompileInfo;
CompileInfo const* GetCompileInfo(const char* config) const; CompileInfo const* GetCompileInfo(const std::string& config) const;
mutable cmTargetLinkInformationMap LinkInformation; mutable cmTargetLinkInformationMap LinkInformation;
void CheckPropertyCompatibility(cmComputeLinkInformation *info, void CheckPropertyCompatibility(cmComputeLinkInformation *info,
const char* config) const; const std::string& config) const;
const char* ComputeLinkInterfaceLibraries(const char* config, const char* ComputeLinkInterfaceLibraries(const std::string& config,
LinkInterface& iface, LinkInterface& iface,
cmTarget const* head, cmTarget const* head,
bool &exists) const; bool &exists) const;
void ComputeLinkImplementation(const char* config, void ComputeLinkImplementation(const std::string& config,
LinkImplementation& impl, LinkImplementation& impl,
cmTarget const* head) const; cmTarget const* head) const;
void ComputeLinkImplementationLanguages(LinkImplementation& impl) const; void ComputeLinkImplementationLanguages(LinkImplementation& impl) const;
void ComputeLinkClosure(const char* config, LinkClosure& lc, void ComputeLinkClosure(const std::string& config, LinkClosure& lc,
cmTarget const* head) const; cmTarget const* head) const;
void ClearLinkMaps(); void ClearLinkMaps();

View File

@ -64,7 +64,7 @@ void cmTestGenerator::GenerateScriptActions(std::ostream& os,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTestGenerator::GenerateScriptForConfig(std::ostream& os, void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
const char* config, const std::string& config,
Indent const& indent) Indent const& indent)
{ {
this->TestGenerated = true; this->TestGenerated = true;

View File

@ -32,7 +32,7 @@ protected:
virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent); virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent);
virtual void GenerateScriptActions(std::ostream& os, Indent const& indent); virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
virtual void GenerateScriptForConfig(std::ostream& os, virtual void GenerateScriptForConfig(std::ostream& os,
const char* config, const std::string& config,
Indent const& indent); Indent const& indent);
virtual void GenerateScriptNoConfig(std::ostream& os, Indent const& indent); virtual void GenerateScriptNoConfig(std::ostream& os, Indent const& indent);
virtual bool NeedsScriptNoConfig() const; virtual bool NeedsScriptNoConfig() const;

View File

@ -140,7 +140,7 @@ cmVisualStudio10TargetGenerator::~cmVisualStudio10TargetGenerator()
void cmVisualStudio10TargetGenerator::WritePlatformConfigTag( void cmVisualStudio10TargetGenerator::WritePlatformConfigTag(
const char* tag, const char* tag,
const char* config, const std::string& config,
int indentLevel, int indentLevel,
const char* attribute, const char* attribute,
const char* end, const char* end,

View File

@ -35,7 +35,7 @@ public:
// used by cmVisualStudioGeneratorOptions // used by cmVisualStudioGeneratorOptions
void WritePlatformConfigTag( void WritePlatformConfigTag(
const char* tag, const char* tag,
const char* config, const std::string& config,
int indentLevel, int indentLevel,
const char* attribute = 0, const char* attribute = 0,
const char* end = 0, const char* end = 0,

View File

@ -122,26 +122,18 @@ public:
void CopyAttributes(cmXCodeObject* ); void CopyAttributes(cmXCodeObject* );
void AddDependLibrary(const char* configName, void AddDependLibrary(const std::string& configName,
const std::string& l) const std::string& l)
{ {
if(!configName)
{
configName = "";
}
this->DependLibraries[configName].push_back(l); this->DependLibraries[configName].push_back(l);
} }
std::map<std::string, StringVec> const& GetDependLibraries() std::map<std::string, StringVec> const& GetDependLibraries()
{ {
return this->DependLibraries; return this->DependLibraries;
} }
void AddDependTarget(const char* configName, void AddDependTarget(const std::string& configName,
const std::string& tName) const std::string& tName)
{ {
if(!configName)
{
configName = "";
}
this->DependTargets[configName].push_back(tName); this->DependTargets[configName].push_back(tName);
} }
std::map<std::string, StringVec> const& GetDependTargets() std::map<std::string, StringVec> const& GetDependTargets()

View File

@ -666,7 +666,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
else if (args[1] == "cmake_autogen" && args.size() >= 4) else if (args[1] == "cmake_autogen" && args.size() >= 4)
{ {
cmQtAutoGenerators autogen; cmQtAutoGenerators autogen;
const char *config = args[3].empty() ? 0 : args[3].c_str(); std::string const& config = args[3];
bool autogenSuccess = autogen.Run(args[2].c_str(), config); bool autogenSuccess = autogen.Run(args[2].c_str(), config);
return autogenSuccess ? 0 : 1; return autogenSuccess ? 0 : 1;
} }