diff options
| author | Daniel J. Rollins | 2018-01-29 22:56:43 +0000 |
|---|---|---|
| committer | Martin Hořeňovský | 2018-02-08 12:18:42 +0100 |
| commit | 39bfc6e82b32b462e85884a97ce0e979e3f93a78 (patch) | |
| tree | 0cb406defa939c48d68f545fdf90b226346f81c1 /projects/SelfTest/UsageTests/ToStringVector.tests.cpp | |
| parent | ba6d33fb8c74cf1a453368c07f59145a0b0d429c (diff) | |
| download | catch3-39bfc6e82b32b462e85884a97ce0e979e3f93a78.tar.gz | |
Export Catch as a CMake package and 'linkable' target
Create a namespaced Catch2::Catch target that is 'linkable' through
`target_link_libraries()` and export it so it is findable through
`find_package()`.
`find_package()` will find versions with the same major number and with
minor number >= requested.
This makes catch a lot easier to use in CMake-based projects. Whether it
is found using `find_package` or included in the client project as a
subdirectory, the client can include the catch headers per-target with
`target_include_directories(target PRIVATE Catch2::Catch).
Example usage:
cmake_minimum_required(VERSION 3.1)
# include Catch2 as subdirectory or installed package
# add_subdirectory(Catch2)
find_package(Catch2 VERSION 2.1.0 REQUIRED)
add_executable(tests tests/catch_main.cpp)
target_link_libraries(tests PRIVATE Catch2::Catch)
Diffstat (limited to 'projects/SelfTest/UsageTests/ToStringVector.tests.cpp')
0 files changed, 0 insertions, 0 deletions