diff --git a/cmake/Makefile.coverage.in b/cmake/Makefile.coverage.in
index 89996e01c5d157f3c4368777ecbf13af9280c92f..afda6673ea33d67d61db7ca72e3166b3479418eb 100644
--- a/cmake/Makefile.coverage.in
+++ b/cmake/Makefile.coverage.in
@@ -19,5 +19,8 @@
 coverage:
 	rm -f `find . -name "*\.gcda"`
 	make test
-	lcov --capture --directory . --output-file coverage.info --no-external --base-directory "@CMAKE_SOURCE_DIR@"
+	lcov --capture --directory . --output-file coverage_all.info
+	#lcov capture also includes external stuff like glibc, boost etc.
+	#only extract the reports for this project
+	lcov --extract coverage_all.info "@CMAKE_SOURCE_DIR@*" -o coverage.info
 	genhtml coverage.info --output-directory coverage_html