chore: update files of project

This commit is contained in:
x-tools-author 2024-03-20 16:16:07 +08:00
parent 28e2238af0
commit 4c971d00c4
22 changed files with 127 additions and 94 deletions

View File

@ -1,3 +1,15 @@
function(sak_3rd_setup_qt_aes target)
function(x_tools_3rd_setup_qt_aes target)
target_link_libraries(${target} PRIVATE QtAES::QtAES)
endfunction(sak_3rd_setup_qt_aes)
endfunction()
function(x_tools_3rd_setup_glog target)
target_link_libraries(${target} PRIVATE glog::glog)
endfunction()
function(x_tools_3rd_setup_nodeeditor target)
target_link_libraries(${target} PRIVATE QtNodes::QtNodes)
endfunction()
function(x_tools_3rd_setup_qmdnsengine target)
target_link_libraries(${target} PRIVATE qmdnsengine)
endfunction()

View File

@ -27,6 +27,8 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${X_TOOLS_QT_COMPONENTS})
include(CMake/xToolsCommon.cmake)
include(CMake/xToolsGit.cmake)
include(CMake/xToolsDeployQt.cmake)
include(CMake/xToolsThirdParty.cmake)
file(GLOB_RECURSE X_TOOLS_COMMOM_SOURCE_H "${CMAKE_SOURCE_DIR}/Source/Common/*.h")
file(GLOB_RECURSE X_TOOLS_COMMOM_SOURCE_UI "${CMAKE_SOURCE_DIR}/Source/Common/*.ui")
@ -88,8 +90,6 @@ set(BUILD_SHARED_LIBS OFF)
sak_add_subdirectory("glog-0.7.0")
sak_add_subdirectory("qmdnsengine-master")
#add_subdirectory(${CMAKE_SOURCE_DIR}/Source/Assistants)
qt_add_executable(xTools ${X_TOOLS_SOURCE})
sak_git_get_last_commit(${CMAKE_SOURCE_DIR} "SAK")
sak_git_get_last_commit_time(${CMAKE_SOURCE_DIR} "SAK")
@ -104,3 +104,7 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
endif()
target_link_libraries(xTools PRIVATE qmdnsengine)
target_link_libraries(xTools PRIVATE glog::glog)
# -------------------------------------------------------------------------------------------------
# Assistants
add_subdirectory(${CMAKE_SOURCE_DIR}/Source/Assistants)

View File

@ -1,5 +1,7 @@
set(APP_ASSISTANT_OWN_SOURCE "")
set(APP_ASSISTANT_OWN_LIBS Qt${QT_VERSION_MAJOR}::Widgets)
sak_add_assistant("ascii" "AsciiAssistant")
sak_3rd_setup_glog(AsciiAssistant)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Source)
x_tools_add_assistant("ASCII" "AsciiAssistant")
x_tools_3rd_setup_glog(AsciiAssistant)

View File

@ -6,11 +6,11 @@
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* code directory.
**************************************************************************************************/
#include "sakasciiassistant.h"
#include "sakui.h"
#include "xToolsAsciiAssistant.h"
#include "xToolsUi.h"
int main(int argc, char* argv[])
{
const QString appName = QObject::tr("ASCII Assistant");
return sakExec<SAKAsciiAssistant>(argc, argv, appName);
return sakExec<xToolsAsciiAssistant>(argc, argv, appName);
}

View File

@ -1,5 +1,7 @@
set(APP_ASSISTANT_OWN_SOURCE "")
set(APP_ASSISTANT_OWN_LIBS Qt${QT_VERSION_MAJOR}::Widgets)
sak_add_assistant("base64" "Base64Assistant")
sak_3rd_setup_glog(Base64Assistant)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Source)
x_tools_add_assistant("Base64" "Base64Assistant")
x_tools_3rd_setup_glog(Base64Assistant)

View File

@ -6,11 +6,11 @@
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* code directory.
**************************************************************************************************/
#include "sakbase64assistant.h"
#include "sakui.h"
#include "xToolsBase64Assisatnt.h"
#include "xToolsUi.h"
int main(int argc, char* argv[])
{
const QString appName = QObject::tr("Base64 Assisatnt");
return sakExec<SAKBase64Assisatnt>(argc, argv, appName);
return sakExec<xToolsBase64Assisatnt>(argc, argv, appName);
}

