Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMakeLists doesn't build a library #72

Open
oedze opened this issue Nov 11, 2024 · 1 comment
Open

CMakeLists doesn't build a library #72

oedze opened this issue Nov 11, 2024 · 1 comment

Comments

@oedze
Copy link

oedze commented Nov 11, 2024

The CMakeLists is now used to create a few executables with different settings.

It can't however be used as a static library right now which is usefull for embedded devices.

being able to do

add_subdirectory(path/to/nanoMODBUS)

add_executable(myproject main.c)

target_link_libaries(myproject PRIVATE nanomodbus)

in our main projects CMakeLists.txt would be ideal for our scenario.

To be able to do this requires some change to the current CMakeLists.txt. If anyone's interested i can make a pull request.
If i do this i would also prefer to move the nanomodbus.h to a include folder.

@debevv
Copy link
Owner

debevv commented Nov 25, 2024

Hi, the CMakeLists in the repo was never meant to be used by the user, really is there just to build the various test/examples that were useful to me during development.
The "official" way to use nanomodbus is to copy the .c and .h in your codebase and compile everything together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants