summaryrefslogtreecommitdiffstats
path: root/Source/kwsys
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-12-15 01:31:27 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-12-15 01:31:27 (GMT)
commita5e76555bf9ac5fac6876ba73f8c3a7cdcabc351 (patch)
tree57b6daf9dd561b16c7d63345993b3370808ef7d5 /Source/kwsys
parent0304073ea6cafadd612fe9bbcc06dcaa6131f1e4 (diff)
downloadCMake-a5e76555bf9ac5fac6876ba73f8c3a7cdcabc351.zip
CMake-a5e76555bf9ac5fac6876ba73f8c3a7cdcabc351.tar.gz
CMake-a5e76555bf9ac5fac6876ba73f8c3a7cdcabc351.tar.bz2
BUG: fix for bug 6136 make sure includes are not directories
Diffstat (limited to 'Source/kwsys')
-rw-r--r--Source/kwsys/SystemTools.cxx8
-rw-r--r--Source/kwsys/SystemTools.hxx.in7
2 files changed, 12 insertions, 3 deletions
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 1248f29..977133f 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -821,7 +821,7 @@ bool SystemTools::SameFile(const char* file1, const char* file2)
// return true if the file exists
-bool SystemTools::FileExists(const char* filename)
+bool SystemTools::FileExists(const char* filename, bool isFile)
{
#ifdef _MSC_VER
# define access _access
@@ -843,6 +843,12 @@ bool SystemTools::FileExists(const char* filename)
}
else
{
+ // If isFile is set return not FileIsDirectory,
+ // so this will only be true if it is a file
+ if(isFile)
+ {
+ return !SystemTools::FileIsDirectory(filename);
+ }
return true;
}
}
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index 568643b..4845851 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -270,9 +270,12 @@ public:
static kwsys_stl::string ConvertToWindowsOutputPath(const char*);
/**
- * Return true if a file exists in the current directory
+ * Return true if a file exists in the current directory.
+ * If isFile = true, then make sure the file is a file and
+ * not a directory. If isFile = false, then return true
+ * if it is a file or a directory.
*/
- static bool FileExists(const char* filename);
+ static bool FileExists(const char* filename, bool isFile=false);
/**
* Return file length