summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-04-22 17:24:20 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-04-22 17:24:20 (GMT)
commitd59e06595c986b53cbb7d537e951ea8af07fe11a (patch)
tree91d4874deab87fac9dcd76f8627c9c5531611427 /Source/kwsys
parent5ff05c35d1099780fa60849e26c95c25499b9722 (diff)
downloadCMake-d59e06595c986b53cbb7d537e951ea8af07fe11a.zip
CMake-d59e06595c986b53cbb7d537e951ea8af07fe11a.tar.gz
CMake-d59e06595c986b53cbb7d537e951ea8af07fe11a.tar.bz2
BUG: fix for 301 CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH env vars now used in FIND_LIBRARY and FIND_PATH in addtion to and before PATH
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/SystemTools.cxx8
-rw-r--r--Source/kwsys/SystemTools.hxx.in5
2 files changed, 9 insertions, 4 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 8b26cb3..b7ad66b 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -158,14 +158,18 @@ SystemTools::GetTime(void)
}
// adds the elements of the env variable path to the arg passed in
-void SystemTools::GetPath(kwsys_stl::vector<kwsys_stl::string>& path)
+void SystemTools::GetPath(kwsys_stl::vector<kwsys_stl::string>& path, const char* env)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
const char* pathSep = ";";
#else
const char* pathSep = ":";
#endif
- kwsys_stl::string pathEnv = getenv("PATH");
+ if(!env)
+ {
+ env = "PATH";
+ }
+ kwsys_stl::string pathEnv = getenv(env);
// A hack to make the below algorithm work.
if(pathEnv[pathEnv.length()-1] != ':')
{
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index fc6acf0..1676ff2 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -121,9 +121,10 @@ public:
static unsigned long FileLength(const char *filename);
/**
* Add the paths from the environment variable PATH to the
- * string vector passed in.
+ * string vector passed in. If env is set then the value
+ * of env will be used instead of PATH.
*/
- static void GetPath(kwsys_stl::vector<kwsys_stl::string>& path);
+ static void GetPath(kwsys_stl::vector<kwsys_stl::string>& path, const char* env=0);
/** Read an environment variable. */
static const char* GetEnv(const char* key);