Pre-compute and store target object directory in cmGeneratorTarget

Add cmGeneratorTarget::ObjectDirectory member to hold the value.  In
ComputeTargetObjects set the value to the full path to the target object
directory including any necessary placeholder for the configuration
name.
This commit is contained in:
Brad King 2012-03-08 16:32:03 -05:00
parent 9c0a00d6dd
commit f737bd416a
3 changed files with 22 additions and 0 deletions

View File

@ -43,6 +43,11 @@ public:
std::map<cmSourceFile const*, std::string> Objects;
std::set<cmSourceFile const*> ExplicitObjectName;
/** Full path with trailing slash to the top-level directory
holding object files for this target. Includes the build
time config name placeholder if needed for the generator. */
std::string ObjectDirectory;
private:
void ClassifySources();

View File

@ -86,6 +86,7 @@ cmGlobalUnixMakefileGenerator3
dir_max += "/";
dir_max += gt->LocalGenerator->GetTargetDirectory(*target);
dir_max += "/";
gt->ObjectDirectory = dir_max;
// Compute the name of each object file.
for(std::vector<cmSourceFile*>::iterator

View File

@ -139,6 +139,22 @@ cmGlobalVisualStudioGenerator
}
gt->Objects[sf] = objectName;
}
std::string dir = gt->Makefile->GetCurrentOutputDirectory();
dir += "/";
std::string tgtDir = lg->GetTargetDirectory(*gt->Target);
if(!tgtDir.empty())
{
dir += tgtDir;
dir += "/";
}
const char* cd = this->GetCMakeCFGIntDir();
if(cd && *cd)
{
dir += cd;
dir += "/";
}
gt->ObjectDirectory = dir;
}
//----------------------------------------------------------------------------