summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-06-01 16:19:44 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-06-01 16:19:44 (GMT)
commit2936c54cdd4acfd402a0237b29b96d718c64ffbf (patch)
treeab96c7a4c9e4c97469116e1d0f7470cde482b406 /Source
parent8d1a5c48e702ed24d343210639268777ba9fe8a3 (diff)
downloadCMake-2936c54cdd4acfd402a0237b29b96d718c64ffbf.zip
CMake-2936c54cdd4acfd402a0237b29b96d718c64ffbf.tar.gz
CMake-2936c54cdd4acfd402a0237b29b96d718c64ffbf.tar.bz2
ENH: make sure find library does not find directories
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/SystemTools.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 9d92965..d0601ff 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1219,7 +1219,8 @@ kwsys_stl::string SystemTools::FindLibrary(const char* name,
tryPath += "/";
tryPath += name;
tryPath += ".lib";
- if(SystemTools::FileExists(tryPath.c_str()))
+ if(SystemTools::FileExists(tryPath.c_str())
+ && !SystemTools::FileIsDirectory(tryPath.c_str()))
{
return SystemTools::CollapseFullPath(tryPath.c_str());
}
@@ -1228,7 +1229,8 @@ kwsys_stl::string SystemTools::FindLibrary(const char* name,
tryPath += "/lib";
tryPath += name;
tryPath += ".so";
- if(SystemTools::FileExists(tryPath.c_str()))
+ if(SystemTools::FileExists(tryPath.c_str())
+ && !SystemTools::FileIsDirectory(tryPath.c_str()))
{
return SystemTools::CollapseFullPath(tryPath.c_str());
}
@@ -1236,7 +1238,8 @@ kwsys_stl::string SystemTools::FindLibrary(const char* name,
tryPath += "/lib";
tryPath += name;
tryPath += ".a";
- if(SystemTools::FileExists(tryPath.c_str()))
+ if(SystemTools::FileExists(tryPath.c_str())
+ && !SystemTools::FileIsDirectory(tryPath.c_str()))
{
return SystemTools::CollapseFullPath(tryPath.c_str());
}
@@ -1244,7 +1247,8 @@ kwsys_stl::string SystemTools::FindLibrary(const char* name,
tryPath += "/lib";
tryPath += name;
tryPath += ".sl";
- if(SystemTools::FileExists(tryPath.c_str()))
+ if(SystemTools::FileExists(tryPath.c_str())
+ && !SystemTools::FileIsDirectory(tryPath.c_str()))
{
return SystemTools::CollapseFullPath(tryPath.c_str());
}
@@ -1252,7 +1256,8 @@ kwsys_stl::string SystemTools::FindLibrary(const char* name,
tryPath += "/lib";
tryPath += name;
tryPath += ".dylib";
- if(SystemTools::FileExists(tryPath.c_str()))
+ if(SystemTools::FileExists(tryPath.c_str())
+ && !SystemTools::FileIsDirectory(tryPath.c_str()))
{
return SystemTools::CollapseFullPath(tryPath.c_str());
}
@@ -1260,7 +1265,8 @@ kwsys_stl::string SystemTools::FindLibrary(const char* name,
tryPath += "/lib";
tryPath += name;
tryPath += ".dll";
- if(SystemTools::FileExists(tryPath.c_str()))
+ if(SystemTools::FileExists(tryPath.c_str())
+ && !SystemTools::FileIsDirectory(tryPath.c_str()))
{
return SystemTools::CollapseFullPath(tryPath.c_str());
}