@@ -20,28 +20,20 @@ if(Qt${QT_VERSION_MAJOR}SerialBus_FOUND AND NOT QT_VERSION VERSION_LESS "5.12.0"
2020 add_compile_definitions (X_ENABLE_SERIALBUS)
2121 list (APPEND X_LIBS Qt${QT_VERSION_MAJOR} ::SerialBus)
2222
23- if (QT_VERSION VERSION_LESS "5.12.0" )
24- add_compile_definitions (X_ENABLE_X_MODBUS=0)
23+ option (X_ENABLE_X_MODBUS "Enable xModbus module" ON )
24+ if (X_ENABLE_X_MODBUS)
25+ add_compile_definitions (X_ENABLE_X_MODBUS=1)
26+ else ()
2527 remove_all_x_modbus_files()
28+ add_compile_definitions (X_ENABLE_X_MODBUS=0)
29+ endif ()
2630
27- add_compile_definitions (X_ENABLE_X_CANBUS=0)
28- remove_all_x_canbus_files()
31+ option (X_ENABLE_X_CANBUS "Enable xCanbus module" ON )
32+ if (X_ENABLE_X_CANBUS)
33+ add_compile_definitions (X_ENABLE_X_CANBUS=1)
2934 else ()
30- option (X_ENABLE_X_MODBUS "Enable xModbus module" ON )
31- if (X_ENABLE_X_MODBUS)
32- add_compile_definitions (X_ENABLE_X_MODBUS=1)
33- else ()
34- remove_all_x_modbus_files()
35- add_compile_definitions (X_ENABLE_X_MODBUS=0)
36- endif ()
37-
38- option (X_ENABLE_X_CANBUS "Enable xCanbus module" ON )
39- if (X_ENABLE_X_CANBUS)
40- add_compile_definitions (X_ENABLE_X_CANBUS=1)
41- else ()
42- remove_all_x_canbus_files()
43- add_compile_definitions (X_ENABLE_X_CANBUS=0)
44- endif ()
35+ remove_all_x_canbus_files()
36+ add_compile_definitions (X_ENABLE_X_CANBUS=0)
4537 endif ()
4638else ()
4739 message (STATUS "SerialBus module is disable, SerialBus files will be removed." )
0 commit comments