CMake generate list of source files without glob

Viewed 18387

I'm currently using this piece of code to generate my list of source files for CMake to compile my C++ project:

file(GLOB CPP_FILES src/*.cpp)

As I have read here that this is discouraged by CMake I would like to know if I can list the source files explicitly for CMake using CMake, as I am not familiar with scripting languages like Python.

I'm asking this as it would require a lot of work to add all the cpp files manually into CMake, especially when working with multiply people.

The project is platform-independent and my source files are in a sub-folder.

1 Answers
Related