summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-12-13 21:16:48 (GMT)
committerBrad King <brad.king@kitware.com>2002-12-13 21:16:48 (GMT)
commit3348131819bb30a592898631df11aaf8ad8db4d2 (patch)
treebc84549b8fd511222dfe58aae3d4613b17a85a4d /Source/cmLocalUnixMakefileGenerator.cxx
parent7e824e83a9c97234f23640188c590201eeffea5d (diff)
downloadCMake-3348131819bb30a592898631df11aaf8ad8db4d2.zip
CMake-3348131819bb30a592898631df11aaf8ad8db4d2.tar.gz
CMake-3348131819bb30a592898631df11aaf8ad8db4d2.tar.bz2
ENH: Added source file property OBJECT_DEPENDS to support generated header files included in non-generated sources.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator.cxx40
1 files changed, 36 insertions, 4 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx
index 5092045..cd7d67e 100644
--- a/Source/cmLocalUnixMakefileGenerator.cxx
+++ b/Source/cmLocalUnixMakefileGenerator.cxx
@@ -2351,6 +2351,23 @@ OutputBuildObjectFromSource(std::ostream& fout,
objectFile.c_str(),
flags.c_str());
}
+
+ std::vector<std::string> sourceAndDeps;
+ sourceAndDeps.push_back(sourceFile);
+
+ // Check for extra object-file dependencies.
+ const char* additionalDeps = source.GetProperty("OBJECT_DEPENDS");
+ if(additionalDeps)
+ {
+ std::vector<std::string> depends;
+ cmSystemTools::ExpandListArgument(additionalDeps, depends);
+ for(std::vector<std::string>::iterator i = depends.begin();
+ i != depends.end(); ++i)
+ {
+ sourceAndDeps.push_back(cmSystemTools::ConvertToOutputPath(i->c_str()));
+ }
+ }
+
this->OutputMakeRule(fout,
comment.c_str(),
objectFile.c_str(),
@@ -2478,6 +2495,20 @@ void cmLocalUnixMakefileGenerator::OutputMakeRule(std::ostream& fout,
const char* depends,
const std::vector<std::string>& commands)
{
+ std::vector<std::string> depend;
+ if(depends)
+ {
+ depend.push_back(depends);
+ }
+ this->OutputMakeRule(fout, comment, target, depend, commands);
+}
+
+void cmLocalUnixMakefileGenerator::OutputMakeRule(std::ostream& fout,
+ const char* comment,
+ const char* target,
+ const std::vector<std::string>& depends,
+ const std::vector<std::string>& commands)
+{
if(!target)
{
cmSystemTools::Error("no target for OutputMakeRule");
@@ -2497,13 +2528,14 @@ void cmLocalUnixMakefileGenerator::OutputMakeRule(std::ostream& fout,
replace = target;
m_Makefile->ExpandVariablesInString(replace);
- fout << cmSystemTools::ConvertToOutputPath(replace.c_str()) << ": ";
+ fout << cmSystemTools::ConvertToOutputPath(replace.c_str()) << ":";
- if(depends)
+ for(std::vector<std::string>::const_iterator dep = depends.begin();
+ dep != depends.end(); ++dep)
{
- replace = depends;
+ replace = *dep;
m_Makefile->ExpandVariablesInString(replace);
- fout << replace.c_str();
+ fout << " " << replace.c_str();
}
fout << "\n";
int count = 0;