diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-06-21 16:01:18 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-06-21 16:01:18 (GMT) |
commit | 0ff3bdba204fec0671e601be5ff8b7af3ba821c8 (patch) | |
tree | f60e6e69d4d6a809340b5f7441ed29a4b4750495 /Source/cmSystemTools.cxx | |
parent | 8deccd3c2ea9d0eb5a63b2019a3dec984e7e0ae5 (diff) | |
download | CMake-0ff3bdba204fec0671e601be5ff8b7af3ba821c8.zip CMake-0ff3bdba204fec0671e601be5ff8b7af3ba821c8.tar.gz CMake-0ff3bdba204fec0671e601be5ff8b7af3ba821c8.tar.bz2 |
better install support
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index bbbd3a3..5d3864c 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <sys/stat.h> #include "cmRegularExpression.h" #include <ctype.h> +#include "cmDirectory.h" #if defined(_MSC_VER) || defined(__BORLANDC__) #include <windows.h> @@ -1064,3 +1065,25 @@ std::string cmSystemTools::GetFilenameNameWithoutExtension(const std::string& fi } } + +void cmSystemTools::Glob(const char *directory, const char *regexp, + std::vector<std::string>& files) +{ + cmDirectory d; + cmRegularExpression reg(regexp); + + if (d.Load(directory)) + { + int i, numf; + numf = d.GetNumberOfFiles(); + for (i = 0; i < numf; i++) + { + std::string fname = d.GetFile(i); + if (reg.find(fname)) + { + files.push_back(fname); + } + } + } +} + |