diff options
author | Ken Martin <ken.martin@kitware.com> | 2003-06-04 23:04:35 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2003-06-04 23:04:35 (GMT) |
commit | b53b467414aadea1500518398eee51efce1104cb (patch) | |
tree | 8d4c1ebe634a0256288aae64feeafe3d5bea0723 | |
parent | 050190d455edf1bebaa639d797be29eee06f4da7 (diff) | |
download | CMake-b53b467414aadea1500518398eee51efce1104cb.zip CMake-b53b467414aadea1500518398eee51efce1104cb.tar.gz CMake-b53b467414aadea1500518398eee51efce1104cb.tar.bz2 |
hopeful fix for backwards compat
-rw-r--r-- | Source/cmMakefile.cxx | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 2197112..a9db9a6 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -458,13 +458,27 @@ void cmMakefile::AddCustomCommand(const char* source, for(std::vector<std::string>::const_iterator d = outputs.begin(); d != outputs.end(); ++d) { - std::vector<std::string> depends2 = depends; - depends2.push_back(source); - this->AddCustomCommandToOutput(d->c_str(), command, commandArgs, - 0, depends2, comment); + // if this looks like a real file then use is as the main depend + cmRegularExpression SourceFiles("\\.(C|M|c|c\\+\\+|cc|cpp|cxx|m|mm|rc|def|r|odl|idl|hpj|bat|h|h\\+\\+|hm|hpp|hxx|in|txx|inl)$"); + if (SourceFiles.find(source)) + { + this->AddCustomCommandToOutput(d->c_str(), command, commandArgs, + source, depends, comment); + } + // otherwise do not use a main depend + else + { + std::vector<std::string> depends2 = depends; + depends2.push_back(source); + this->AddCustomCommandToOutput(d->c_str(), command, commandArgs, + 0, depends2, comment); + } + // add the output to the target? std::string sname = *d; sname += ".rule"; + // if the rule was added to the source, + // then add the source to the target if (!this->GetSource(sname.c_str())) { if (m_Targets.find(target) != m_Targets.end()) |