Closed rbost closed 4 years ago
Unfortunately, as the CI needs a Fortran compiler, and Homebrew fails to install it (issue with brew link gcc
), the correctness of the fix cannot be checked with Travis.
Thanks for this PR. As soon as I've fixed the CI environment, I'll merge it.
Merging #15 into master will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #15 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 5 5
Lines 20 20
=====================================
Hits 20 20
Continue to review full report at Codecov.
Legend - Click here to learn more
Ξ = absolute <relative> (impact)
,ΓΈ = not affected
,? = missing data
Powered by Codecov. Last update 9a24e83...5640f42. Read the comment docs.
Sorry, I wanted to open a new PR with other changes, and I mixed things up big time ...
I will open a new PR for this fix + another PR for the new bug I found and fixed.
I think that's okay, I can merge both. :)
I think that's okay, I can merge both. :)
Do you mean both commits or both PRs? :)
Both commits in this PR.
Both commits in this PR.
Alright then. Let me just quickly explain what 1c30da6 does in a bit more details.
Suppose that you are using add_subdirectory(subdir), and that in the CMakeLists.txt file of subdir, you defined a target sub_target. If you call add_coverage(sub_target) from subdir's CMake file, everything is fine. But, if you do so from the root CMake file, you will run into errors from CMake-codecov because it expects files at some incorrect locations. This is because the target's source directory (TDIR) is computed from the current binary directory (CMAKE_CURRENT_BINARY_DIR) not the one of the target when it was defined. We can get it by calling the BINARY_DIR property on the target, and this is exactly what commit 1c30da6 does.
This PR fixes #12 using @rene-aguirre's solution, and allows CMake-codecov to work perfectly on OS X.
By the way, thanks for the great work π