Conan.io recipe for libmodbus.
The recipe generates library packages, which can be found at Bintray.
The package is usually consumed using the conan install
command or a conanfile.txt.
-
Add remote to conan's package registry.txt:
$ conan remote add joakimono https://api.bintray.com/conan/joakimono/conan
-
Using conanfile.txt in your project with cmake
Add a conanfile.txt to your project. This file describes dependencies and your configuration of choice, e.g.:
[requires] libmodbus/[>=3.1.6]@joakimono/stable [options] libmodbus:shared=False [imports] licenses, * -> ./licenses @ folder=True [generators] cmake
Insert into your CMakeLists.txt something like the following lines:
cmake_minimum_required(VERSION 3.1.2) project(TheProject CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) add_executable(the_executor code.cpp) target_link_libraries(the_executor CONAN_PKG::libmodbus)
Then, do
$ mkdir build && cd build $ conan install ..
You can now continue with the usual dance with cmake commands for configuration and compilation. For details on how to use conan, please consult Conan.io docs
Option | Default | Domain |
---|---|---|
shared | True | [True,False] |
Not tested for mingw or cygwin on Windows.