summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-03-21 18:31:57 (GMT)
committerBrad King <brad.king@kitware.com>2013-03-22 11:52:54 (GMT)
commit0b7ad3f091decb9fe8f2cd7001de7ecc05913342 (patch)
treeff30525503b9ae348c5c0d4f976d2eb6358713e9 /Source
parent2557e84d672cc50e30c8934e06de10c6080dc092 (diff)
downloadCMake-0b7ad3f091decb9fe8f2cd7001de7ecc05913342.zip
CMake-0b7ad3f091decb9fe8f2cd7001de7ecc05913342.tar.gz
CMake-0b7ad3f091decb9fe8f2cd7001de7ecc05913342.tar.bz2
Replace <TARGET> in CMAKE_<LANG>_COMPILE_OBJECT rule variables
In some languages the compiler may need to know the path of the final target file for which an object is being compiled. Honor the <TARGET> placeholder for compilation rules to support such cases. Note that this cannot work with OBJECT library targets because the final target path is not known during compilation (there can even be more than one final target). Suggested-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index d9aa7fe..922adc6 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -640,18 +640,25 @@ cmMakefileTargetGenerator
(commands, buildEcho.c_str(), cmLocalUnixMakefileGenerator3::EchoBuild);
}
+ std::string targetOutPathReal;
std::string targetOutPathPDB;
{
+ std::string targetFullPathReal;
std::string targetFullPathPDB;
if(this->Target->GetType() == cmTarget::EXECUTABLE ||
this->Target->GetType() == cmTarget::STATIC_LIBRARY ||
this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
this->Target->GetType() == cmTarget::MODULE_LIBRARY)
{
+ targetFullPathReal =
+ this->Target->GetFullPath(this->ConfigName, false, true);
targetFullPathPDB = this->Target->GetPDBDirectory(this->ConfigName);
targetFullPathPDB += "/";
targetFullPathPDB += this->Target->GetPDBName(this->ConfigName);
}
+ targetOutPathReal = this->Convert(targetFullPathReal.c_str(),
+ cmLocalGenerator::START_OUTPUT,
+ cmLocalGenerator::SHELL);
targetOutPathPDB =
this->Convert(targetFullPathPDB.c_str(),cmLocalGenerator::NONE,
cmLocalGenerator::SHELL);
@@ -660,6 +667,7 @@ cmMakefileTargetGenerator
vars.RuleLauncher = "RULE_LAUNCH_COMPILE";
vars.CMTarget = this->Target;
vars.Language = lang;
+ vars.Target = targetOutPathReal.c_str();
vars.TargetPDB = targetOutPathPDB.c_str();
vars.Source = sourceFile.c_str();
std::string shellObj =