View File

@ -1,9 +1,11 @@
set(APP_ASSISTANT_OWN_SOURCE
${CMAKE_SOURCE_DIR}/src/common/common/sakcrcinterface.h
${CMAKE_SOURCE_DIR}/src/common/common/sakcrcinterface.cc
${CMAKE_SOURCE_DIR}/src/common/common/sakdatastructure.h
${CMAKE_SOURCE_DIR}/src/common/common/sakdatastructure.cc)
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsCrcInterface.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsCrcInterface.cpp
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsDataStructure.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsDataStructure.cpp)
set(APP_ASSISTANT_OWN_LIBS Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network)
sak_add_assistant("broadcast" "BroadcastAssistant")
sak_3rd_setup_glog(BroadcastAssistant)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Source)
x_tools_add_assistant("Broadcast" "BroadcastAssistant")
x_tools_3rd_setup_glog(BroadcastAssistant)

View File

@ -6,11 +6,11 @@
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* code directory.
**************************************************************************************************/
#include "sakbroadcastassistant.h"
#include "sakui.h"
#include "xToolsBroadcastAssistant.h"
#include "xToolsUi.h"
int main(int argc, char* argv[])
{
const QString appName = QObject::tr("Broadcast Assistant");
return sakExec<SAKBroadcastAssistant>(argc, argv, appName);
return sakExec<xToolsBroadcastAssistant>(argc, argv, appName);
}

View File

@ -1,29 +1,29 @@
macro(x_tools_add_assistant dir_name app_name)
string(TOUPPER ${app_name} upper_app_name)
option(SAK_ENABLE_APP_${upper_app_name} "" ON)
if(SAK_ENABLE_APP_${upper_app_name})
option(X_TOOLS_ENABLE_APP_${upper_app_name} "" ON)
if(X_TOOLS_ENABLE_APP_${upper_app_name})
file(
GLOB_RECURSE
ASSISTANT_SOURCES
"${CMAKE_SOURCE_DIR}/src/assistants/${dir_name}/*.h"
"${CMAKE_SOURCE_DIR}/src/assistants/${dir_name}/*.cc"
"${CMAKE_SOURCE_DIR}/src/assistants/${dir_name}/*.ui"
"${CMAKE_SOURCE_DIR}/src/assistants/${dir_name}/*.qrc")
"${CMAKE_SOURCE_DIR}/Source/Assistants/${dir_name}/*.h"
"${CMAKE_SOURCE_DIR}/Source/Assistants/${dir_name}/*.cpp"
"${CMAKE_SOURCE_DIR}/Source/Assistants/${dir_name}/*.ui"
"${CMAKE_SOURCE_DIR}/Source/Assistants/${dir_name}/*.qrc")
set(APP_ASSISTANT_SOURCES
${CMAKE_SOURCE_DIR}/src/common/common/sakinterface.h
${CMAKE_SOURCE_DIR}/src/common/common/sakinterface.cc
${CMAKE_SOURCE_DIR}/src/common/common/saktranslator.h
${CMAKE_SOURCE_DIR}/src/common/common/saktranslator.cc
${CMAKE_SOURCE_DIR}/src/common/common/saksettings.h
${CMAKE_SOURCE_DIR}/src/common/common/saksettings.cc
${CMAKE_SOURCE_DIR}/src/common/commonui/sakcommonmainwindow.h
${CMAKE_SOURCE_DIR}/src/common/commonui/sakcommonmainwindow.cc
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsInterface.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsInterface.cpp
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsTranslator.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsTranslator.cpp
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsSettings.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsSettings.cpp
${CMAKE_SOURCE_DIR}/Source/Common/CommonUI/xToolsMainWindow.h
${CMAKE_SOURCE_DIR}/Source/Common/CommonUI/xToolsMainWindow.cpp
${APP_ASSISTANT_OWN_SOURCE}
${ASSISTANT_SOURCES}
${CMAKE_SOURCE_DIR}/qtswissarmyknife.qrc)
${CMAKE_SOURCE_DIR}/xTools.qrc)
if(WIN32)
list(APPEND APP_ASSISTANT_SOURCES ${CMAKE_SOURCE_DIR}/windows.rc)
list(APPEND APP_ASSISTANT_SOURCES ${CMAKE_SOURCE_DIR}/xTools.rc)
endif()
sak_add_executable(${app_name} ${APP_ASSISTANT_SOURCES})
@ -40,5 +40,5 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Base64)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Number)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/String)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Broadcast)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Filechecker)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/FileChecker)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/CRCCalculator)

