added cmake linking instructions in readme
This commit is contained in:
parent
18a90a0a3e
commit
42ba10717a
22
README.md
22
README.md
@ -96,8 +96,30 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
## Installation
|
||||
|
||||
### Integrate source code to your project
|
||||
|
||||
Just copy `nanomodbus.c` and `nanomodbus.h` inside your application codebase.
|
||||
|
||||
### CMake project
|
||||
|
||||
nanomodbus supports library linking by using cmake.
|
||||
|
||||
```cmake
|
||||
FetchContent_Declare(
|
||||
nanomodbus
|
||||
GIT_REPOSITORY https://github.com/debevv/nanoMODBUS
|
||||
GIT_TAG master # or the version you want
|
||||
GIT_SHALLOW TRUE
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(nanomodbus)
|
||||
|
||||
...
|
||||
|
||||
add_executable(your_program source_codes)
|
||||
target_link_libraries(your_program nanomodbus)
|
||||
```
|
||||
|
||||
## API reference
|
||||
|
||||
API reference is available in the repository's [GitHub Pages](https://debevv.github.io/nanoMODBUS/nanomodbus_8h.html).
|
||||
|
||||
Loading…
Reference in New Issue
Block a user