How can I merge multiple lists of files together with CMake?

The file (GLOB ...) command allows for specifying multiple globbing expressions:

file (GLOB files "path/to/files/*" "path/to/files2*")

Alternatively, use the list (APPEND ...) sub-command to merge lists, e.g.:

file (GLOB files "path/to/files/*")
file (GLOB files2 "path/to/files2*")
list (APPEND files ${files2})

Leave a Comment

tech