I am having a lot of trouble understanding how to write CMake files. Lets just say most of the available tutorials are bad, like really bad!
So I am trying to code the assignments in a book based on each chapter and test with Google Test. I know that I must include a CMake file at each subdirectory and that I want to compile Google Test and Google Mock from a git submodule as a share module. My goal is just to have CMake run from the root and branch down to each directory compiling each subfolder without me necessarily needing to add each file but use wildcards to compile all of them.
The project structure looks similar to :
- Root
- CMakeLists.txt
- README.md
- Lessons
- googletest (git submodule)
- Lesson_1
- src
- CMakeList.txt
- main.cpp
- test
- CMakeList.txt
- test_main.cpp
- CMakeLists.txt
How can I format the CMake file to autogenerate all these builds into a file that handles it all?