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
72cb2fc313
commit
c5eb58204e
@ -9,6 +9,13 @@ set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Gui Widgets WebSockets Network SerialPort SerialBus Bluetooth)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets WebSockets Network SerialPort SerialBus Bluetooth)
|
||||
|
||||
if (${QT_VERSION} VERSION_LESS "6.5")
|
||||
message(WARNING "The Qt version is too old, please using Qt6.5 or later.")
|
||||
endif ()
|
||||
|
||||
# CRCAssistant
|
||||
option(SAK_Enable_CRCAssistant "Enable CRCAssistant for QtSwissArmyKnife" ON)
|
||||
if(SAK_Enable_CRCAssistant)
|
||||
@ -51,26 +58,6 @@ include_directories(src/assistants/stringassistant/src)
|
||||
add_definitions(-DSAK_IMPORT_MODULE_STRINGASSISTANT)
|
||||
endif()
|
||||
|
||||
add_definitions(
|
||||
-DSAK_HOST_ADDRESS_ANY="Any"
|
||||
-DSAK_CLEAR_MESSAGE_INTERVAL=8000
|
||||
-DSAK_STYLE_DEFAULT="Fusion"
|
||||
-DSAK_EDITION="beta1"
|
||||
-DSAK_VERSION="5.0.0"
|
||||
-DSAK_AUTHOR="Qsaker"
|
||||
-DSAK_AUTHOR_EMAIL="qsaker@foxmail.com"
|
||||
-DSAK_GITHUB_REPOSITORY_URL="https://github.com/qsaker/QtSwissArmyKnife"
|
||||
-DSAK_GITEE_REPOSITORY_URL="https://gitee.com/qsaker/QtSwissArmyKnife"
|
||||
-DSAK_IMPORT_MODULE_MODBUS
|
||||
)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Gui Widgets WebSockets Network SerialPort SerialBus Bluetooth)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets WebSockets Network SerialPort SerialBus Bluetooth)
|
||||
|
||||
if (${QT_VERSION} VERSION_LESS "6.5")
|
||||
message(WARNING "The Qt version is too old, please using Qt6.5 or later.")
|
||||
endif ()
|
||||
|
||||
# Assistant module
|
||||
include_directories(src/assistants)
|
||||
include_directories(src/assistantsui)
|
||||
@ -110,7 +97,7 @@ file(GLOB_RECURSE TOOLS_UI_SOURCES "src/toolsui/*h" "src/toolsui/*.cc" "src/tool
|
||||
# App(QtSwissArmyKnife)
|
||||
# Tools module
|
||||
include_directories(src)
|
||||
file(GLOB APP_SOURCES
|
||||
set(APP_SOURCES
|
||||
src/main.cc
|
||||
src/SAKApplication.hh
|
||||
src/SAKApplication.cc
|
||||
@ -121,7 +108,20 @@ file(GLOB APP_SOURCES
|
||||
SAKResources.qrc
|
||||
)
|
||||
|
||||
set(SAK_SOURCES
|
||||
add_definitions(
|
||||
-DSAK_HOST_ADDRESS_ANY="Any"
|
||||
-DSAK_CLEAR_MESSAGE_INTERVAL=8000
|
||||
-DSAK_STYLE_DEFAULT="Fusion"
|
||||
-DSAK_EDITION="beta1"
|
||||
-DSAK_VERSION="5.0.0"
|
||||
-DSAK_AUTHOR="Qsaker"
|
||||
-DSAK_AUTHOR_EMAIL="qsaker@foxmail.com"
|
||||
-DSAK_GITHUB_REPOSITORY_URL="https://github.com/qsaker/QtSwissArmyKnife"
|
||||
-DSAK_GITEE_REPOSITORY_URL="https://gitee.com/qsaker/QtSwissArmyKnife"
|
||||
-DSAK_IMPORT_MODULE_MODBUS
|
||||
)
|
||||
|
||||
set(SAK_APP_SOURCES
|
||||
${ASSISTANT_SOURCES}
|
||||
${ASSISTANT_UI_SOURCES}
|
||||
${COMMON_SOURCES}
|
||||
@ -138,13 +138,16 @@ set(SAK_SOURCES
|
||||
)
|
||||
|
||||
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
||||
qt_add_executable(QtSwissArmyKnife MANUAL_FINALIZATION ${SAK_SOURCES})
|
||||
qt_add_executable(QtSwissArmyKnife
|
||||
MANUAL_FINALIZATION
|
||||
${SAK_APP_SOURCES}
|
||||
)
|
||||
else()
|
||||
if(ANDROID)
|
||||
add_library(QtSwissArmyKnife SHARED ${SAK_SOURCES})
|
||||
add_library(QtSwissArmyKnife SHARED ${SAK_APP_SOURCES})
|
||||
else()
|
||||
add_executable(QtSwissArmyKnife ${SAK_SOURCES})
|
||||
endif()
|
||||
add_executable(QtSwissArmyKnife ${SAK_APP_SOURCES})
|
||||
endif(ANDROID)
|
||||
endif()
|
||||
|
||||
target_link_libraries(QtSwissArmyKnife PRIVATE
|
||||
@ -189,9 +192,8 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set(WIN_DEPLOY_QT "${Qt${QT_VERSION_MAJOR}_DIR}/../../../bin/windeployqt.exe")
|
||||
message(STATUS ${Qt${QT_VERSION_MAJOR}_WIN_DEPLOY_QT})
|
||||
cmake_path(GET CMAKE_CXX_COMPILER PARENT_PATH compiler_path)
|
||||
add_custom_command(TARGET ${PROJECT_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${WIN_DEPLOY_QT} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/QtSwissArmyKnife.exe"
|
||||
add_custom_command(TARGET QtSwissArmyKnife POST_BUILD
|
||||
COMMAND ${WIN_DEPLOY_QT} "${CMAKE_BINARY_DIR}/QtSwissArmyKnife.exe"
|
||||
)
|
||||
# COMMAND ${CMAKE_COMMAND} -E copy_if_different "${compiler_path}/VCRUNTIME140.dll" ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||
|
||||
@ -56,7 +56,7 @@
|
||||
#include "SAKTranslator.hh"
|
||||
#include "SAKUiInterface.hh"
|
||||
#include "SAKDataStructure.hh"
|
||||
#include "SAKAssistantsFactory.hh"
|
||||
#include "SAKAssistantsFactory.h"
|
||||
|
||||
#ifdef SAK_IMPORT_MODULE_CANBUSUI
|
||||
#include "SAKCanBusUi.hh"
|
||||
|
||||
@ -7,24 +7,24 @@
|
||||
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in
|
||||
* the root of the source code directory.
|
||||
*****************************************************************************/
|
||||
#include "SAKAssistantsFactory.hh"
|
||||
#include "SAKAssistantsFactory.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
#ifdef SAK_IMPORT_MODULE_FILECHECKASSISTANT
|
||||
#include "SAKToolFileCheckAssistant.hh"
|
||||
#include "SAKToolFileCheckAssistant.h"
|
||||
#endif
|
||||
#ifdef SAK_IMPORT_MODULE_CRCASSISTANT
|
||||
#include "SAKToolCRCAssistant.hh"
|
||||
#include "SAKToolCRCAssistant.h"
|
||||
#endif
|
||||
#ifdef SAK_IMPORT_MODULE_QRCODEASSISTANT
|
||||
#include "SAKToolQRCodeCreator.hh"
|
||||
#endif
|
||||
#ifdef SAK_IMPORT_MODULE_FLOATASSISTANT
|
||||
#include "SAKToolFloatAssistant.hh"
|
||||
#include "SAKToolFloatAssistant.h"
|
||||
#endif
|
||||
#ifdef SAK_IMPORT_MODULE_STRINGASSISTANT
|
||||
#include "SAKToolStringAssistant.hh"
|
||||
#include "SAKToolStringAssistant.h"
|
||||
#endif
|
||||
#ifdef SAK_IMPORT_MODULE_ATASSISTANT
|
||||
#include "SAKAtAssistant.hh"
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in
|
||||
* the root of the source code directory.
|
||||
*****************************************************************************/
|
||||
#ifndef SAKASSISTANTSFACTORY_HH
|
||||
#define SAKASSISTANTSFACTORY_HH
|
||||
#ifndef SAKASSISTANTSFACTORY_H
|
||||
#define SAKASSISTANTSFACTORY_H
|
||||
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* QtSwissArmyKnife is licensed according to the terms in
|
||||
* the file LICENCE in the root of the source code directory.
|
||||
*****************************************************************************/
|
||||
#include "SAKBaseAssistant.hh"
|
||||
#include "SAKBaseAssistant.h"
|
||||
|
||||
SAKBaseAssistant::SAKBaseAssistant(QObject *parent)
|
||||
: QThread{parent}
|
||||
|
||||
@ -7,8 +7,8 @@
|
||||
* QtSwissArmyKnife is licensed according to the terms in
|
||||
* the file LICENCE in the root of the source code directory.
|
||||
*****************************************************************************/
|
||||
#ifndef SAKBASEASSISTANT_HH
|
||||
#define SAKBASEASSISTANT_HH
|
||||
#ifndef SAKBASEASSISTANT_H
|
||||
#define SAKBASEASSISTANT_H
|
||||
|
||||
#include <QThread>
|
||||
#include <QLoggingCategory>
|
||||
@ -20,4 +20,4 @@ public:
|
||||
explicit SAKBaseAssistant(QObject *parent = nullptr);
|
||||
};
|
||||
|
||||
#endif // SAKBASEASSISTANT_HH
|
||||
#endif // SAKBASEASSISTANT_H
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
#include <QLoggingCategory>
|
||||
|
||||
#include "SAKCommonCrcInterface.hh"
|
||||
#include "SAKToolCRCAssistant.hh"
|
||||
#include "SAKToolCRCAssistant.h"
|
||||
#include "ui_SAKToolCRCAssistant.h"
|
||||
|
||||
SAKToolCRCAssistant::SAKToolCRCAssistant(QWidget* parent)
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
#include <QDateTime>
|
||||
#include <QApplication>
|
||||
|
||||
#include "QtCryptographicHashCalculator.hh"
|
||||
#include "SAKToolFileCheckAssistant.hh"
|
||||
#include "QtCryptographicHashCalculator.h"
|
||||
#include "SAKToolFileCheckAssistant.h"
|
||||
QtCryptographicHashCalculator::QtCryptographicHashCalculator(SAKToolFileCheckAssistant *controller, QObject *parent)
|
||||
:QThread (parent)
|
||||
,mCryptographicHashController (controller)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2018-2020 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
*
|
||||
* The file is encoded using "utf8 with bom", it is a part
|
||||
@ -7,8 +7,8 @@
|
||||
* QtSwissArmyKnife is licensed according to the terms in
|
||||
* the file LICENCE in the root of the source code directory.
|
||||
*/
|
||||
#ifndef QTCRYPTOGRAPHICHASHCALCULATOR_HH
|
||||
#define QTCRYPTOGRAPHICHASHCALCULATOR_HH
|
||||
#ifndef QTCRYPTOGRAPHICHASHCALCULATOR_H
|
||||
#define QTCRYPTOGRAPHICHASHCALCULATOR_H
|
||||
|
||||
#include <QThread>
|
||||
|
||||
|
||||
@ -11,8 +11,8 @@
|
||||
#include <QMetaEnum>
|
||||
#include <QFileDialog>
|
||||
|
||||
#include "QtCryptographicHashCalculator.hh"
|
||||
#include "SAKToolFileCheckAssistant.hh"
|
||||
#include "QtCryptographicHashCalculator.h"
|
||||
#include "SAKToolFileCheckAssistant.h"
|
||||
#include "ui_SAKToolFileCheckAssistant.h"
|
||||
|
||||
SAKToolFileCheckAssistant::SAKToolFileCheckAssistant(QWidget *parent)
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
#include <QDebug>
|
||||
#include "SAKInterface.hh"
|
||||
#include "SAKCommonInterface.hh"
|
||||
#include "SAKToolFloatAssistant.hh"
|
||||
#include "SAKToolFloatAssistant.h"
|
||||
#include "ui_SAKToolFloatAssistant.h"
|
||||
|
||||
SAKToolFloatAssistant::SAKToolFloatAssistant(QWidget *parent)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2020 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
*
|
||||
* The file is encoded using "utf8 with bom", it is a part
|
||||
@ -7,8 +7,8 @@
|
||||
* QtSwissArmyKnife is licensed according to the terms in
|
||||
* the file LICENCE in the root of the source code directory.
|
||||
*/
|
||||
#ifndef SAKTOOLFLOATASSISTANT_HH
|
||||
#define SAKTOOLFLOATASSISTANT_HH
|
||||
#ifndef SAKTOOLFLOATASSISTANT_H
|
||||
#define SAKTOOLFLOATASSISTANT_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
@ -37,4 +37,4 @@ private slots:
|
||||
void on_doubleRadioButton_clicked();
|
||||
};
|
||||
|
||||
#endif // SAKTOOLFLOATASSISTANT_HH
|
||||
#endif // SAKTOOLFLOATASSISTANT_H
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* QtSwissArmyKnife is licensed according to the terms in
|
||||
* the file LICENCE in the root of the source code directory.
|
||||
*/
|
||||
#include "SAKToolStringAssistant.hh"
|
||||
#include "SAKToolStringAssistant.h"
|
||||
#include "SAKCommonDataStructure.hh"
|
||||
#include "ui_SAKToolStringAssistant.h"
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright 2020 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
*
|
||||
* The file is encoded using "utf8 with bom", it is a part
|
||||
@ -7,8 +7,8 @@
|
||||
* QtSwissArmyKnife is licensed according to the terms in
|
||||
* the file LICENCE in the root of the source code directory.
|
||||
*/
|
||||
#ifndef SAKTOOLSTRINGASSISTANT_HH
|
||||
#define SAKTOOLSTRINGASSISTANT_HH
|
||||
#ifndef SAKTOOLSTRINGASSISTANT_H
|
||||
#define SAKTOOLSTRINGASSISTANT_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
@ -30,4 +30,4 @@ private slots:
|
||||
void on_outputFormatComboBox_currentTextChanged(const QString &arg1);
|
||||
};
|
||||
|
||||
#endif // SAKTOOLSTRINGASSISTANT_HH
|
||||
#endif // SAKTOOLSTRINGASSISTANT_H
|
||||
|
||||
Loading…
Reference in New Issue
Block a user