diff options
author | Ken Martin <ken.martin@kitware.com> | 2003-06-19 18:27:01 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2003-06-19 18:27:01 (GMT) |
commit | 590460aaaeec05751bf21c2f79250fcdffd2cfad (patch) | |
tree | b77e22e99cdae6728d0195eb483d785e9d2af28b /Source | |
parent | 218efecd890bf41d968f2b56ef01ea6acd9664b7 (diff) | |
download | CMake-590460aaaeec05751bf21c2f79250fcdffd2cfad.zip CMake-590460aaaeec05751bf21c2f79250fcdffd2cfad.tar.gz CMake-590460aaaeec05751bf21c2f79250fcdffd2cfad.tar.bz2 |
new function
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmSystemTools.cxx | 22 | ||||
-rw-r--r-- | Source/cmSystemTools.h | 5 |
2 files changed, 27 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 0ef39fd..b729333 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1703,6 +1703,28 @@ bool cmSystemTools::FileIsDirectory(const char* name) } } +bool cmSystemTools::DoesFileExistWithExtensions( + const char* name, + const std::vector<std::string>& headerExts) +{ + std::string hname; + + for( std::vector<std::string>::const_iterator ext = headerExts.begin(); + ext != headerExts.end(); ++ext ) + { + hname = name; + hname += "."; + hname += *ext; + if(cmSystemTools::FileExists(hname.c_str())) + { + return true; + } + } + return false; +} + + + int cmSystemTools::ChangeDirectory(const char *dir) { return Chdir(dir); diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 8317e64..51d9c41 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -244,6 +244,11 @@ public: ///! return true if the file is a directory. static bool FileIsDirectory(const char* name); + + static bool DoesFileExistWithExtensions( + const char *name, + const std::vector<std::string>& sourceExts); + static void Glob(const char *directory, const char *regexp, std::vector<std::string>& files); static void GlobDirs(const char *fullPath, std::vector<std::string>& files); |