File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,35 @@ target_link_libraries(MY_TARGET ut::target_name)
7070
7171A special target ` ut::ut ` is also available, combining all of the above.
7272
73+ ### Using with ` find_package `
74+
75+ If you prefer, you can install the library and import it into a project via
76+ ` find_package ` like so:
77+
78+
79+ ``` sh
80+ git clone github.com/dk949/libut
81+ cd libut
82+ # use cmake --list-presets for a list of available presets
83+ cmake --preset local -DCMAKE_INSTALL_PREFIX=./libut-install
84+ cmake --install build
85+ ```
86+
87+ Then in your cmake file:
88+
89+ ``` cmake
90+ set(ENV{ut_DIR} /path/to/libut/libut-install)
91+ find_package(ut REQUIRED)
92+ target_link_libraries(MY_TARGET ut::ut_target_name)
93+ ```
94+
95+ > [ !NOTE]
96+ > When using find_package, all target names above (except ut::ut) are prefixed
97+ > with` ut_ ` .
98+ >
99+ > The prefixed targets are also available when using ` FetchContent ` , so for
100+ > a config that could use either, use the prefixed targets.
101+
73102## Testing
74103
75104Test can be ran using Catch2
You can’t perform that action at this time.
0 commit comments