file(GLOB|GLOB_RECURSE): add possibility to list directories only
Commands file(GLOB)
and file(GLOB_RECURSE)
allow for option LIST_DIRECTORIES
(defaulting to true
and false
, respectively):
- When
LIST_DIRECTORIES
istrue
the output contains both files and directories. - When
LIST_DIRECTORIES
isfalse
the output contains files only.
There can be scenarios where directories only are desired in the output. Currently the way to achieve this is specifying LIST_DIRECTORIES true
, then checking each item in the output through command if(IS_DIRECTORY)
. I am thinking about a third possible value for LIST_DIRECTORIES
(e.g. "only
") that lists directories only in the output. Would it be possible to add it?
Thank you.