diff options
author | Brad King <brad.king@kitware.com> | 2013-11-01 13:40:05 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-11-01 13:40:05 (GMT) |
commit | de5c29890f2139318b5c4c34e69774f3fa70ef30 (patch) | |
tree | 1418488c6521dcd20e0a9fed29fb6ca38669277b /Source/cmTarget.cxx | |
parent | a549b68d37bc3d1b87cfd407d4edb45fa02079dd (diff) | |
parent | c4373b33b2ad7c6db3b000b0615ed381f05ac5f3 (diff) | |
download | CMake-de5c29890f2139318b5c4c34e69774f3fa70ef30.zip CMake-de5c29890f2139318b5c4c34e69774f3fa70ef30.tar.gz CMake-de5c29890f2139318b5c4c34e69774f3fa70ef30.tar.bz2 |
Merge topic 'constify'
c4373b3 cmTarget: Make GetProperty() const.
cfb6661 Don't call SetProperty from GetProperty.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 211 |
1 files changed, 112 insertions, 99 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 92eca0f..70ab947 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -70,9 +70,9 @@ struct cmTarget::ImportInfo cmTarget::LinkInterface LinkInterface; }; -struct TargetConfigPair : public std::pair<cmTarget*, std::string> { - TargetConfigPair(cmTarget* tgt, const std::string &config) - : std::pair<cmTarget*, std::string>(tgt, config) {} +struct TargetConfigPair : public std::pair<cmTarget const* , std::string> { + TargetConfigPair(cmTarget const* tgt, const std::string &config) + : std::pair<cmTarget const* , std::string>(tgt, config) {} }; //---------------------------------------------------------------------------- @@ -428,7 +428,7 @@ std::string cmTarget::GetSupportDirectory() const } //---------------------------------------------------------------------------- -bool cmTarget::IsExecutableWithExports() +bool cmTarget::IsExecutableWithExports() const { return (this->GetType() == cmTarget::EXECUTABLE && this->GetPropertyAsBool("ENABLE_EXPORTS")); @@ -446,7 +446,7 @@ bool cmTarget::IsLinkable() } //---------------------------------------------------------------------------- -bool cmTarget::HasImportLibrary() +bool cmTarget::HasImportLibrary() const { return (this->DLLPlatform && (this->GetType() == cmTarget::SHARED_LIBRARY || @@ -454,7 +454,7 @@ bool cmTarget::HasImportLibrary() } //---------------------------------------------------------------------------- -bool cmTarget::IsFrameworkOnApple() +bool cmTarget::IsFrameworkOnApple() const { return (this->GetType() == cmTarget::SHARED_LIBRARY && this->Makefile->IsOn("APPLE") && @@ -462,7 +462,7 @@ bool cmTarget::IsFrameworkOnApple() } //---------------------------------------------------------------------------- -bool cmTarget::IsAppBundleOnApple() +bool cmTarget::IsAppBundleOnApple() const { return (this->GetType() == cmTarget::EXECUTABLE && this->Makefile->IsOn("APPLE") && @@ -470,7 +470,7 @@ bool cmTarget::IsAppBundleOnApple() } //---------------------------------------------------------------------------- -bool cmTarget::IsCFBundleOnApple() +bool cmTarget::IsCFBundleOnApple() const { return (this->GetType() == cmTarget::MODULE_LIBRARY && this->Makefile->IsOn("APPLE") && @@ -478,7 +478,7 @@ bool cmTarget::IsCFBundleOnApple() } //---------------------------------------------------------------------------- -bool cmTarget::IsBundleOnApple() +bool cmTarget::IsBundleOnApple() const { return this->IsFrameworkOnApple() || this->IsAppBundleOnApple() || this->IsCFBundleOnApple(); @@ -715,13 +715,13 @@ void cmTarget::AddLinkDirectory(const char* d) } //---------------------------------------------------------------------------- -const std::vector<std::string>& cmTarget::GetLinkDirectories() +const std::vector<std::string>& cmTarget::GetLinkDirectories() const { return this->LinkDirectories; } //---------------------------------------------------------------------------- -cmTarget::LinkLibraryType cmTarget::ComputeLinkType(const char* config) +cmTarget::LinkLibraryType cmTarget::ComputeLinkType(const char* config) const { // No configuration is always optimized. if(!(config && *config)) @@ -785,7 +785,8 @@ bool cmTarget::NameResolvesToFramework(const std::string& libname) //---------------------------------------------------------------------------- void cmTarget::GetDirectLinkLibraries(const char *config, - std::vector<std::string> &libs, cmTarget *head) + std::vector<std::string> &libs, + cmTarget const* head) const { const char *prop = this->GetProperty("LINK_LIBRARIES"); if (prop) @@ -1512,7 +1513,7 @@ void cmTarget::AppendProperty(const char* prop, const char* value, } //---------------------------------------------------------------------------- -const char* cmTarget::GetExportName() +const char* cmTarget::GetExportName() const { const char *exportName = this->GetProperty("EXPORT_NAME"); @@ -2322,7 +2323,7 @@ void cmTarget::MarkAsImported() } //---------------------------------------------------------------------------- -bool cmTarget::HaveWellDefinedOutputFiles() +bool cmTarget::HaveWellDefinedOutputFiles() const { return this->GetType() == cmTarget::STATIC_LIBRARY || @@ -2332,7 +2333,7 @@ bool cmTarget::HaveWellDefinedOutputFiles() } //---------------------------------------------------------------------------- -cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config) +cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config) const { // There is no output information for imported targets. if(this->IsImported()) @@ -2377,7 +2378,7 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config) } //---------------------------------------------------------------------------- -std::string cmTarget::GetDirectory(const char* config, bool implib) +std::string cmTarget::GetDirectory(const char* config, bool implib) const { if (this->IsImported()) { @@ -2406,7 +2407,7 @@ std::string cmTarget::GetPDBDirectory(const char* config) } //---------------------------------------------------------------------------- -const char* cmTarget::GetLocation(const char* config) +const char* cmTarget::GetLocation(const char* config) const { if (this->IsImported()) { @@ -2419,7 +2420,7 @@ const char* cmTarget::GetLocation(const char* config) } //---------------------------------------------------------------------------- -const char* cmTarget::ImportedGetLocation(const char* config) +const char* cmTarget::ImportedGetLocation(const char* config) const { static std::string location; location = this->ImportedGetFullPath(config, false); @@ -2427,7 +2428,7 @@ const char* cmTarget::ImportedGetLocation(const char* config) } //---------------------------------------------------------------------------- -const char* cmTarget::NormalGetLocation(const char* config) +const char* cmTarget::NormalGetLocation(const char* config) const { static std::string location; // Handle the configuration-specific case first. @@ -2522,13 +2523,13 @@ const char* cmTarget::GetFeature(const char* feature, const char* config) } //---------------------------------------------------------------------------- -const char *cmTarget::GetProperty(const char* prop) +const char *cmTarget::GetProperty(const char* prop) const { return this->GetProperty(prop, cmProperty::TARGET); } //---------------------------------------------------------------------------- -bool cmTarget::HandleLocationPropertyPolicy() +bool cmTarget::HandleLocationPropertyPolicy() const { if (this->IsImported()) { @@ -2566,7 +2567,7 @@ bool cmTarget::HandleLocationPropertyPolicy() //---------------------------------------------------------------------------- const char *cmTarget::GetProperty(const char* prop, - cmProperty::ScopeType scope) + cmProperty::ScopeType scope) const { if(!prop) { @@ -2603,7 +2604,8 @@ const char *cmTarget::GetProperty(const char* prop, // cannot take into account the per-configuration name of the // target because the configuration type may not be known at // CMake time. - this->SetProperty("LOCATION", this->GetLocation(0)); + this->Properties.SetProperty("LOCATION", this->GetLocation(0), + cmProperty::TARGET); } // Support "LOCATION_<CONFIG>". @@ -2614,7 +2616,9 @@ const char *cmTarget::GetProperty(const char* prop, return 0; } std::string configName = prop+9; - this->SetProperty(prop, this->GetLocation(configName.c_str())); + this->Properties.SetProperty(prop, + this->GetLocation(configName.c_str()), + cmProperty::TARGET); } else { @@ -2629,7 +2633,9 @@ const char *cmTarget::GetProperty(const char* prop, { return 0; } - this->SetProperty(prop, this->GetLocation(configName.c_str())); + this->Properties.SetProperty(prop, + this->GetLocation(configName.c_str()), + cmProperty::TARGET); } } } @@ -2734,7 +2740,8 @@ const char *cmTarget::GetProperty(const char* prop, // Append this list entry. ss << sname; } - this->SetProperty("SOURCES", ss.str().c_str()); + this->Properties.SetProperty("SOURCES", ss.str().c_str(), + cmProperty::TARGET); } // the type property returns what type the target is @@ -2753,7 +2760,7 @@ const char *cmTarget::GetProperty(const char* prop, } //---------------------------------------------------------------------------- -bool cmTarget::GetPropertyAsBool(const char* prop) +bool cmTarget::GetPropertyAsBool(const char* prop) const { return cmSystemTools::IsOn(this->GetProperty(prop)); } @@ -2762,13 +2769,13 @@ bool cmTarget::GetPropertyAsBool(const char* prop) class cmTargetCollectLinkLanguages { public: - cmTargetCollectLinkLanguages(cmTarget* target, const char* config, + cmTargetCollectLinkLanguages(cmTarget const* target, const char* config, std::set<cmStdString>& languages, - cmTarget* head): + cmTarget const* head): Config(config), Languages(languages), HeadTarget(head) { this->Visited.insert(target); } - void Visit(cmTarget* target) + void Visit(cmTarget const* target) { if(!target || !this->Visited.insert(target).second) { @@ -2795,14 +2802,15 @@ public: private: const char* Config; std::set<cmStdString>& Languages; - cmTarget* HeadTarget; - std::set<cmTarget*> Visited; + cmTarget const* HeadTarget; + std::set<cmTarget const*> Visited; }; //---------------------------------------------------------------------------- -const char* cmTarget::GetLinkerLanguage(const char* config, cmTarget *head) +const char* cmTarget::GetLinkerLanguage(const char* config, + cmTarget const* head) const { - cmTarget *headTarget = head ? head : this; + cmTarget const* headTarget = head ? head : this; const char* lang = this->GetLinkClosure(config, headTarget) ->LinkerLanguage.c_str(); return *lang? lang : 0; @@ -2810,7 +2818,7 @@ const char* cmTarget::GetLinkerLanguage(const char* config, cmTarget *head) //---------------------------------------------------------------------------- cmTarget::LinkClosure const* cmTarget::GetLinkClosure(const char* config, - cmTarget *head) + cmTarget const* head) const { TargetConfigPair key(head, cmSystemTools::UpperCase(config ? config : "")); cmTargetInternals::LinkClosureMapType::iterator @@ -2829,12 +2837,12 @@ cmTarget::LinkClosure const* cmTarget::GetLinkClosure(const char* config, class cmTargetSelectLinker { int Preference; - cmTarget* Target; + cmTarget const* Target; cmMakefile* Makefile; cmGlobalGenerator* GG; std::set<cmStdString> Preferred; public: - cmTargetSelectLinker(cmTarget* target): Preference(0), Target(target) + cmTargetSelectLinker(cmTarget const* target): Preference(0), Target(target) { this->Makefile = this->Target->GetMakefile(); this->GG = this->Makefile->GetLocalGenerator()->GetGlobalGenerator(); @@ -2880,7 +2888,7 @@ public: //---------------------------------------------------------------------------- void cmTarget::ComputeLinkClosure(const char* config, LinkClosure& lc, - cmTarget *head) + cmTarget const* head) const { // Get languages built in this target. std::set<cmStdString> languages; @@ -2943,7 +2951,7 @@ void cmTarget::ComputeLinkClosure(const char* config, LinkClosure& lc, } //---------------------------------------------------------------------------- -const char* cmTarget::GetSuffixVariableInternal(bool implib) +const char* cmTarget::GetSuffixVariableInternal(bool implib) const { switch(this->GetType()) { @@ -2969,7 +2977,7 @@ const char* cmTarget::GetSuffixVariableInternal(bool implib) //---------------------------------------------------------------------------- -const char* cmTarget::GetPrefixVariableInternal(bool implib) +const char* cmTarget::GetPrefixVariableInternal(bool implib) const { switch(this->GetType()) { @@ -2992,7 +3000,7 @@ const char* cmTarget::GetPrefixVariableInternal(bool implib) } //---------------------------------------------------------------------------- -std::string cmTarget::GetPDBName(const char* config) +std::string cmTarget::GetPDBName(const char* config) const { std::string prefix; std::string base; @@ -3024,7 +3032,7 @@ std::string cmTarget::GetPDBName(const char* config) } //---------------------------------------------------------------------------- -bool cmTarget::HasSOName(const char* config) +bool cmTarget::HasSOName(const char* config) const { // soname is supported only for shared libraries and modules, // and then only when the platform supports an soname flag. @@ -3036,7 +3044,7 @@ bool cmTarget::HasSOName(const char* config) } //---------------------------------------------------------------------------- -std::string cmTarget::GetSOName(const char* config) +std::string cmTarget::GetSOName(const char* config) const { if(this->IsImported()) { @@ -3164,7 +3172,7 @@ bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config) } //---------------------------------------------------------------------------- -std::string cmTarget::NormalGetRealName(const char* config) +std::string cmTarget::NormalGetRealName(const char* config) const { // This should not be called for imported targets. // TODO: Split cmTarget into a class hierarchy to get compile-time @@ -3202,7 +3210,7 @@ std::string cmTarget::NormalGetRealName(const char* config) } //---------------------------------------------------------------------------- -std::string cmTarget::GetFullName(const char* config, bool implib) +std::string cmTarget::GetFullName(const char* config, bool implib) const { if(this->IsImported()) { @@ -3215,7 +3223,8 @@ std::string cmTarget::GetFullName(const char* config, bool implib) } //---------------------------------------------------------------------------- -std::string cmTarget::GetFullNameImported(const char* config, bool implib) +std::string +cmTarget::GetFullNameImported(const char* config, bool implib) const { return cmSystemTools::GetFilenameName( this->ImportedGetFullPath(config, implib)); @@ -3231,7 +3240,7 @@ void cmTarget::GetFullNameComponents(std::string& prefix, std::string& base, //---------------------------------------------------------------------------- std::string cmTarget::GetFullPath(const char* config, bool implib, - bool realname) + bool realname) const { if(this->IsImported()) { @@ -3245,7 +3254,7 @@ std::string cmTarget::GetFullPath(const char* config, bool implib, //---------------------------------------------------------------------------- std::string cmTarget::NormalGetFullPath(const char* config, bool implib, - bool realname) + bool realname) const { std::string fpath = this->GetDirectory(config, implib); fpath += "/"; @@ -3272,7 +3281,8 @@ std::string cmTarget::NormalGetFullPath(const char* config, bool implib, } //---------------------------------------------------------------------------- -std::string cmTarget::ImportedGetFullPath(const char* config, bool implib) +std::string +cmTarget::ImportedGetFullPath(const char* config, bool implib) const { std::string result; if(cmTarget::ImportInfo const* info = this->GetImportInfo(config, this)) @@ -3288,7 +3298,8 @@ std::string cmTarget::ImportedGetFullPath(const char* config, bool implib) } //---------------------------------------------------------------------------- -std::string cmTarget::GetFullNameInternal(const char* config, bool implib) +std::string +cmTarget::GetFullNameInternal(const char* config, bool implib) const { std::string prefix; std::string base; @@ -3302,7 +3313,7 @@ void cmTarget::GetFullNameInternal(const char* config, bool implib, std::string& outPrefix, std::string& outBase, - std::string& outSuffix) + std::string& outSuffix) const { // Use just the target name for non-main target types. if(this->GetType() != cmTarget::STATIC_LIBRARY && @@ -3440,7 +3451,7 @@ void cmTarget::GetLibraryNames(std::string& name, std::string& realName, std::string& impName, std::string& pdbName, - const char* config) + const char* config) const { // This should not be called for imported targets. // TODO: Split cmTarget into a class hierarchy to get compile-time @@ -3526,7 +3537,7 @@ void cmTarget::ComputeVersionedName(std::string& vName, std::string const& base, std::string const& suffix, std::string const& name, - const char* version) + const char* version) const { vName = this->IsApple? (prefix+base) : name; if(version) @@ -3542,7 +3553,7 @@ void cmTarget::GetExecutableNames(std::string& name, std::string& realName, std::string& impName, std::string& pdbName, - const char* config) + const char* config) const { // This should not be called for imported targets. // TODO: Split cmTarget into a class hierarchy to get compile-time @@ -3638,7 +3649,7 @@ void cmTarget::SetPropertyDefault(const char* property, } //---------------------------------------------------------------------------- -bool cmTarget::HaveBuildTreeRPATH(const char *config) +bool cmTarget::HaveBuildTreeRPATH(const char *config) const { if (this->GetPropertyAsBool("SKIP_BUILD_RPATH")) { @@ -3650,7 +3661,7 @@ bool cmTarget::HaveBuildTreeRPATH(const char *config) } //---------------------------------------------------------------------------- -bool cmTarget::HaveInstallTreeRPATH() +bool cmTarget::HaveInstallTreeRPATH() const { const char* install_rpath = this->GetProperty("INSTALL_RPATH"); return (install_rpath && *install_rpath) && @@ -3783,7 +3794,7 @@ std::string cmTarget::GetInstallNameDirForInstallTree() } //---------------------------------------------------------------------------- -const char* cmTarget::GetOutputTargetType(bool implib) +const char* cmTarget::GetOutputTargetType(bool implib) const { switch(this->GetType()) { @@ -3840,7 +3851,7 @@ const char* cmTarget::GetOutputTargetType(bool implib) //---------------------------------------------------------------------------- bool cmTarget::ComputeOutputDir(const char* config, - bool implib, std::string& out) + bool implib, std::string& out) const { bool usesDefaultOutputDir = false; @@ -3920,7 +3931,7 @@ bool cmTarget::ComputeOutputDir(const char* config, } //---------------------------------------------------------------------------- -bool cmTarget::ComputePDBOutputDir(const char* config, std::string& out) +bool cmTarget::ComputePDBOutputDir(const char* config, std::string& out) const { // Look for a target property defining the target output directory // based on the target type. @@ -3986,7 +3997,7 @@ bool cmTarget::UsesDefaultOutputDir(const char* config, bool implib) } //---------------------------------------------------------------------------- -std::string cmTarget::GetOutputName(const char* config, bool implib) +std::string cmTarget::GetOutputName(const char* config, bool implib) const { std::vector<std::string> props; std::string type = this->GetOutputTargetType(implib); @@ -4023,7 +4034,7 @@ std::string cmTarget::GetOutputName(const char* config, bool implib) } //---------------------------------------------------------------------------- -std::string cmTarget::GetFrameworkVersion() +std::string cmTarget::GetFrameworkVersion() const { if(const char* fversion = this->GetProperty("FRAMEWORK_VERSION")) { @@ -4066,7 +4077,7 @@ const char* cmTarget::GetExportMacro() } //---------------------------------------------------------------------------- -bool cmTarget::IsNullImpliedByLinkLibraries(const std::string &p) +bool cmTarget::IsNullImpliedByLinkLibraries(const std::string &p) const { return this->LinkImplicitNullProperties.find(p) != this->LinkImplicitNullProperties.end(); @@ -4074,20 +4085,21 @@ bool cmTarget::IsNullImpliedByLinkLibraries(const std::string &p) //---------------------------------------------------------------------------- template<typename PropertyType> -PropertyType getTypedProperty(cmTarget *tgt, const char *prop, +PropertyType getTypedProperty(cmTarget const* tgt, const char *prop, PropertyType *); //---------------------------------------------------------------------------- template<> -bool getTypedProperty<bool>(cmTarget *tgt, const char *prop, bool *) +bool getTypedProperty<bool>(cmTarget const* tgt, const char *prop, bool *) { return tgt->GetPropertyAsBool(prop); } //---------------------------------------------------------------------------- template<> -const char *getTypedProperty<const char *>(cmTarget *tgt, const char *prop, - const char **) +const char *getTypedProperty<const char *>(cmTarget const* tgt, + const char *prop, + const char **) { return tgt->GetProperty(prop); } @@ -4197,7 +4209,7 @@ const char* impliedValue<const char*>(const char*) //---------------------------------------------------------------------------- template<typename PropertyType> -PropertyType checkInterfacePropertyCompatibility(cmTarget *tgt, +PropertyType checkInterfacePropertyCompatibility(cmTarget const* tgt, const std::string &p, const char *config, const char *defaultValue, @@ -4346,7 +4358,7 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget *tgt, //---------------------------------------------------------------------------- bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p, - const char *config) + const char *config) const { return checkInterfacePropertyCompatibility<bool>(this, p, config, "FALSE", BoolType, 0); @@ -4355,7 +4367,7 @@ bool cmTarget::GetLinkInterfaceDependentBoolProperty(const std::string &p, //---------------------------------------------------------------------------- const char * cmTarget::GetLinkInterfaceDependentStringProperty( const std::string &p, - const char *config) + const char *config) const { return checkInterfacePropertyCompatibility<const char *>(this, p, @@ -4367,7 +4379,7 @@ const char * cmTarget::GetLinkInterfaceDependentStringProperty( //---------------------------------------------------------------------------- const char * cmTarget::GetLinkInterfaceDependentNumberMinProperty( const std::string &p, - const char *config) + const char *config) const { return checkInterfacePropertyCompatibility<const char *>(this, p, @@ -4379,7 +4391,7 @@ const char * cmTarget::GetLinkInterfaceDependentNumberMinProperty( //---------------------------------------------------------------------------- const char * cmTarget::GetLinkInterfaceDependentNumberMaxProperty( const std::string &p, - const char *config) + const char *config) const { return checkInterfacePropertyCompatibility<const char *>(this, p, @@ -4389,7 +4401,7 @@ const char * cmTarget::GetLinkInterfaceDependentNumberMaxProperty( } //---------------------------------------------------------------------------- -bool isLinkDependentProperty(cmTarget *tgt, const std::string &p, +bool isLinkDependentProperty(cmTarget const* tgt, const std::string &p, const char *interfaceProperty, const char *config) { @@ -4433,7 +4445,7 @@ bool isLinkDependentProperty(cmTarget *tgt, const std::string &p, //---------------------------------------------------------------------------- bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p, - const char *config) + const char *config) const { if (this->TargetTypeValue == OBJECT_LIBRARY) { @@ -4446,7 +4458,7 @@ bool cmTarget::IsLinkInterfaceDependentBoolProperty(const std::string &p, //---------------------------------------------------------------------------- bool cmTarget::IsLinkInterfaceDependentStringProperty(const std::string &p, - const char *config) + const char *config) const { if (this->TargetTypeValue == OBJECT_LIBRARY) { @@ -4458,7 +4470,7 @@ bool cmTarget::IsLinkInterfaceDependentStringProperty(const std::string &p, //---------------------------------------------------------------------------- bool cmTarget::IsLinkInterfaceDependentNumberMinProperty(const std::string &p, - const char *config) + const char *config) const { if (this->TargetTypeValue == OBJECT_LIBRARY) { @@ -4470,7 +4482,7 @@ bool cmTarget::IsLinkInterfaceDependentNumberMinProperty(const std::string &p, //---------------------------------------------------------------------------- bool cmTarget::IsLinkInterfaceDependentNumberMaxProperty(const std::string &p, - const char *config) + const char *config) const { if (this->TargetTypeValue == OBJECT_LIBRARY) { @@ -4494,7 +4506,7 @@ void cmTarget::GetLanguages(std::set<cmStdString>& languages) const } //---------------------------------------------------------------------------- -bool cmTarget::IsChrpathUsed(const char* config) +bool cmTarget::IsChrpathUsed(const char* config) const { // Only certain target types have an rpath. if(!(this->GetType() == cmTarget::SHARED_LIBRARY || @@ -4561,7 +4573,7 @@ bool cmTarget::IsChrpathUsed(const char* config) //---------------------------------------------------------------------------- cmTarget::ImportInfo const* -cmTarget::GetImportInfo(const char* config, cmTarget *headTarget) +cmTarget::GetImportInfo(const char* config, cmTarget const* headTarget) const { // There is no imported information for non-imported targets. if(!this->IsImported()) @@ -4611,7 +4623,7 @@ cmTarget::GetImportInfo(const char* config, cmTarget *headTarget) bool cmTarget::GetMappedConfig(std::string const& desired_config, const char** loc, const char** imp, - std::string& suffix) + std::string& suffix) const { // Track the configuration-specific property suffix. suffix = "_"; @@ -4733,7 +4745,7 @@ bool cmTarget::GetMappedConfig(std::string const& desired_config, //---------------------------------------------------------------------------- void cmTarget::ComputeImportInfo(std::string const& desired_config, ImportInfo& info, - cmTarget *headTarget) + cmTarget const* headTarget) const { // This method finds information about an imported target from its // properties. The "IMPORTED_" namespace is reserved for properties @@ -4919,7 +4931,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config, //---------------------------------------------------------------------------- cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config, - cmTarget *head) + cmTarget const* head) const { // Imported targets have their own link interface. if(this->IsImported()) @@ -4961,8 +4973,8 @@ cmTarget::LinkInterface const* cmTarget::GetLinkInterface(const char* config, //---------------------------------------------------------------------------- void cmTarget::GetTransitivePropertyLinkLibraries( const char* config, - cmTarget *headTarget, - std::vector<std::string> &libs) + cmTarget const* headTarget, + std::vector<std::string> &libs) const { cmTarget::LinkInterface const* iface = this->GetLinkInterface(config, headTarget); @@ -5002,7 +5014,7 @@ void cmTarget::GetTransitivePropertyLinkLibraries( //---------------------------------------------------------------------------- bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface, - cmTarget *headTarget) + cmTarget const* headTarget) const { // Construct the property name suffix for this configuration. std::string suffix = "_"; @@ -5264,7 +5276,7 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface, //---------------------------------------------------------------------------- cmTarget::LinkImplementation const* -cmTarget::GetLinkImplementation(const char* config, cmTarget *head) +cmTarget::GetLinkImplementation(const char* config, cmTarget const* head) const { // There is no link implementation for imported targets. if(this->IsImported()) @@ -5294,7 +5306,7 @@ cmTarget::GetLinkImplementation(const char* config, cmTarget *head) //---------------------------------------------------------------------------- void cmTarget::ComputeLinkImplementation(const char* config, LinkImplementation& impl, - cmTarget *head) + cmTarget const* head) const { // Compute which library configuration to link. cmTarget::LinkLibraryType linkType = this->ComputeLinkType(config); @@ -5376,7 +5388,8 @@ void cmTarget::ComputeLinkImplementation(const char* config, // Get languages used in our source files. this->GetLanguages(languages); // Get languages used in object library sources. - for(std::vector<std::string>::iterator i = this->ObjectLibraries.begin(); + for(std::vector<std::string>::const_iterator + i = this->ObjectLibraries.begin(); i != this->ObjectLibraries.end(); ++i) { if(cmTarget* objLib = this->Makefile->FindTargetToUse(i->c_str())) @@ -5396,7 +5409,7 @@ void cmTarget::ComputeLinkImplementation(const char* config, } //---------------------------------------------------------------------------- -std::string cmTarget::CheckCMP0004(std::string const& item) +std::string cmTarget::CheckCMP0004(std::string const& item) const { // Strip whitespace off the library names because we used to do this // in case variables were expanded at generate time. We no longer @@ -5455,14 +5468,14 @@ std::string cmTarget::CheckCMP0004(std::string const& item) } template<typename PropertyType> -PropertyType getLinkInterfaceDependentProperty(cmTarget *tgt, +PropertyType getLinkInterfaceDependentProperty(cmTarget const* tgt, const std::string prop, const char *config, CompatibleType, PropertyType *); template<> -bool getLinkInterfaceDependentProperty(cmTarget *tgt, +bool getLinkInterfaceDependentProperty(cmTarget const* tgt, const std::string prop, const char *config, CompatibleType, bool *) @@ -5471,7 +5484,7 @@ bool getLinkInterfaceDependentProperty(cmTarget *tgt, } template<> -const char * getLinkInterfaceDependentProperty(cmTarget *tgt, +const char * getLinkInterfaceDependentProperty(cmTarget const* tgt, const std::string prop, const char *config, CompatibleType t, @@ -5495,7 +5508,7 @@ const char * getLinkInterfaceDependentProperty(cmTarget *tgt, //---------------------------------------------------------------------------- template<typename PropertyType> -void checkPropertyConsistency(cmTarget *depender, cmTarget *dependee, +void checkPropertyConsistency(cmTarget const* depender, cmTarget *dependee, const char *propName, std::set<cmStdString> &emitted, const char *config, @@ -5587,7 +5600,7 @@ static cmStdString intersect(const std::set<cmStdString> &s1, //---------------------------------------------------------------------------- void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info, - const char* config) + const char* config) const { const cmComputeLinkInformation::ItemVector &deps = info->GetItems(); @@ -5690,9 +5703,9 @@ void cmTarget::CheckPropertyCompatibility(cmComputeLinkInformation *info, //---------------------------------------------------------------------------- cmComputeLinkInformation* -cmTarget::GetLinkInformation(const char* config, cmTarget *head) +cmTarget::GetLinkInformation(const char* config, cmTarget const* head) const { - cmTarget *headTarget = head ? head : this; + cmTarget const* headTarget = head ? head : this; // Lookup any existing information for this configuration. TargetConfigPair key(headTarget, cmSystemTools::UpperCase(config?config:"")); @@ -5723,7 +5736,7 @@ cmTarget::GetLinkInformation(const char* config, cmTarget *head) //---------------------------------------------------------------------------- std::string cmTarget::GetFrameworkDirectory(const char* config, - bool rootDir) + bool rootDir) const { std::string fpath; fpath += this->GetOutputName(config, false); @@ -5738,7 +5751,7 @@ std::string cmTarget::GetFrameworkDirectory(const char* config, //---------------------------------------------------------------------------- std::string cmTarget::GetCFBundleDirectory(const char* config, - bool contentOnly) + bool contentOnly) const { std::string fpath; fpath += this->GetOutputName(config, false); @@ -5757,7 +5770,7 @@ std::string cmTarget::GetCFBundleDirectory(const char* config, //---------------------------------------------------------------------------- std::string cmTarget::GetAppBundleDirectory(const char* config, - bool contentOnly) + bool contentOnly) const { std::string fpath = this->GetFullName(config, false); fpath += ".app/Contents"; @@ -5769,7 +5782,7 @@ std::string cmTarget::GetAppBundleDirectory(const char* config, //---------------------------------------------------------------------------- std::string cmTarget::BuildMacContentDirectory(const std::string& base, const char* config, - bool contentOnly) + bool contentOnly) const { std::string fpath = base; if(this->IsAppBundleOnApple()) |