mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 19:00:54 -06:00
cmGeneratorTarget: Add method to get the object file directory
Add a `GetObjectDirectory` method to get the target's object file directory for a specific configuration.
This commit is contained in:
@@ -3254,6 +3254,19 @@ std::string cmGeneratorTarget::GetPDBName(const std::string& config) const
|
||||
return prefix + base + ".pdb";
|
||||
}
|
||||
|
||||
std::string cmGeneratorTarget::GetObjectDirectory(
|
||||
std::string const& config) const
|
||||
{
|
||||
std::string obj_dir =
|
||||
this->GlobalGenerator->ExpandCFGIntDir(this->ObjectDirectory, config);
|
||||
#if defined(__APPLE__)
|
||||
// find and replace $(PROJECT_NAME) xcode placeholder
|
||||
const std::string projectName = this->LocalGenerator->GetProjectName();
|
||||
cmSystemTools::ReplaceString(obj_dir, "$(PROJECT_NAME)", projectName);
|
||||
#endif
|
||||
return obj_dir;
|
||||
}
|
||||
|
||||
void cmGeneratorTarget::GetTargetObjectNames(
|
||||
std::string const& config, std::vector<std::string>& objects) const
|
||||
{
|
||||
|
||||
@@ -369,6 +369,10 @@ public:
|
||||
time config name placeholder if needed for the generator. */
|
||||
std::string ObjectDirectory;
|
||||
|
||||
/** Full path with trailing slash to the top-level directory
|
||||
holding object files for the given configuration. */
|
||||
std::string GetObjectDirectory(std::string const& config) const;
|
||||
|
||||
void GetAppleArchs(const std::string& config,
|
||||
std::vector<std::string>& archVec) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user