View File

@ -1,6 +1,8 @@
set(APP_ASSISTANT_OWN_SOURCE ${CMAKE_SOURCE_DIR}/src/common/common/sakcrcinterface.h
${CMAKE_SOURCE_DIR}/src/common/common/sakcrcinterface.cc)
set(APP_ASSISTANT_OWN_SOURCE ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsCrcInterface.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsCrcInterface.cpp)
set(APP_ASSISTANT_OWN_LIBS Qt${QT_VERSION_MAJOR}::Widgets)
sak_add_assistant("crc" "CrcAssistant")
sak_3rd_setup_glog(CrcAssistant)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Source)
x_tools_add_assistant("CRCCalculator" "CrcAssistant")
x_tools_3rd_setup_glog(CrcAssistant)

View File

@ -6,11 +6,11 @@
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* code directory.
**************************************************************************************************/
#include "sakcrcassistant.h"
#include "sakui.h"
#include "xToolsCRCCalculatorAssistant.h"
#include "xToolsUi.h"
int main(int argc, char* argv[])
{
const QString appName = QObject::tr("CRC Assistant");
return sakExec<SAKCRCAssistant>(argc, argv, appName);
return sakExec<xToolsCRCCalculatorAssistant>(argc, argv, appName);
}

View File

@ -1,5 +1,7 @@
set(APP_ASSISTANT_OWN_SOURCE "")
set(APP_ASSISTANT_OWN_LIBS Qt${QT_VERSION_MAJOR}::Widgets)
sak_add_assistant("filecheck" "FileCheckAssistant")
sak_3rd_setup_glog(FileCheckAssistant)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Source)
x_tools_add_assistant("FileChecker" "FileCheckAssistant")
x_tools_3rd_setup_glog(FileCheckAssistant)

View File

@ -6,11 +6,11 @@
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* code directory.
**************************************************************************************************/
#include "sakfilecheckassistant.h"
#include "sakui.h"
#include "xToolsFileCheckerAssistant.h"
#include "xToolsUi.h"
int main(int argc, char* argv[])
{
const QString appName = QObject::tr("File Check Assistant");
return sakExec<SAKFileCheckAssistant>(argc, argv, appName);
return sakExec<xToolsFileCheckerAssistant>(argc, argv, appName);
}

View File

@ -1,6 +1,8 @@
set(APP_ASSISTANT_OWN_SOURCE ${CMAKE_SOURCE_DIR}/src/common/common/sakinterface.h
${CMAKE_SOURCE_DIR}/src/common/common/sakinterface.cc)
set(APP_ASSISTANT_OWN_SOURCE "")
# ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsInterface.h ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsInterface.cpp
set(APP_ASSISTANT_OWN_LIBS Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network)
sak_add_assistant("number" "NumberAssistant")
sak_3rd_setup_glog(NumberAssistant)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Source)
x_tools_add_assistant("Number" "NumberAssistant")
x_tools_3rd_setup_glog(NumberAssistant)

View File

@ -6,11 +6,11 @@
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* code directory.
**************************************************************************************************/
#include "saknumberassistant.h"
#include "sakui.h"
#include "xToolsNumberAssistant.h"
#include "xToolsUi.h"
int main(int argc, char* argv[])
{
const QString appName = QObject::tr("Number Assistant");
return sakExec<SAKNumberAssistant>(argc, argv, appName);
return sakExec<xToolsNumberAssistant>(argc, argv, appName);
}

