How to use all *.c files in a directory with the Cmake build system?

How about the good old globbing?

FILE(GLOB MyCSources *.c)
ADD_EXECUTABLE(MyExecutable ${MyCSources})

Leave a Comment