diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-02-16 16:34:23 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-02-16 16:34:23 (GMT) |
commit | 43859e36cfa3dede4f935ada5ad08ee6e7eb1d76 (patch) | |
tree | 622fb609e84cbefa6e34bd2a60bc084ab15b5ab7 /Source/cmFindIncludeCommand.cxx | |
parent | fce56c57c497ede3a7afcbc7965846cc8bad9db2 (diff) | |
download | CMake-43859e36cfa3dede4f935ada5ad08ee6e7eb1d76.zip CMake-43859e36cfa3dede4f935ada5ad08ee6e7eb1d76.tar.gz CMake-43859e36cfa3dede4f935ada5ad08ee6e7eb1d76.tar.bz2 |
ENH: add new commands fro find library and find program
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; + } } } |