I am trying to build a big project with CMake but I struggle on how to write the CMakeList.txt file. My project is separated in different folders each containing a set of .hpp and .cpp files more or less related together as follows:
root
- memory
-- Memory.cpp
-- Memory.hpp
-- MemoryManager.hpp
-- MemoryManager.cpp
-- CMakeLists.txt
- tools
-- Array.cpp
-- Array.hpp
-- CMakeLists.txt
- main.cpp
- CMakeLists.txt
I would like to build all the files together to an executable. I don't want to build libraries in each subfolder as I don't see any good reason to do it. I would like also to avoid putting a single big list of all source files in the ADD_EXECUTABLE command of the CMakeLists.txt file located at the root of the project.
Do you have any idea of how to set this up correctly ?
Cheers,
M.