mirror of
https://github.com/vsergeev/c-periphery.git
synced 2026-02-06 15:12:17 +08:00
readme: add building into project with cmake section
Modifications to original commit: * Minor reword of instructions Signed-off-by: Vanya A. Sergeev <v@sergeev.io>
This commit is contained in:
committed by
Vanya A. Sergeev
parent
aca6815e68
commit
b5e53e6b3a
15
README.md
15
README.md
@@ -471,6 +471,21 @@ $ gcc myprog.c -lperiphery -o myprog
|
||||
|
||||
Otherwise, additional include (`-I`) and library (`-L`) paths may be required.
|
||||
|
||||
## Building c-periphery into another project with CMake
|
||||
|
||||
Add to project's `CMakeLists.txt`:
|
||||
|
||||
```cmake
|
||||
find_package(periphery REQUIRED)
|
||||
# If package is installed locally, specify search path explicitly:
|
||||
# find_package(periphery REQUIRED PATHS <path to install/dir/lib/cmake>)
|
||||
|
||||
...
|
||||
|
||||
add_executable(YOUR_TARGET src/myprog.c)
|
||||
target_link_libraries(YOUR_TARGET PRIVATE periphery::periphery)
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
`man` page style documentation for each interface wrapper is available in [docs](docs/) folder.
|
||||
|
||||
Reference in New Issue
Block a user