catchorg / catchorg/Catch2

Missing matchers and test macros when using FetchContent

Open
#2,153 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
21.5k
Forks
3.5k
Avg merge
3d 16h
Merged PRs (30d)
2

Description

I am integrating Catch2 with my CMake project using the FetchContent.

As described in the documentation:

```
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.4)

FetchContent_MakeAvailable(Catch2)

add_executable(tests ${TEST_SOURCES})

target_link_libraries(tests Catch2::Catch2)

```

Since I intend to write custom matchers (new style), I am also including
```
#include
#include
```
in the relevant files.

Unfortunately these headers are not found.

By digging into the downloaded Catch2 source within my cmake build tree, I can see that `catch2/matchers` and `catch2/catch_test_macros.hpp` are indeed missing. I can only see what appears to be a small subset of the full catch2 source.

To be more clear (hopefully), this is what FetchContent produces inside my build directory. As you can see the directory `catch2-src`, which I presume to be the downloaded source, is missing quite a few things.

![image](https://user-images.githubusercontent.com/6052201/104916545-22d9f380-598a-11eb-9f1f-1eea67c370cf.png)

Am I missing some step?
Since I have limited experience with Catch2 any help is appreciated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.