list of source files from your source tree.
So I'm supposed to list each and every source file in my CMakeLists? It seems too repetitive to me, there must be a better way, isn't it?
😂, You can hook up a function to python code which does the globing, and prints it out to stdout, then grab those results from cmake into a list.
It is good practice to list the files
Like this: https://cmake.org/cmake/help/latest/command/execute_process.html
I should've included why they don't recommend listing files using CMake itself or that cursed lang you just mentioned ...If no CMakeLists.txt file changes when a source is added or removed then the generated build system cannot know when to ask CMake to regenerate.
Doesn't have to be python btw, just chose it because it's in almost all linux OS
Have the python script add a space character at the end of the cmake file just so that cmake will think configs have changed.
Обсуждают сегодня