<div dir="ltr"><div><div>> I have a source tree which contains multiple directories each of<br>> which has a subdirectory called "xyz". I want to create a target<br>> that creates a zip file with each of the xyz directories.<br><br></div>You can filter the file paths with a few CMake script lines:<br><br>file(GLOB_RECURSE FILES "./*")<br>foreach(FILE ${FILES})<br>    if(FILE MATCHES ".*/xyz/.*")<br>        list(APPEND XYZ_FILES ${FILE})<br>    endif()<br>endforeach()<br><br></div>Now XYZ_FILES contains a list of files with /xyz/ subdirectory somewhere in their path.<br></div>