STYLE: Fixed line-too-long, fixed indentation, removed trailing whitespace, added function separator comment lines.

This commit is contained in:
Brad King 2007-07-02 13:32:41 -04:00
parent 930bb0cd37
commit cac79e92b8
2 changed files with 246 additions and 211 deletions

View File

@ -41,7 +41,7 @@ cmTarget::cmTarget()
this->IsImportedTarget = false; this->IsImportedTarget = false;
} }
// define properties //----------------------------------------------------------------------------
void cmTarget::DefineProperties(cmake *cm) void cmTarget::DefineProperties(cmake *cm)
{ {
cm->DefineProperty cm->DefineProperty
@ -666,6 +666,7 @@ void cmTarget::AddSources(std::vector<std::string> const& srcs)
} }
} }
//----------------------------------------------------------------------------
cmSourceFile* cmTarget::AddSource(const char* s) cmSourceFile* cmTarget::AddSource(const char* s)
{ {
std::string src = s; std::string src = s;
@ -679,6 +680,7 @@ cmSourceFile* cmTarget::AddSource(const char* s)
return sf; return sf;
} }
//----------------------------------------------------------------------------
void cmTarget::MergeLinkLibraries( cmMakefile& mf, void cmTarget::MergeLinkLibraries( cmMakefile& mf,
const char *selfname, const char *selfname,
const LinkLibraryVectorType& libs ) const LinkLibraryVectorType& libs )
@ -767,6 +769,7 @@ const std::vector<std::string>& cmTarget::GetLinkDirectories()
return this->LinkDirectories; return this->LinkDirectories;
} }
//----------------------------------------------------------------------------
void cmTarget::ClearDependencyInformation( cmMakefile& mf, void cmTarget::ClearDependencyInformation( cmMakefile& mf,
const char* target ) const char* target )
{ {
@ -794,8 +797,7 @@ void cmTarget::ClearDependencyInformation( cmMakefile& mf,
} }
} }
//----------------------------------------------------------------------------
void cmTarget::AddLinkLibrary(const std::string& lib, void cmTarget::AddLinkLibrary(const std::string& lib,
LinkLibraryType llt) LinkLibraryType llt)
{ {
@ -806,6 +808,7 @@ void cmTarget::AddLinkLibrary(const std::string& lib,
this->LinkLibraries.push_back(tmp); this->LinkLibraries.push_back(tmp);
} }
//----------------------------------------------------------------------------
bool cmTarget::AddFramework(const std::string& libname, LinkLibraryType llt) bool cmTarget::AddFramework(const std::string& libname, LinkLibraryType llt)
{ {
(void)llt; // TODO: What is this? (void)llt; // TODO: What is this?
@ -825,6 +828,8 @@ bool cmTarget::AddFramework(const std::string& libname, LinkLibraryType llt)
} }
return false; return false;
} }
//----------------------------------------------------------------------------
void cmTarget::AddLinkLibrary(cmMakefile& mf, void cmTarget::AddLinkLibrary(cmMakefile& mf,
const char *target, const char* lib, const char *target, const char* lib,
LinkLibraryType llt) LinkLibraryType llt)
@ -880,6 +885,7 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf,
} }
//----------------------------------------------------------------------------
void void
cmTarget::AnalyzeLibDependencies( const cmMakefile& mf ) cmTarget::AnalyzeLibDependencies( const cmMakefile& mf )
{ {
@ -1027,7 +1033,7 @@ cmTarget::AnalyzeLibDependencies( const cmMakefile& mf )
this->LinkLibrariesAnalyzed = true; this->LinkLibrariesAnalyzed = true;
} }
//----------------------------------------------------------------------------
void cmTarget::InsertDependency( DependencyMap& depMap, void cmTarget::InsertDependency( DependencyMap& depMap,
const LibraryID& lib, const LibraryID& lib,
const LibraryID& dep) const LibraryID& dep)
@ -1035,6 +1041,7 @@ void cmTarget::InsertDependency( DependencyMap& depMap,
depMap[lib].push_back(dep); depMap[lib].push_back(dep);
} }
//----------------------------------------------------------------------------
void cmTarget::DeleteDependency( DependencyMap& depMap, void cmTarget::DeleteDependency( DependencyMap& depMap,
const LibraryID& lib, const LibraryID& lib,
const LibraryID& dep) const LibraryID& dep)
@ -1055,6 +1062,7 @@ void cmTarget::DeleteDependency( DependencyMap& depMap,
} }
} }
//----------------------------------------------------------------------------
void cmTarget::Emit(const LibraryID lib, void cmTarget::Emit(const LibraryID lib,
const DependencyMap& dep_map, const DependencyMap& dep_map,
std::set<LibraryID>& emitted, std::set<LibraryID>& emitted,
@ -1117,7 +1125,7 @@ void cmTarget::Emit(const LibraryID lib,
} }
} }
//----------------------------------------------------------------------------
void cmTarget::GatherDependencies( const cmMakefile& mf, void cmTarget::GatherDependencies( const cmMakefile& mf,
const LibraryID& lib, const LibraryID& lib,
DependencyMap& dep_map) DependencyMap& dep_map)
@ -1177,7 +1185,7 @@ void cmTarget::GatherDependencies( const cmMakefile& mf,
} }
} }
//----------------------------------------------------------------------------
void cmTarget::SetProperty(const char* prop, const char* value) void cmTarget::SetProperty(const char* prop, const char* value)
{ {
if (!prop) if (!prop)
@ -1192,11 +1200,13 @@ void cmTarget::SetProperty(const char* prop, const char* value)
this->Properties.SetProperty(prop, value, cmProperty::TARGET); this->Properties.SetProperty(prop, value, cmProperty::TARGET);
} }
//----------------------------------------------------------------------------
void cmTarget::MarkAsImported() void cmTarget::MarkAsImported()
{ {
this->IsImportedTarget = true; this->IsImportedTarget = true;
} }
//----------------------------------------------------------------------------
const char* cmTarget::GetDirectory(const char* config, bool implib) const char* cmTarget::GetDirectory(const char* config, bool implib)
{ {
if (this->IsImported()) if (this->IsImported())
@ -1209,6 +1219,7 @@ const char* cmTarget::GetDirectory(const char* config, bool implib)
} }
} }
//----------------------------------------------------------------------------
const char* cmTarget::ImportedGetDirectory(const char* config, bool) const char* cmTarget::ImportedGetDirectory(const char* config, bool)
{ {
const char* location=this->GetLocation(config); const char* location=this->GetLocation(config);
@ -1216,6 +1227,7 @@ const char* cmTarget::ImportedGetDirectory(const char* config, bool)
return directory.c_str(); return directory.c_str();
} }
//----------------------------------------------------------------------------
const char* cmTarget::NormalGetDirectory(const char* config, bool implib) const char* cmTarget::NormalGetDirectory(const char* config, bool implib)
{ {
if(config && *config) if(config && *config)
@ -1232,6 +1244,7 @@ const char* cmTarget::NormalGetDirectory(const char* config, bool implib)
} }
} }
//----------------------------------------------------------------------------
const char* cmTarget::GetLocation(const char* config) const char* cmTarget::GetLocation(const char* config)
{ {
if (this->IsImported()) if (this->IsImported())
@ -1244,6 +1257,7 @@ const char* cmTarget::GetLocation(const char* config)
} }
} }
//----------------------------------------------------------------------------
const char* cmTarget::ImportedGetLocation(const char* config) const char* cmTarget::ImportedGetLocation(const char* config)
{ {
if ((config) && (strlen(config))) if ((config) && (strlen(config)))
@ -1260,6 +1274,7 @@ const char* cmTarget::ImportedGetLocation(const char* config)
return this->GetProperty("LOCATION"); return this->GetProperty("LOCATION");
} }
//----------------------------------------------------------------------------
const char* cmTarget::NormalGetLocation(const char* config) const char* cmTarget::NormalGetLocation(const char* config)
{ {
this->Location = this->GetDirectory(); this->Location = this->GetDirectory();
@ -1300,11 +1315,13 @@ void cmTarget::GetTargetVersion(int& major, int& minor)
} }
} }
//----------------------------------------------------------------------------
const char *cmTarget::GetProperty(const char* prop) const char *cmTarget::GetProperty(const char* prop)
{ {
return this->GetProperty(prop, cmProperty::TARGET); return this->GetProperty(prop, cmProperty::TARGET);
} }
//----------------------------------------------------------------------------
void cmTarget::ComputeObjectFiles() void cmTarget::ComputeObjectFiles()
{ {
if (this->IsImported()) if (this->IsImported())
@ -1352,7 +1369,7 @@ void cmTarget::ComputeObjectFiles()
#endif #endif
} }
//----------------------------------------------------------------------------
const char *cmTarget::GetProperty(const char* prop, const char *cmTarget::GetProperty(const char* prop,
cmProperty::ScopeType scope) cmProperty::ScopeType scope)
{ {
@ -1369,15 +1386,16 @@ const char *cmTarget::GetProperty(const char* prop,
// properties or variables, always recompute them // properties or variables, always recompute them
if (!strcmp(prop,"LOCATION")) if (!strcmp(prop,"LOCATION"))
{ {
// Set the LOCATION property of the target. Note that this cannot take // Set the LOCATION property of the target. Note that this
// into account the per-configuration name of the target because the // cannot take into account the per-configuration name of the
// configuration type may not be known at CMake time. We should // target because the configuration type may not be known at
// deprecate this feature and instead support transforming an executable // CMake time. We should deprecate this feature and instead
// target name given as the command part of custom commands into the // support transforming an executable target name given as the
// proper path at build time. Alternatively we could put environment // command part of custom commands into the proper path at
// variable settings in all custom commands that hold the name of the // build time. Alternatively we could put environment
// target for each configuration and then give a reference to the // variable settings in all custom commands that hold the name
// variable in the location. // of the target for each configuration and then give a
// reference to the variable in the location.
this->SetProperty("LOCATION", this->GetLocation(0)); this->SetProperty("LOCATION", this->GetLocation(0));
} }
@ -1445,11 +1463,13 @@ const char *cmTarget::GetProperty(const char* prop,
return retVal; return retVal;
} }
//----------------------------------------------------------------------------
bool cmTarget::GetPropertyAsBool(const char* prop) bool cmTarget::GetPropertyAsBool(const char* prop)
{ {
return cmSystemTools::IsOn(this->GetProperty(prop)); return cmSystemTools::IsOn(this->GetProperty(prop));
} }
//----------------------------------------------------------------------------
const char* cmTarget::GetLinkerLanguage(cmGlobalGenerator* gg) const char* cmTarget::GetLinkerLanguage(cmGlobalGenerator* gg)
{ {
if(this->GetProperty("HAS_CXX")) if(this->GetProperty("HAS_CXX"))
@ -1512,6 +1532,7 @@ const char* cmTarget::GetLinkerLanguage(cmGlobalGenerator* gg)
return this->GetProperty("LINKER_LANGUAGE"); return this->GetProperty("LINKER_LANGUAGE");
} }
//----------------------------------------------------------------------------
const char* cmTarget::GetCreateRuleVariable() const char* cmTarget::GetCreateRuleVariable()
{ {
switch(this->GetType()) switch(this->GetType())
@ -1534,6 +1555,7 @@ const char* cmTarget::GetCreateRuleVariable()
return ""; return "";
} }
//----------------------------------------------------------------------------
const char* cmTarget::GetSuffixVariableInternal(TargetType type, const char* cmTarget::GetSuffixVariableInternal(TargetType type,
bool implib) bool implib)
{ {
@ -1564,6 +1586,7 @@ const char* cmTarget::GetSuffixVariableInternal(TargetType type,
} }
//----------------------------------------------------------------------------
const char* cmTarget::GetPrefixVariableInternal(TargetType type, const char* cmTarget::GetPrefixVariableInternal(TargetType type,
bool implib) bool implib)
{ {
@ -1640,6 +1663,7 @@ std::string cmTarget::GetFullNameInternal(TargetType type, const char* config,
return prefix+base+suffix; return prefix+base+suffix;
} }
//----------------------------------------------------------------------------
void cmTarget::GetFullNameInternal(TargetType type, void cmTarget::GetFullNameInternal(TargetType type,
const char* config, const char* config,
bool implib, bool implib,
@ -1659,6 +1683,7 @@ void cmTarget::GetFullNameInternal(TargetType type,
} }
} }
//----------------------------------------------------------------------------
void cmTarget::ImportedGetFullNameInternal(TargetType , void cmTarget::ImportedGetFullNameInternal(TargetType ,
const char* config, const char* config,
bool , bool ,
@ -1810,6 +1835,7 @@ void cmTarget::NormalGetFullNameInternal(TargetType type,
outSuffix = targetSuffix?targetSuffix:""; outSuffix = targetSuffix?targetSuffix:"";
} }
//----------------------------------------------------------------------------
void cmTarget::GetLibraryNames(std::string& name, void cmTarget::GetLibraryNames(std::string& name,
std::string& soName, std::string& soName,
std::string& realName, std::string& realName,
@ -1822,6 +1848,7 @@ void cmTarget::GetLibraryNames(std::string& name,
this->GetType(), config); this->GetType(), config);
} }
//----------------------------------------------------------------------------
void cmTarget::GetLibraryCleanNames(std::string& staticName, void cmTarget::GetLibraryCleanNames(std::string& staticName,
std::string& sharedName, std::string& sharedName,
std::string& sharedSOName, std::string& sharedSOName,
@ -1858,6 +1885,7 @@ void cmTarget::GetLibraryCleanNames(std::string& staticName,
} }
} }
//----------------------------------------------------------------------------
void cmTarget::GetLibraryNamesInternal(std::string& name, void cmTarget::GetLibraryNamesInternal(std::string& name,
std::string& soName, std::string& soName,
std::string& realName, std::string& realName,
@ -1955,6 +1983,7 @@ void cmTarget::GetLibraryNamesInternal(std::string& name,
pdbName = prefix+base+".pdb"; pdbName = prefix+base+".pdb";
} }
//----------------------------------------------------------------------------
void cmTarget::GetExecutableNames(std::string& name, void cmTarget::GetExecutableNames(std::string& name,
std::string& realName, std::string& realName,
std::string& impName, std::string& impName,
@ -1966,6 +1995,7 @@ void cmTarget::GetExecutableNames(std::string& name,
this->GetType(), config); this->GetType(), config);
} }
//----------------------------------------------------------------------------
void cmTarget::GetExecutableCleanNames(std::string& name, void cmTarget::GetExecutableCleanNames(std::string& name,
std::string& realName, std::string& realName,
std::string& impName, std::string& impName,
@ -1977,6 +2007,7 @@ void cmTarget::GetExecutableCleanNames(std::string& name,
cmTarget::EXECUTABLE, config); cmTarget::EXECUTABLE, config);
} }
//----------------------------------------------------------------------------
void cmTarget::GetExecutableNamesInternal(std::string& name, void cmTarget::GetExecutableNamesInternal(std::string& name,
std::string& realName, std::string& realName,
std::string& impName, std::string& impName,

View File

@ -346,11 +346,15 @@ private:
const char* ImportedGetLocation(const char* config); const char* ImportedGetLocation(const char* config);
const char* NormalGetLocation(const char* config); const char* NormalGetLocation(const char* config);
void NormalGetFullNameInternal(TargetType type, const char* config, bool implib, void NormalGetFullNameInternal(TargetType type, const char* config,
std::string& outPrefix, std::string& outBase, bool implib,
std::string& outPrefix,
std::string& outBase,
std::string& outSuffix); std::string& outSuffix);
void ImportedGetFullNameInternal(TargetType type, const char* config, bool implib, void ImportedGetFullNameInternal(TargetType type, const char* config,
std::string& outPrefix, std::string& outBase, bool implib,
std::string& outPrefix,
std::string& outBase,
std::string& outSuffix); std::string& outSuffix);
const char* ImportedGetDirectory(const char* config, bool implib); const char* ImportedGetDirectory(const char* config, bool implib);