CMake: Project structure with unit tests
For questions 1 & 2, I would recommend making a library from your non-test files excluding main.cpp (in this case just src/sqr.cpp and src/sqr.h), and then you can avoid listing (and more importantly re-compiling) all the sources twice. For question 3, these commands add a test called “MyTest” which invokes your executable “test” without any … Read more