Skip to content

Commit

Permalink
added cmake linking instructions in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
donghoonpark committed Dec 14, 2024
1 parent 089358e commit 57db5e1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 57db5e1

Please sign in to comment.