From 6bdea066e673f0720e6faae42a4e144803679996 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 3 Nov 2013 22:26:26 +0100 Subject: [PATCH] cmTarget: Make some accessors const. --- Source/cmTarget.cxx | 14 +++++++------- Source/cmTarget.h | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 70ab94758..f8b6c926e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -507,7 +507,7 @@ bool cmTarget::FindSourceFiles() } //---------------------------------------------------------------------------- -std::vector const& cmTarget::GetSourceFiles() +std::vector const& cmTarget::GetSourceFiles() const { return this->SourceFiles; } @@ -3086,7 +3086,7 @@ std::string cmTarget::GetSOName(const char* config) const } //---------------------------------------------------------------------------- -bool cmTarget::HasMacOSXRpath(const char* config) +bool cmTarget::HasMacOSXRpath(const char* config) const { bool install_name_is_rpath = false; bool macosx_rpath = this->GetPropertyAsBool("MACOSX_RPATH"); @@ -3233,7 +3233,7 @@ cmTarget::GetFullNameImported(const char* config, bool implib) const //---------------------------------------------------------------------------- void cmTarget::GetFullNameComponents(std::string& prefix, std::string& base, std::string& suffix, const char* config, - bool implib) + bool implib) const { this->GetFullNameInternal(config, implib, prefix, base, suffix); } @@ -3669,7 +3669,7 @@ bool cmTarget::HaveInstallTreeRPATH() const } //---------------------------------------------------------------------------- -bool cmTarget::NeedRelinkBeforeInstall(const char* config) +bool cmTarget::NeedRelinkBeforeInstall(const char* config) const { // Only executables and shared libraries can have an rpath and may // need relinking. @@ -3732,7 +3732,7 @@ bool cmTarget::NeedRelinkBeforeInstall(const char* config) } //---------------------------------------------------------------------------- -std::string cmTarget::GetInstallNameDirForBuildTree(const char* config) +std::string cmTarget::GetInstallNameDirForBuildTree(const char* config) const { // If building directly for installation then the build tree install_name // is the same as the install tree. @@ -3765,7 +3765,7 @@ std::string cmTarget::GetInstallNameDirForBuildTree(const char* config) } //---------------------------------------------------------------------------- -std::string cmTarget::GetInstallNameDirForInstallTree() +std::string cmTarget::GetInstallNameDirForInstallTree() const { if(this->Makefile->IsOn("CMAKE_PLATFORM_HAS_INSTALLNAME")) { @@ -5802,7 +5802,7 @@ std::string cmTarget::BuildMacContentDirectory(const std::string& base, //---------------------------------------------------------------------------- std::string cmTarget::GetMacContentDirectory(const char* config, - bool implib) + bool implib) const { // Start with the output directory for the target. std::string fpath = this->GetDirectory(config, implib); diff --git a/Source/cmTarget.h b/Source/cmTarget.h index eae500930..fbb49141f 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -124,7 +124,7 @@ public: /** * Get the list of the source files used by this target */ - std::vector const& GetSourceFiles(); + std::vector const& GetSourceFiles() const; void AddSourceFile(cmSourceFile* sf); std::vector const& GetObjectLibraries() const { @@ -361,7 +361,7 @@ public: std::string GetFullName(const char* config=0, bool implib = false) const; void GetFullNameComponents(std::string& prefix, std::string& base, std::string& suffix, - const char* config=0, bool implib = false); + const char* config=0, bool implib = false) const; /** Get the name of the pdb file for the target. */ std::string GetPDBName(const char* config=0) const; @@ -373,7 +373,7 @@ public: std::string GetSOName(const char* config) const; /** Whether this library has \@rpath and platform supports it. */ - bool HasMacOSXRpath(const char* config); + bool HasMacOSXRpath(const char* config) const; /** Test for special case of a third-party shared library that has no soname at all. */ @@ -409,7 +409,7 @@ public: /** * Compute whether this target must be relinked before installing. */ - bool NeedRelinkBeforeInstall(const char* config); + bool NeedRelinkBeforeInstall(const char* config) const; bool HaveBuildTreeRPATH(const char *config) const; bool HaveInstallTreeRPATH() const; @@ -420,11 +420,11 @@ public: /** Return the install name directory for the target in the * build tree. For example: "\@rpath/", "\@loader_path/", * or "/full/path/to/library". */ - std::string GetInstallNameDirForBuildTree(const char* config); + std::string GetInstallNameDirForBuildTree(const char* config) const; /** Return the install name directory for the target in the * install tree. For example: "\@rpath/" or "\@loader_path/". */ - std::string GetInstallNameDirForInstallTree(); + std::string GetInstallNameDirForInstallTree() const; cmComputeLinkInformation* GetLinkInformation(const char* config, cmTarget const* head = 0) const; @@ -497,7 +497,7 @@ public: /** @return the mac content directory for this target. */ std::string GetMacContentDirectory(const char* config, - bool implib); + bool implib) const; /** @return whether this target have a well defined output file name. */ bool HaveWellDefinedOutputFiles() const;