mirror of
https://github.com/x-tools-author/x-tools.git
synced 2025-09-15 15:28:40 +08:00
chore: update files of project
This commit is contained in:
parent
aac81aae9b
commit
9b5d95f70c
@ -140,6 +140,10 @@ function(x_tools_finalize_executable target)
|
||||
endfunction()
|
||||
|
||||
function(x_tools_generate_translations target)
|
||||
if(QT_VERSION_MAJOR LESS 6)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(APP_TS_FILES "")
|
||||
list(APPEND APP_TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Translations/${target}_en.ts)
|
||||
list(APPEND APP_TS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Resources/Translations/${target}_zh_CN.ts)
|
||||
|
||||
@ -40,7 +40,12 @@ x_tools_git_get_latest_commit_time(${CMAKE_SOURCE_DIR} "X_TOOLS")
|
||||
# Common module
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Source/Common/Common)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Source/Common/CommonUI)
|
||||
option(X_TOOLS_IMPORT_MODULE_BLUETOOTH "Enable Bluetooth modbule" ON)
|
||||
if(QT_VERSION_MAJOR EQUAL 6)
|
||||
option(X_TOOLS_IMPORT_MODULE_BLUETOOTH "Enable Bluetooth modbule" ON)
|
||||
else()
|
||||
option(X_TOOLS_IMPORT_MODULE_BLUETOOTH "Enable Bluetooth modbule" OFF)
|
||||
endif()
|
||||
set(X_TOOLS_BLUETOOTH_MODULE_IS_VALID FALSE)
|
||||
if(X_TOOLS_IMPORT_MODULE_BLUETOOTH AND QT_VERSION_MAJOR GREATER 5)
|
||||
if(NOT Qt${QT_VERSION_MAJOR}_VERSION VERSION_LESS "6.5.0")
|
||||
find_package(
|
||||
@ -142,6 +147,17 @@ if(X_TOOLS_IMPORT_MODULE_CANBUS_STUDIO)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/Source/CANBusStudio/CANBusStudioUI)
|
||||
endif()
|
||||
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# BLE module
|
||||
if(NOT X_TOOLS_BLUETOOTH_MODULE_IS_VALID)
|
||||
list(REMOVE_ITEM X_TOOLS_SOURCE ${CMAKE_SOURCE_DIR}/Source/Tools/Tools/xToolsBleCentralTool.h)
|
||||
list(REMOVE_ITEM X_TOOLS_SOURCE ${CMAKE_SOURCE_DIR}/Source/Tools/Tools/xToolsBleCentralTool.cpp)
|
||||
list(REMOVE_ITEM X_TOOLS_SOURCE ${CMAKE_SOURCE_DIR}/Source/Tools/ToolsUI/xToolsBleCentralToolUi.h)
|
||||
list(REMOVE_ITEM X_TOOLS_SOURCE
|
||||
${CMAKE_SOURCE_DIR}/Source/Tools/ToolsUI/xToolsBleCentralToolUi.cpp)
|
||||
message(STATUS "The xTools BLE module source has been removed!")
|
||||
endif()
|
||||
|
||||
# --------------------------------------------------------------------------------------------------
|
||||
# xTools application
|
||||
set(WITH_GFLAGS OFF)
|
||||
|
||||
@ -2,27 +2,22 @@ file(GLOB_RECURSE X_TOOLS_COMMOM_SOURCE_H "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
|
||||
file(GLOB_RECURSE X_TOOLS_COMMOM_SOURCE_UI "${CMAKE_CURRENT_SOURCE_DIR}/*.ui")
|
||||
file(GLOB_RECURSE X_TOOLS_COMMOM_SOURCE_CPP "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
|
||||
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# BLE module
|
||||
if(NOT X_TOOLS_BLUETOOTH_MODULE_IS_VALID)
|
||||
list(REMOVE_ITEM X_TOOLS_SOURCE ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsBleScanner.h)
|
||||
list(REMOVE_ITEM X_TOOLS_SOURCE ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsBleScanner.cpp)
|
||||
list(REMOVE_ITEM X_TOOLS_SOURCE ${CMAKE_SOURCE_DIR}/Source/Tools/Tools/xToolsBleCentralTool.h)
|
||||
list(REMOVE_ITEM X_TOOLS_SOURCE ${CMAKE_SOURCE_DIR}/Source/Tools/Tools/xToolsBleCentralTool.cpp)
|
||||
list(REMOVE_ITEM X_TOOLS_SOURCE ${CMAKE_SOURCE_DIR}/Source/Tools/ToolsUI/xToolsBleCentralToolUi.h)
|
||||
list(REMOVE_ITEM X_TOOLS_SOURCE
|
||||
${CMAKE_SOURCE_DIR}/Source/Tools/ToolsUI/xToolsBleCentralToolUi.cpp)
|
||||
list(REMOVE_ITEM X_TOOLS_SOURCE
|
||||
${CMAKE_SOURCE_DIR}/Source/Common/CommonUI/xToolsBleDeviceInfoComboBox.h)
|
||||
list(REMOVE_ITEM X_TOOLS_SOURCE
|
||||
${CMAKE_SOURCE_DIR}/Source/Common/CommonUI/xToolsBleDeviceInfoComboBox.cpp)
|
||||
message(STATUS "The BLE module source has been removed!")
|
||||
endif()
|
||||
|
||||
set(ALL_SOURCE "")
|
||||
list(APPEND ALL_SOURCE ${X_TOOLS_COMMOM_SOURCE_H})
|
||||
list(APPEND ALL_SOURCE ${X_TOOLS_COMMOM_SOURCE_UI})
|
||||
list(APPEND ALL_SOURCE ${X_TOOLS_COMMOM_SOURCE_CPP})
|
||||
|
||||
# -------------------------------------------------------------------------------------------------
|
||||
# BLE module
|
||||
if(NOT X_TOOLS_BLUETOOTH_MODULE_IS_VALID)
|
||||
set(COMMON_PATH ${CMAKE_SOURCE_DIR}/Source/Common)
|
||||
list(REMOVE_ITEM ALL_SOURCE ${COMMON_PATH}/Common/xToolsBleScanner.h)
|
||||
list(REMOVE_ITEM ALL_SOURCE ${COMMON_PATH}/Common/xToolsBleScanner.cpp)
|
||||
list(REMOVE_ITEM ALL_SOURCE ${COMMON_PATH}/CommonUI/xToolsBleDeviceInfoComboBox.h)
|
||||
list(REMOVE_ITEM ALL_SOURCE ${COMMON_PATH}/CommonUI/xToolsBleDeviceInfoComboBox.cpp)
|
||||
message(STATUS "The common BLE module source has been removed!")
|
||||
endif()
|
||||
|
||||
add_library(xToolsCommon STATIC ${ALL_SOURCE} ${CMAKE_CURRENT_SOURCE_DIR}/xToolsCommon.qrc)
|
||||
target_link_libraries(xToolsCommon PRIVATE Qt${QT_VERSION_MAJOR}::Core)
|
||||
target_link_libraries(xToolsCommon PRIVATE Qt${QT_VERSION_MAJOR}::Gui)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user