Hi,
I have been trying to make this work for hours now, but I can’t find the
problem. I have a command that generates a coverage report. Naturally, I
want this report to be re-generated when the unit tests are updated. But
it just won’t work.
Subsequently, the pepr_test macro is invoked a couple of times. The unit
tests are correctly recognised as dependencies of coverage_html, so
when I ninja coverage_html, the unit tests are rebuilt after source
code changes. However, the html is never updated.
What am I missing?
I don’t know? Why does it not just check all dependencies recursively?
Does this mean that the top-level target needs file-level dependencies on all lowest-level targets’ files? This is super inconvenient, or do you see a nice way to adapt my example code?
Assuming that the test output is stable, depending on the test binaries might be sufficient (they change when the source files changed)
You could also attach a post build command to each test case target that touches a common file that you can depend on (touch, so that the time stamp changes).
CMake Error at CMakeLists.txt:104 (add_dependencies):
The dependency target "$<TARGET_FILE:ConstexprFlatMap>" of target
"coverage_html" does not exist.