Add Cmake install and find_package support

This commit is contained in:
offa
2025-07-01 20:28:33 +02:00
committed by Petra Baranski
parent 4f977219c3
commit 36822075bf
4 changed files with 48 additions and 4 deletions

View File

@@ -30,7 +30,16 @@ The supported syntax can be found in the [definitions docs](docs/definitions.md)
## How to add maddy to your cmake project
You can use [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html)
Use `find_package()` which provides `maddy::maddy` target:
```cmake
find_package(maddy REQUIRED)
add_executable(my_exe)
target_link_libraries(my_exe PRIVATE maddy::maddy)
```
Or you can use [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html)
which was introduced in CMake 3.11.
This way you can add