console: basic code.

This commit is contained in:
2025-06-17 12:00:46 +08:00
parent 55b530d9f8
commit 4b86ebc5c5
6 changed files with 47 additions and 1 deletions

17
Console/CMakeLists.txt Normal file
View File

@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.16)
project(frelayConsole LANGUAGES CXX)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Network)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network)
add_executable(frelayConsole Console.h Console.cpp main.cpp ../Res/ico.rc)
target_link_libraries(frelayConsole PRIVATE Protocol Util)
target_link_libraries(frelayConsole PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network)

1
Console/Console.cpp Normal file
View File

@@ -0,0 +1 @@
#include "Console.h"

9
Console/Console.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef FRELAY_CONSOLE_H
#define FRELAY_CONSOLE_H
class RelayConsole
{
};
#endif // FRELAY_CONSOLE_H

14
Console/main.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include <QCoreApplication>
#include "Console.h"
#include <Util.h>
int main(int argc, char* argv[])
{
QCoreApplication app(argc, argv);
Util::InitLogger("frelayConsole.log", "frelayConsole");
qInstallMessageHandler(Util::ConsoleMsgHander);
return app.exec();
}