diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e6a2fb..2b6ac1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ endif() check_function_exists(time HAVE_TIME) check_function_exists(localtime HAVE_LOCALTIME) if(HAVE_TIME AND HAVE_LOCALTIME) - message("passing HRDATE to compiler space") + message(STATUS "Passing HRDATE to compiler space") add_definitions(-DHRDATE) endif() @@ -50,7 +50,7 @@ find_library(LIB_UTIL NAMES libutil util) check_library_exists(util tty_get_name LIB_UTIL HAVE_TTY_GET_NAME) check_library_exists(util uu_lock LIB_UTIL HAVE_UU_LOCK) if(LIB_UTIL AND HAVE_TTY_GET_NAME AND HAVE_UU_LOCK) - message("passing HAVE_LIBUTIL to compiler space") + message(STATUS "Passing HAVE_LIBUTIL to compiler space") add_definitions(-DHAVE_LIBUTIL) endif() @@ -82,11 +82,11 @@ install( ) if(SYSTEMD_FOUND) - message("Systemd found at ${SYSTEMD_SERVICES_INSTALL_DIR}") + message(STATUS "Systemd service file will be installed to ${SYSTEMD_SERVICES_INSTALL_DIR}") # aggregate mbusd@.service from its template configure_file(${CMAKE_CURRENT_SOURCE_DIR}/systemd-units/mbusd@.service.in mbusd@.service) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mbusd@.service DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR}) endif() -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mbusd@.service DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR} OPTIONAL) # uninstall target configure_file( @@ -96,6 +96,7 @@ configure_file( add_custom_target(uninstall ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake ) + # unittest target option(TESTS "Enable unittests" OFF) if(TESTS) @@ -127,13 +128,13 @@ if(rpmBuilder_FOUND) set(CPACK_GENERATOR "RPM") endif() -set(CPACK_PACKAGE_NAME "modbusd") +set(CPACK_PACKAGE_NAME "mbusd") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Victor Antonovich") #required set(CPACK_PACKAGE_CONTACT "Victor Antonovich ") set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}-${GIT_BRANCH}-g${GIT_COMMIT_HASH}) set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_PROCESSOR}-v${PROJECT_VERSION}) set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Modbus serial to TCP/UDP transceiver") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Modbus TCP to Modbus RTU gateway") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set(CPACK_SOURCE_STRIP_FILES TRUE) diff --git a/README.md b/README.md index 52e29c3..e36ef18 100644 --- a/README.md +++ b/README.md @@ -27,28 +27,29 @@ Supported function codes: Please note all other function codes (including vendor-specific extensions) are supported on a "best-effort" basis and most likely will fail. -Configuring and compilation: +Installation instructions: ---------------------------- -Compilation using cmake -
+```
 $ git clone https://github.com/3cky/mbusd.git mbusd.git
 $ cd mbusd.git
-$ mkdir -p output.dir && cd output.dir
+$ mkdir -p build && cd build
 $ cmake ../
 $ make
-
+$ sudo make install +``` ***Compile time options*** -can be altered in many ways, e.g. by using the following tools in the output.dir: +can be altered in many ways, e.g. by using the following tools in the `build` dir: * ccmake - usually in the package cmake-curses-gui * cmake-gui - usually in the package cmake-qt-gui Usage: ------ - mbusd [-h] [-d] [-t] [-v level] [-L logfile] [-p device] [-s speed] [-m mode] \ - [-P port] [-C maxconn] [-N retries] [-R pause] [-W wait] [-T timeout] + mbusd [-h] [-d] [-L logfile] [-v level] [-c cfgfile] [-p device] [-s speed] [-m mode] + [-t] [-y file] [-Y file] [-P port] [-C maxconn] [-N retries] + [-R pause] [-W wait] [-T timeout] -h Usage help. -d Instruct mbusd not to fork itself (non-daemonize). @@ -67,8 +68,6 @@ Usage: Specifies serial port speed. -m mode Specifies serial port mode (like 8N1). - -P port - Specifies TCP port number (default 502). -t Enable RTS RS-485 data direction control (if not disabled while compile). -y file Enable RS-485 direction data direction control by writing '1' to file @@ -76,6 +75,8 @@ Usage: -Y file Enable RS-485 direction data direction control by writing '0' to file for transmitter enable and '1' to file for transmitter disable + -P port + Specifies TCP port number (default 502). -C maxconn Specifies maximum number of simultaneous TCP connections. -N retries @@ -150,8 +151,8 @@ Author: Victor Antonovich () -Credits: --------- +Contributors: +------------- Andrew Denysenko (): - RTS RS-485 data direction control @@ -163,6 +164,9 @@ James Jarvis (): Luuk Loeffen (): - systemd support +Nick Mayerhofer (): + - CMake build system + License: --------