diff options
author | Brad King <brad.king@kitware.com> | 2012-03-08 21:32:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-03-12 20:44:03 (GMT) |
commit | f737bd416a49d79db032f97c3046e7eccc6aaea9 (patch) | |
tree | 777cc9c2957cbad01846f63686954bf8ce23a74f | |
parent | 9c0a00d6dd6e7419eba61bcac30bdd0715b8b2cd (diff) | |
download | CMake-f737bd416a49d79db032f97c3046e7eccc6aaea9.zip CMake-f737bd416a49d79db032f97c3046e7eccc6aaea9.tar.gz CMake-f737bd416a49d79db032f97c3046e7eccc6aaea9.tar.bz2 |
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.
-rw-r--r-- | Source/cmGeneratorTarget.h | 5 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 16 |
3 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 2bfc037..b083ba1 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -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(); diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 059692e..9d8a02c 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -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 diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index e5a9784..4b9e487 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -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; } //---------------------------------------------------------------------------- |