cmGeneratorTarget: Move GetFrameworkVersion from cmTarget
This commit is contained in:
parent
3f8aa62bfb
commit
cf69630e51
@ -1641,7 +1641,7 @@ cmGeneratorTarget::GetFrameworkDirectory(const std::string& config,
|
|||||||
if(!rootDir && !this->Makefile->PlatformIsAppleIos())
|
if(!rootDir && !this->Makefile->PlatformIsAppleIos())
|
||||||
{
|
{
|
||||||
fpath += "/Versions/";
|
fpath += "/Versions/";
|
||||||
fpath += this->Target->GetFrameworkVersion();
|
fpath += this->GetFrameworkVersion();
|
||||||
}
|
}
|
||||||
return fpath;
|
return fpath;
|
||||||
}
|
}
|
||||||
@ -3331,7 +3331,7 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name,
|
|||||||
if(!this->Makefile->PlatformIsAppleIos())
|
if(!this->Makefile->PlatformIsAppleIos())
|
||||||
{
|
{
|
||||||
realName += "Versions/";
|
realName += "Versions/";
|
||||||
realName += this->Target->GetFrameworkVersion();
|
realName += this->GetFrameworkVersion();
|
||||||
realName += "/";
|
realName += "/";
|
||||||
}
|
}
|
||||||
realName += base;
|
realName += base;
|
||||||
@ -4525,6 +4525,25 @@ void cmGeneratorTarget::GetTargetVersion(bool soversion,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
std::string cmGeneratorTarget::GetFrameworkVersion() const
|
||||||
|
{
|
||||||
|
assert(this->GetType() != cmState::INTERFACE_LIBRARY);
|
||||||
|
|
||||||
|
if(const char* fversion = this->GetProperty("FRAMEWORK_VERSION"))
|
||||||
|
{
|
||||||
|
return fversion;
|
||||||
|
}
|
||||||
|
else if(const char* tversion = this->GetProperty("VERSION"))
|
||||||
|
{
|
||||||
|
return tversion;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "A";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmGeneratorTarget::ComputeVersionedName(std::string& vName,
|
void cmGeneratorTarget::ComputeVersionedName(std::string& vName,
|
||||||
std::string const& prefix,
|
std::string const& prefix,
|
||||||
|
@ -165,6 +165,10 @@ public:
|
|||||||
std::string GetFrameworkDirectory(const std::string& config,
|
std::string GetFrameworkDirectory(const std::string& config,
|
||||||
bool rootDir) const;
|
bool rootDir) const;
|
||||||
|
|
||||||
|
/** Return the framework version string. Undefined if
|
||||||
|
IsFrameworkOnApple returns false. */
|
||||||
|
std::string GetFrameworkVersion() const;
|
||||||
|
|
||||||
/** @return the Mac CFBundle directory without the base */
|
/** @return the Mac CFBundle directory without the base */
|
||||||
std::string GetCFBundleDirectory(const std::string& config,
|
std::string GetCFBundleDirectory(const std::string& config,
|
||||||
bool contentOnly) const;
|
bool contentOnly) const;
|
||||||
|
@ -2141,7 +2141,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
|
|||||||
{
|
{
|
||||||
if(gtgt->GetPropertyAsBool("FRAMEWORK"))
|
if(gtgt->GetPropertyAsBool("FRAMEWORK"))
|
||||||
{
|
{
|
||||||
std::string fw_version = gtgt->Target->GetFrameworkVersion();
|
std::string fw_version = gtgt->GetFrameworkVersion();
|
||||||
buildSettings->AddAttribute("FRAMEWORK_VERSION",
|
buildSettings->AddAttribute("FRAMEWORK_VERSION",
|
||||||
this->CreateString(fw_version.c_str()));
|
this->CreateString(fw_version.c_str()));
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ void cmOSXBundleGenerator::CreateFramework(
|
|||||||
std::string newoutpath = outpath + "/" +
|
std::string newoutpath = outpath + "/" +
|
||||||
this->GT->GetFrameworkDirectory(this->ConfigName, false);
|
this->GT->GetFrameworkDirectory(this->ConfigName, false);
|
||||||
|
|
||||||
std::string frameworkVersion = this->GT->Target->GetFrameworkVersion();
|
std::string frameworkVersion = this->GT->GetFrameworkVersion();
|
||||||
|
|
||||||
// Configure the Info.plist file into the Resources directory.
|
// Configure the Info.plist file into the Resources directory.
|
||||||
this->MacContentFolders->insert("Resources");
|
this->MacContentFolders->insert("Resources");
|
||||||
|
@ -2048,25 +2048,6 @@ void cmTarget::SetPropertyDefault(const std::string& property,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
std::string cmTarget::GetFrameworkVersion() const
|
|
||||||
{
|
|
||||||
assert(this->GetType() != cmState::INTERFACE_LIBRARY);
|
|
||||||
|
|
||||||
if(const char* fversion = this->GetProperty("FRAMEWORK_VERSION"))
|
|
||||||
{
|
|
||||||
return fversion;
|
|
||||||
}
|
|
||||||
else if(const char* tversion = this->GetProperty("VERSION"))
|
|
||||||
{
|
|
||||||
return tversion;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return "A";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool cmTarget::GetMappedConfig(std::string const& desired_config,
|
bool cmTarget::GetMappedConfig(std::string const& desired_config,
|
||||||
const char** loc,
|
const char** loc,
|
||||||
const char** imp,
|
const char** imp,
|
||||||
|
@ -209,10 +209,6 @@ public:
|
|||||||
/** Return whether this target is an executable Bundle on Apple. */
|
/** Return whether this target is an executable Bundle on Apple. */
|
||||||
bool IsAppBundleOnApple() const;
|
bool IsAppBundleOnApple() const;
|
||||||
|
|
||||||
/** Return the framework version string. Undefined if
|
|
||||||
IsFrameworkOnApple returns false. */
|
|
||||||
std::string GetFrameworkVersion() const;
|
|
||||||
|
|
||||||
/** Get a backtrace from the creation of the target. */
|
/** Get a backtrace from the creation of the target. */
|
||||||
cmListFileBacktrace const& GetBacktrace() const;
|
cmListFileBacktrace const& GetBacktrace() const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user