cmTarget: Trivially make more API const.

This commit is contained in:
Stephen Kelly 2013-11-19 11:50:23 +01:00
parent be9dfb6b2e
commit 15eeacefc5
2 changed files with 26 additions and 25 deletions

View File

@ -438,7 +438,7 @@ bool cmTarget::IsExecutableWithExports() const
}
//----------------------------------------------------------------------------
bool cmTarget::IsLinkable()
bool cmTarget::IsLinkable() const
{
return (this->GetType() == cmTarget::STATIC_LIBRARY ||
this->GetType() == cmTarget::SHARED_LIBRARY ||
@ -834,7 +834,7 @@ void cmTarget::GetInterfaceLinkLibraries(const char *config,
//----------------------------------------------------------------------------
std::string cmTarget::GetDebugGeneratorExpressions(const std::string &value,
cmTarget::LinkLibraryType llt)
cmTarget::LinkLibraryType llt) const
{
if (llt == GENERAL)
{
@ -2276,7 +2276,7 @@ static void cmTargetCheckINTERFACE_LINK_LIBRARIES(const char* value,
}
//----------------------------------------------------------------------------
void cmTarget::CheckProperty(const char* prop, cmMakefile* context)
void cmTarget::CheckProperty(const char* prop, cmMakefile* context) const
{
// Certain properties need checking.
if(strncmp(prop, "LINK_INTERFACE_LIBRARIES", 24) == 0)
@ -2382,7 +2382,7 @@ std::string cmTarget::GetDirectory(const char* config, bool implib) const
}
//----------------------------------------------------------------------------
std::string cmTarget::GetPDBDirectory(const char* config)
std::string cmTarget::GetPDBDirectory(const char* config) const
{
if(OutputInfo const* info = this->GetOutputInfo(config))
{
@ -2453,7 +2453,7 @@ const char* cmTarget::NormalGetLocation(const char* config) const
}
//----------------------------------------------------------------------------
void cmTarget::GetTargetVersion(int& major, int& minor)
void cmTarget::GetTargetVersion(int& major, int& minor) const
{
int patch;
this->GetTargetVersion(false, major, minor, patch);
@ -2461,7 +2461,7 @@ void cmTarget::GetTargetVersion(int& major, int& minor)
//----------------------------------------------------------------------------
void cmTarget::GetTargetVersion(bool soversion,
int& major, int& minor, int& patch)
int& major, int& minor, int& patch) const
{
// Set the default values.
major = 0;
@ -2489,7 +2489,7 @@ void cmTarget::GetTargetVersion(bool soversion,
}
//----------------------------------------------------------------------------
const char* cmTarget::GetFeature(const char* feature, const char* config)
const char* cmTarget::GetFeature(const char* feature, const char* config) const
{
if(config && *config)
{
@ -3145,7 +3145,7 @@ bool cmTarget::HasMacOSXRpath(const char* config) const
}
//----------------------------------------------------------------------------
bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config)
bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config) const
{
if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY)
{
@ -3597,14 +3597,14 @@ void cmTarget::GetExecutableNames(std::string& name,
}
//----------------------------------------------------------------------------
bool cmTarget::HasImplibGNUtoMS()
bool cmTarget::HasImplibGNUtoMS() const
{
return this->HasImportLibrary() && this->GetPropertyAsBool("GNUtoMS");
}
//----------------------------------------------------------------------------
bool cmTarget::GetImplibGNUtoMS(std::string const& gnuName,
std::string& out, const char* newExt)
std::string& out, const char* newExt) const
{
if(this->HasImplibGNUtoMS() &&
gnuName.size() > 6 && gnuName.substr(gnuName.size()-6) == ".dll.a")
@ -3976,7 +3976,7 @@ bool cmTarget::ComputePDBOutputDir(const char* config, std::string& out) const
}
//----------------------------------------------------------------------------
bool cmTarget::UsesDefaultOutputDir(const char* config, bool implib)
bool cmTarget::UsesDefaultOutputDir(const char* config, bool implib) const
{
std::string dir;
return this->ComputeOutputDir(config, implib, dir);

View File

@ -219,14 +219,14 @@ public:
* Set the path where this target should be installed. This is relative to
* INSTALL_PREFIX
*/
std::string GetInstallPath() {return this->InstallPath;}
std::string GetInstallPath() const {return this->InstallPath;}
void SetInstallPath(const char *name) {this->InstallPath = name;}
/**
* Set the path where this target (if it has a runtime part) should be
* installed. This is relative to INSTALL_PREFIX
*/
std::string GetRuntimeInstallPath() {return this->RuntimeInstallPath;}
std::string GetRuntimeInstallPath() const {return this->RuntimeInstallPath;}
void SetRuntimeInstallPath(const char *name) {
this->RuntimeInstallPath = name; }
@ -253,9 +253,9 @@ public:
const char *GetProperty(const char *prop) const;
const char *GetProperty(const char *prop, cmProperty::ScopeType scope) const;
bool GetPropertyAsBool(const char *prop) const;
void CheckProperty(const char* prop, cmMakefile* context);
void CheckProperty(const char* prop, cmMakefile* context) const;
const char* GetFeature(const char* feature, const char* config);
const char* GetFeature(const char* feature, const char* config) const;
bool IsImported() const {return this->IsImportedTarget;}
@ -337,7 +337,7 @@ public:
If the configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical
pdb output directory is given. */
std::string GetPDBDirectory(const char* config = 0);
std::string GetPDBDirectory(const char* config = 0) const;
/** Get the location of the target in the build tree for the given
configuration. This location is suitable for use as the LOCATION
@ -347,12 +347,13 @@ public:
/** Get the target major and minor version numbers interpreted from
the VERSION property. Version 0 is returned if the property is
not set or cannot be parsed. */
void GetTargetVersion(int& major, int& minor);
void GetTargetVersion(int& major, int& minor) const;
/** Get the target major, minor, and patch version numbers
interpreted from the VERSION or SOVERSION property. Version 0
is returned if the property is not set or cannot be parsed. */
void GetTargetVersion(bool soversion, int& major, int& minor, int& patch);
void
GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
/**
* Make sure the full path to all source files is known.
@ -384,7 +385,7 @@ public:
/** Test for special case of a third-party shared library that has
no soname at all. */
bool IsImportedSharedLibWithoutSOName(const char* config);
bool IsImportedSharedLibWithoutSOName(const char* config) const;
/** Get the full path to the target according to the settings in its
makefile and the configuration type. */
@ -406,12 +407,12 @@ public:
std::string& pdbName, const char* config) const;
/** Does this target have a GNU implib to convert to MS format? */
bool HasImplibGNUtoMS();
bool HasImplibGNUtoMS() const;
/** Convert the given GNU import library name (.dll.a) to a name with a new
extension (.lib or ${CMAKE_IMPORT_LIBRARY_SUFFIX}). */
bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
const char* newExt = 0);
const char* newExt = 0) const;
/**
* Compute whether this target must be relinked before installing.
@ -466,10 +467,10 @@ public:
bool IsExecutableWithExports() const;
/** Return whether this target may be used to link another target. */
bool IsLinkable();
bool IsLinkable() const;
/** Return whether or not the target is for a DLL platform. */
bool IsDLLPlatform() { return this->DLLPlatform; }
bool IsDLLPlatform() const { return this->DLLPlatform; }
/** Return whether or not the target has a DLL import library. */
bool HasImportLibrary() const;
@ -500,7 +501,7 @@ public:
/** Return whether this target uses the default value for its output
directory. */
bool UsesDefaultOutputDir(const char* config, bool implib);
bool UsesDefaultOutputDir(const char* config, bool implib) const;
/** @return the mac content directory for this target. */
std::string GetMacContentDirectory(const char* config,
@ -553,7 +554,7 @@ public:
const char *config) const;
std::string GetDebugGeneratorExpressions(const std::string &value,
cmTarget::LinkLibraryType llt);
cmTarget::LinkLibraryType llt) const;
void AddSystemIncludeDirectories(const std::set<cmStdString> &incs);
void AddSystemIncludeDirectories(const std::vector<std::string> &incs);