From 42ba10717a9171ed6d0e2c76d2f19f0e271a7248 Mon Sep 17 00:00:00 2001 From: Donghoon Park Date: Sat, 14 Dec 2024 12:45:24 +0900 Subject: [PATCH] added cmake linking instructions in readme --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 2943801..6984484 100644 --- a/README.md +++ b/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).