I’ve just read this:
CMake – Automatically add all files in a folder to a target?
With the answer suggesting a file glob, e.g.:
file(GLOB "*.h" "*.cpp")
now, what if I want my target to depend on all files of a certain type under a certain folder – which might be within multiple subfolders? I tried using
execute_process(COMMAND find src/baz/ -name "*.cpp" OUTPUT_VARIABLE BAR)
but this gives me the error:
Cannot find source file:
src/baz/some/file/here src/baz/some/other_file/here src/baz/some/other_file/here2
(yes, with that spacing.)
What am I doing wrong here?