I'm using CMake to build my application and CUnit to test it. And I was wondering if there is a way to avoid including the production source files directly from the test code by name (
#include ../src/foo.c strikes me as awfully ad-hoc).
I have heard of collecting the production code into a library and adding it to the CMake project, and then linking that against your production and test code. But this approach doesn't sit well with me because it makes my CMake setup that much less straightforward. So I was wondering if there is A Better Way™