Skip to content

Commit

Permalink
Merge pull request #9 from AlexSP0/cmake
Browse files Browse the repository at this point in the history
CMakeLists.txt added
  • Loading branch information
Krzysztow authored Aug 10, 2021
2 parents 1b0e684 + e098b16 commit 852fbde
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.10)

project(modbus-utils VERSION 1.0.0 LANGUAGES C)

find_package(PkgConfig REQUIRED)
pkg_check_modules(MODBUS REQUIRED IMPORTED_TARGET libmodbus)

add_executable(modbus_client "${CMAKE_CURRENT_SOURCE_DIR}/modbus_client/modbus_client.c")
target_link_libraries(modbus_client PkgConfig::MODBUS)
target_include_directories(modbus_client PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/common" "${MODBUS_INCLUDE_DIRS}")

add_executable(modbus_server "${CMAKE_CURRENT_SOURCE_DIR}/modbus_server/modbus_server.c")
target_link_libraries(modbus_server PkgConfig::MODBUS)
target_include_directories(modbus_server PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/common" "${MODBUS_INCLUDE_DIRS}")
2 changes: 1 addition & 1 deletion modbus_client/modbus_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <string.h>
#include <stdint.h>

#include "modbus.h"
#include <modbus.h>
#include "errno.h"

#include "mbu-common.h"
Expand Down

0 comments on commit 852fbde

Please sign in to comment.