summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-04-17 18:01:22 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-04-17 18:01:22 (GMT)
commit5ecfd3d4d332e616605a75a273921b01437cb08f (patch)
tree9deb4e3debb729a631251a2935fc77fc3f9e4f59 /Source/cmLocalGenerator.cxx
parent0f8603acc2f007e68a1c41a48919fd1acfc41c20 (diff)
downloadCMake-5ecfd3d4d332e616605a75a273921b01437cb08f.zip
CMake-5ecfd3d4d332e616605a75a273921b01437cb08f.tar.gz
CMake-5ecfd3d4d332e616605a75a273921b01437cb08f.tar.bz2
ENH: fix java and add OBJECT_DIR support
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 36fed56..36a5ecc 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -457,6 +457,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
cmSourceFile& source,
cmTarget& )
{
+ std::string objectDir = cmSystemTools::GetFilenamePath(std::string(ofname));
std::string objectFile = this->Convert(ofname,START_OUTPUT,SHELL);
std::string sourceFile =
this->Convert(source.GetFullPath().c_str(),START_OUTPUT,SHELL,true);
@@ -481,6 +482,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
vars.Language = lang;
vars.Source = sourceFile.c_str();
vars.Object = objectFile.c_str();
+ vars.ObjectDir = objectDir.c_str();
vars.Flags = flags.c_str();
for(std::vector<std::string>::iterator i = commands.begin();
i != commands.end(); ++i)
@@ -568,6 +570,10 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
cmLocalGenerator::RuleVariables vars;
vars.Language = llang;
vars.Objects = objs.c_str();
+ std::string objdir = "CMakeFiles/";
+ objdir += targetName;
+ objdir += ".dir";
+ vars.ObjectDir = objdir.c_str();
vars.Target = targetName.c_str();
vars.LinkLibraries = linkLibs.c_str();
vars.Flags = flags.c_str();
@@ -583,7 +589,6 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
{
// Expand the full command line string.
this->ExpandRuleVariables(*i, vars);
-
// Parse the string to get the custom command line.
cmCustomCommandLine commandLine;
std::vector<cmStdString> cmd = cmSystemTools::ParseArguments(i->c_str());
@@ -710,6 +715,13 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
return replaceValues.Object;
}
}
+ if(replaceValues.ObjectDir)
+ {
+ if(variable == "OBJECT_DIR")
+ {
+ return replaceValues.ObjectDir;
+ }
+ }
if(replaceValues.Objects)
{
if(variable == "OBJECTS")