Skip to content

Commit 9870117

Browse files
committed
Update README with recent changes
- Add CMake version compatibility information as determined via (#47) - `FIND_QUIETLY` option (#43) - Extra flags to pass to `geninfo` and `lcov` (#45)
1 parent 5c8a60a commit 9870117

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# CMake-codecov
22

3-
[![Travis](https://img.shields.io/travis/RWTH-HPC/CMake-codecov/master.svg?style=flat-square)](https://travis-ci.org/RWTH-HPC/CMake-codecov)
4-
[![Codecov](https://img.shields.io/codecov/c/github/RWTH-HPC/CMake-codecov.svg?style=flat-square)](https://codecov.io/github/RWTH-HPC/CMake-codecov?branch=master)
5-
[![](https://img.shields.io/github/issues-raw/RWTH-HPC/CMake-codecov.svg?style=flat-square)](https://github.com/RWTH-HPC/CMake-codecov/issues)
6-
[![](http://img.shields.io/badge/license-3--clause_BSD-blue.svg?style=flat-square)](LICENSE)
7-
8-
CMake module to enable code coverage easily and generate coverage reports with CMake targets.
3+
[![CMake-codecov CI](https://github.com/RWTH-HPC/CMake-codecov/actions/workflows/ci.yml/badge.svg)](https://github.com/RWTH-HPC/CMake-codecov/actions/workflows/ci.yml)
4+
[![Codecov](https://img.shields.io/codecov/c/github/RWTH-HPC/CMake-codecov.svg)](https://codecov.io/github/RWTH-HPC/CMake-codecov?branch=master)
5+
[![](https://img.shields.io/github/issues-raw/RWTH-HPC/CMake-codecov.svg)](https://github.com/RWTH-HPC/CMake-codecov/issues)
6+
[![](http://img.shields.io/badge/license-3--clause_BSD-blue.svg)](LICENSE)
7+
![](https://img.shields.io/badge/CMake-3.10.3...4.0.1-blue)
98

109

10+
CMake module to enable code coverage easily and generate coverage reports with CMake targets
1111

1212
## Include into your project
1313

@@ -36,21 +36,30 @@ For coverage evaluation you have to add ```coverage_evaluate()``` after all othe
3636

3737
To enable coverage support in general, you have to enable ```ENABLE_COVERAGE``` option in your CMake configuration. You can do this by passing ```-DENABLE_COVERAGE=On``` on your command line or with your graphical interface.
3838

39-
If coverage is supported by your compiler, the specified targets will be build with coverage support. If your compiler has no coverage capabilities (I asume intel compiler doesn't) you'll get a warning but CMake will continue processing and coverage will simply just be ignored.
39+
If coverage is supported by your compiler, the specified targets will be build with coverage support. If your compiler has no coverage capabilities you will get a warning but CMake will continue processing and coverage will simply just be ignored. If you do not want these warnings to be printed, you might want to use the option `-Dcodecov_FIND_QUIETLY=ON`.
40+
41+
42+
## Compatibility
43+
44+
CMake-codecov has been tested with CMake 3.10 up to 4.0 and works with `Unix Makefiles` and `Ninja` generators.
45+
46+
**Note:** When using the `Ninja` generator, CMake-codecov requires a version of CMake >= `3.21`.
47+
48+
4049

41-
#### Compiler issues
50+
### Compiler issues
4251

4352
Different compilers may be using different implementations for code coverage. If you'll try to cover targets with C and Fortran code but don't use gcc & gfortran but clang & gfortran, this will cause linking problems. To avoid this, such problems will be detected and coverage will be disabled for such targets.
4453

4554
Even C only targets may cause problems, if e.g. clang compiles the coverage for an older gcov version than the one is shipped with your distribution. [FindGcov.cmake](cmake/FindGcov.cmake) tries to find a compatible coverage evaluation tool to avoid this issue, but may fail. In this case you should check coverage with a different compiler or install a compatible coverage tool.
4655

47-
#### File extensions
56+
### File extensions
4857

4958
Starting with CMake `3.14`, this module will use the last file extension only (i.e. `.c` for `a.b.c`). Prior versions will use the full file extension starting with the first dot in the file name.
5059

5160
### Build targets with coverage support
5261

53-
To enable coverage support you have two options: You can mark targets explictly for coverage by adding your target with ```add_coverage()```. This call must be done in the same directory as your ```add_executable()```or ```add_library()``` call:
62+
To enable coverage support you have two options: You can mark targets explicitly for coverage by adding your target with ```add_coverage()```. This call must be done in the same directory as your ```add_executable()```or ```add_library()``` call:
5463
```CMake
5564
add_executable(some_exe foo.c bar.c)
5665
add_coverage(some_exe)
@@ -62,7 +71,7 @@ add_coverage(some_lib)
6271

6372
### Executing your program
6473

65-
To be able to evaluate your coverage data, you have to run your application first. Some projects include CMake tests - it might me a good idea to execute them now by ```make test```, but you can run your application however you want (e.g. by running ```./a.out```).
74+
To be able to evaluate your coverage data, you have to run your application first. Some projects include CMake tests - it might be a good idea to execute them now by ```make test```, but you can run your application however you want (e.g. by running ```./a.out```).
6675

6776

6877
### Evaluating coverage data

0 commit comments

Comments
 (0)