diff options
Diffstat (limited to 'Source/cmFindIncludeCommand.cxx')
-rw-r--r-- | Source/cmFindIncludeCommand.cxx | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/Source/cmFindIncludeCommand.cxx b/Source/cmFindIncludeCommand.cxx index 2b4160d..706a617 100644 --- a/Source/cmFindIncludeCommand.cxx +++ b/Source/cmFindIncludeCommand.cxx @@ -18,16 +18,35 @@ // cmFindIncludeCommand bool cmFindIncludeCommand::Invoke(std::vector<std::string>& args) { - return false; - if(args.size() < 1 ) + if(args.size() < 2 ) { this->SetError("called with incorrect number of arguments"); return false; } - for(std::vector<std::string>::iterator i = args.begin(); - i != args.end(); ++i) + + std::vector<std::string> path; + // add any user specified paths + for (int j = 2; j < args.size(); j++) { - m_Makefile->AddDefineFlag((*i).c_str()); + // expand variables + std::string exp = args[j]; + m_Makefile->ExpandVariablesInString(exp); + path.push_back(exp); + } + + // add the standard path + cmSystemTools::GetPath(path); + + for(int k=0; k < path.size(); k++) + { + std::string tryPath = path[k]; + tryPath += "/"; + tryPath += args[1]; + if(cmSystemTools::FileExists(tryPath.c_str())) + { + m_Makefile->AddDefinition(args[0].c_str(), path[k].c_str()); + return true; + } } } |