diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 55 |
1 files changed, 24 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 788732f..8e3b822 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.0) set(CMAKE_CXX_STANDARD 17) add_compile_options(-Wno-psabi) -project(inverter-tools VERSION 1.4.0) +project(inverter-tools VERSION 1.5.0) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX /usr/local/bin) @@ -29,24 +29,30 @@ find_library(LIBSERIALPORT_LIBRARY serialport) find_path(LIBSERIALPORT_INCLUDE_DIR libserialport.h) +# shared list of sources +set(sources + src/common.cc + src/logging.cc + src/util.cc + src/p18/defines.cc + src/p18/client.cc + src/p18/functions.cc + src/p18/response.cc + src/p18/commands.cc + src/formatter/formatter.cc + src/voltronic/crc.cc + src/voltronic/usb_device.cc + src/voltronic/device.cc + src/voltronic/time.cc + src/voltronic/serial_device.cc + src/voltronic/pseudo_device.cc + src/voltronic/shared_buf.cc) + add_executable(inverterctl src/inverterctl.cc - src/p18/defines.cc - src/p18/client.cc - src/p18/functions.cc - src/p18/response.cc - src/util.cc - src/p18/commands.cc - src/common.cc - src/formatter/formatter.cc - src/voltronic/crc.cc - src/voltronic/usb_device.cc - src/voltronic/device.cc - src/voltronic/time.cc - src/voltronic/serial_device.cc - src/voltronic/pseudo_device.cc) + ${sources}) target_include_directories(inverterctl PRIVATE .) -target_link_libraries(inverterctl m ${HIDAPI_LIBRARY} ${LIBSERIALPORT_LIBRARY}) +target_link_libraries(inverterctl m pthread ${HIDAPI_LIBRARY} ${LIBSERIALPORT_LIBRARY}) target_compile_definitions(inverterctl PUBLIC INVERTERCTL) target_include_directories(inverterctl PRIVATE ${HIDAPI_INCLUDE_DIR} @@ -59,23 +65,10 @@ install(TARGETS inverterctl add_executable(inverterd src/inverterd.cc - src/common.cc - src/util.cc + ${sources} src/server/server.cc src/server/connection.cc - src/server/signal.cc - src/p18/commands.cc - src/p18/defines.cc - src/p18/client.cc - src/p18/functions.cc - src/p18/response.cc - src/formatter/formatter.cc - src/voltronic/crc.cc - src/voltronic/usb_device.cc - src/voltronic/device.cc - src/voltronic/time.cc - src/voltronic/serial_device.cc - src/voltronic/pseudo_device.cc) + src/server/signal.cc) target_include_directories(inverterd PRIVATE .) target_compile_definitions(inverterd PUBLIC INVERTERD) target_link_libraries(inverterd |