For CMake projects, the .gcov files aren't stored beside the source file, instead, they are placed next to the generated object files (in CMake projects, it will be somewhere like
path/to/build/dir/CMakeFiles/target.src/path/to/file/file.cpp.gcov)
Also, as CMake generates object files as file.cpp.o instead of file.o, gcov generates a file based on that file.cpp.gcov and not file.gcov.
I've added a function which leverages the information included in the compile_commands.json, it extracts the build directory and build command for the file, and then constructs the path to the .gcov file which will be next to the .o file.
For CMake projects, the
.gcov
files aren't stored beside the source file, instead, they are placed next to the generated object files (in CMake projects, it will be somewhere likepath/to/build/dir/CMakeFiles/target.src/path/to/file/file.cpp.gcov
)Also, as CMake generates object files as
file.cpp.o
instead offile.o
, gcov generates a file based on thatfile.cpp.gcov
and notfile.gcov
.I've added a function which leverages the information included in the
compile_commands.json
, it extracts the build directory and build command for the file, and then constructs the path to the.gcov
file which will be next to the.o
file.