File tree Expand file tree Collapse file tree 4 files changed +25
-7
lines changed Expand file tree Collapse file tree 4 files changed +25
-7
lines changed Original file line number Diff line number Diff line change 30
30
* .exe
31
31
* .out
32
32
* .app
33
-
34
33
build
35
34
35
+ # Windows specific
36
+ out
37
+ .vs
38
+
36
39
# Gtags
37
40
GTAGS
38
41
GRTAGS
Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.13 )
2
- project (protocolConverter )
2
+ project (modbus )
3
3
4
4
set (CMAKE_CXX_STANDARD 17 )
5
5
6
6
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic" )
7
7
8
8
option (MODBUS_EXAMPLE "Build example program" OFF )
9
9
option (MODBUS_TESTS "Build tests" OFF )
10
- option (MODBUS_COMMUNICATION "Use Modbus communication library" ON )
10
+ option (MODBUS_TCP_COMMUNICATION "Use Modbus TCP communication library" ON )
11
+
12
+ if (NOT win32 )
13
+ # Serial not supported on Windows
14
+ option (MODBUS_SERIAL_COMMUNICATION "Use Modbus serial communication library" OFF ) # not supported by windows platform
15
+ else ()
16
+ message (STATUS "Modbus Serial not supported on Windows." )
17
+ endif ()
11
18
12
19
add_subdirectory (src )
13
20
Original file line number Diff line number Diff line change @@ -23,10 +23,14 @@ target_include_directories(Modbus_Core PUBLIC ${PROJECT_SOURCE_DIR}/include PRIV
23
23
add_library (Modbus )
24
24
target_link_libraries (Modbus Modbus_Core )
25
25
26
+ if (MODBUS_SERIAL_COMMUNICATION )
27
+ message (STATUS "Enabling Modbus Serial" )
28
+ add_subdirectory (Serial )
29
+ target_link_libraries (Modbus Modbus_Serial )
30
+ endif ()
26
31
27
- if (MODBUS_COMMUNICATION )
28
- message (" Modbus communication is experimental " )
32
+ if (MODBUS_TCP_COMMUNICATION )
33
+ message (STATUS "Enabling Modbus Serial " )
29
34
add_subdirectory (TCP )
30
- add_subdirectory (Serial )
31
- target_link_libraries (Modbus Modbus_TCP Modbus_Serial )
35
+ target_link_libraries (Modbus Modbus_TCP )
32
36
endif ()
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ project(Google_tests)
2
2
add_subdirectory (googletest )
3
3
include_directories (${gtest_SOURCE_DIR} /include ${gtest_SOURCE_DIR} )
4
4
5
+ if (MSVC )
6
+ set (gtest_force_shared_crt on )
7
+ endif ()
8
+
5
9
set (TestFiles MB/ModbusRequestTests.cpp
6
10
MB/ModbusResponseTests.cpp
7
11
MB/ModbusExceptionTests.cpp
You can’t perform that action at this time.
0 commit comments