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/cmFindProgramCommand.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/cmFindProgramCommand.cxx')
-rw-r--r-- | Source/cmFindProgramCommand.cxx | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 1c0d6e1..c3d3275 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -16,32 +16,6 @@ #include "cmFindProgramCommand.h" #include <stdlib.h> #include <stdio.h> - -static void GetPath(std::vector<std::string>& path) -{ -#if defined(_WIN32) && !defined(__CYGWIN__) - char* pathSep = ";"; -#else - char* pathSep = ":"; -#endif - std::string pathEnv = getenv("PATH"); - std::string::size_type start =0; - bool done = false; - while(!done) - { - std::string::size_type endpos = pathEnv.find(pathSep, start); - if(endpos != std::string::npos) - { - path.push_back(pathEnv.substr(start, endpos-start)); - start = endpos+1; - } - else - { - done = true; - } - } -} - // cmFindProgramCommand @@ -54,7 +28,8 @@ bool cmFindProgramCommand::Invoke(std::vector<std::string>& args) } std::vector<std::string> path; - GetPath(path); + cmSystemTools::GetPath(path); + std::vector<std::string>::iterator i = args.begin(); const char* define = (*i).c_str(); i++; |