View File

@ -1,6 +1,8 @@
set(APP_ASSISTANT_OWN_SOURCE ${CMAKE_SOURCE_DIR}/src/common/commonui/sakcommonmainwindow.h
${CMAKE_SOURCE_DIR}/src/common/commonui/sakcommonmainwindow.cc)
set(APP_ASSISTANT_OWN_SOURCE ${CMAKE_SOURCE_DIR}/Source/Common/CommonUI/xToolsMainWindow.h
${CMAKE_SOURCE_DIR}/Source/Common/CommonUI/xToolsMainWindow.cpp)
set(APP_ASSISTANT_OWN_LIBS Qt${QT_VERSION_MAJOR}::Widgets)
sak_add_assistant("ping" "PingAssistant")
sak_3rd_setup_glog(PingAssistant)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Source)
x_tools_add_assistant("Ping" "PingAssistant")
x_tools_3rd_setup_glog(PingAssistant)

View File

@ -6,11 +6,11 @@
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* code directory.
**************************************************************************************************/
#include "sakpingassistant.h"
#include "sakui.h"
#include "xToolsPingAssistant.h"
#include "xToolsUi.h"
int main(int argc, char *argv[])
{
const QString appName = QObject::tr("Ping Assistant");
return sakExec<SAKPingAssistant>(argc, argv, appName, false);
return sakExec<xToolsPingAssistant>(argc, argv, appName, false);
}

View File

@ -1,9 +1,11 @@
set(APP_ASSISTANT_OWN_SOURCE
${CMAKE_SOURCE_DIR}/src/common/common/sakcrcinterface.h
${CMAKE_SOURCE_DIR}/src/common/common/sakcrcinterface.cc
${CMAKE_SOURCE_DIR}/src/common/common/sakdatastructure.h
${CMAKE_SOURCE_DIR}/src/common/common/sakdatastructure.cc)
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsCrcInterface.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsCrcInterface.cpp
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsDataStructure.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsDataStructure.cpp)
set(APP_ASSISTANT_OWN_LIBS Qt${QT_VERSION_MAJOR}::Widgets)
sak_add_assistant("string" "StringAssistant")
sak_3rd_setup_glog(StringAssistant)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Source)
x_tools_add_assistant("String" "StringAssistant")
x_tools_3rd_setup_glog(StringAssistant)

View File

@ -6,11 +6,11 @@
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* code directory.
**************************************************************************************************/
#include "sakstringassistant.h"
#include "sakui.h"
#include "xToolsStringAssistant.h"
#include "xToolsUi.h"
int main(int argc, char* argv[])
{
const QString appName = QObject::tr("String Assistant");
return sakExec<SAKStringAssistant>(argc, argv, appName);
return sakExec<xToolsStringAssistant>(argc, argv, appName);
}

View File

@ -1,7 +1,8 @@
set(APP_ASSISTANT_OWN_SOURCE "")
set(APP_ASSISTANT_OWN_LIBS Qt${QT_VERSION_MAJOR}::Widgets)
sak_add_assistant("mdns" "MDNSAssistant")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Source)
sak_3rd_setup_glog(MDNSAssistant)
sak_3rd_setup_qmdnsengine(MDNSAssistant)
x_tools_add_assistant("mDNS" "MDNSAssistant")
x_tools_3rd_setup_glog(MDNSAssistant)
x_tools_3rd_setup_qmdnsengine(MDNSAssistant)

View File

@ -1,16 +0,0 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* code directory.
**************************************************************************************************/
#include "sakmdnsassistant.h"
#include "sakui.h"
int main(int argc, char* argv[])
{
const QString appName = QObject::tr("MDNS Assistant");
return sakExec<SAKMdnsAssistant>(argc, argv, appName);
}

View File

@ -0,0 +1,16 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* code directory.
**************************************************************************************************/
#include "xToolsMdnsAssistant.h"
#include "xToolsUi.h"
int main(int argc, char* argv[])
{
const QString appName = QObject::tr("mDNS Assistant");
return sakExec<xToolsMdnsAssistant>(argc, argv, appName);
}