Hi,
I have a situation where an application adds timestamp information to output file names and I’m trying to strip that out so I can automate regression testing.
File names are of the format EXzzhhmm.nnn
where zz
is a two letter code (‘CR’, ‘MB’, ‘PR’), hhmm
are zero padded 24-hour hour and minute, and nnn
is a zero padded serial number 000 to 999.
I can match these files with file(GLOB outfiles LIST_DIRECTORIES FALSE EX[CMP][RB][0-2][0-9][0-9][0-9].[0-9][0-9][0-9])
. This works fine on Linux.
Unfortunately it craps out on Windows. Because of course it does.
I can’t find a clear definition of what CMake considers to be a legal glob expression in the official documentation. Professional CMake shows bar[0-9].txt
as a glob pattern example, and like I said, the above glob pattern works on Linux with no issue.
My question is: should I expect CMake glob patterns to work universally or (as I am suspecting) are legal glob patterns host-dependent? It’s not clear from any of the documentation if I should expect host-dependent glob patterns aside from the issue of case sensitivity which isn’t a problem here.
I can work around this with a simple EX*.*
glob and filtering with foreach()
and string(REGEX)
but I’d really like to avoid writing a specialty parser if host-independent globbing is available.
Thanks,
– Bob