add linux.

This commit is contained in:
amass 2024-09-03 23:30:45 +08:00
parent c7c24e9388
commit 239cb2d10f
6 changed files with 38 additions and 14 deletions

View File

@ -6,7 +6,6 @@
#include "Configuration.h"
#include "Database.h"
#include "DateTime.h"
#include "DeviceDiscovery.h"
#include "ImageDecoder.h"
#include "StringUtility.h"
#include "VideoFrameProvider.h"
@ -21,6 +20,9 @@
#include <filesystem>
#include <fstream>
#include <mbedtls/md5.h>
#ifdef WIN32
#include "DeviceDiscovery.h"
#endif
constexpr uint32_t ImageSliceSize = (4000 - 32);
@ -113,11 +115,13 @@ QStringList Application::availableSerialPorts() const {
QStringList Application::availableUsbVideoCameras() const {
QStringList ret;
#ifdef WIN32
DeviceDiscovery d;
auto devices = d.devices();
for (auto &device : devices) {
ret << QString::fromStdString(device);
}
#endif
return ret;
}

View File

@ -1,9 +1,11 @@
#include "ModuleCommunication.h"
#include "BoostLog.h"
#include "StringUtility.h"
#include <WinSock2.h>
#include <mbedtls/md5.h>
#include <sstream>
#ifdef WIN32
#include <WinSock2.h>
#endif
static inline uint8_t xor_checksum_byte(const uint8_t *data, uint32_t len) {
uint8_t sum = 0;

View File

@ -5,15 +5,28 @@ project(SmartLockerTools VERSION 0.1 LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(Projects_ROOT E:/Projects)
set(Libraries_ROOT ${Projects_ROOT}/Libraries)
if(WIN32)
set(Projects_ROOT E:/Projects)
set(Libraries_ROOT ${Projects_ROOT}/Libraries)
set(BOOST_ROOT ${Libraries_ROOT}/boost_1_86_0_msvc2022_64bit)
set(Boost_INCLUDE_DIR ${BOOST_ROOT}/include/boost-1_86)
add_compile_definitions(
BOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_WIN10
)
else()
execute_process(
COMMAND sh -c "echo $HOME"
OUTPUT_VARIABLE USER_HOME
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(Projects_ROOT ${USER_HOME}/Projects)
set(Libraries_ROOT /opt/Libraries)
set(BOOST_ROOT ${Libraries_ROOT}/boost_1_86_0)
set(Boost_INCLUDE_DIR ${BOOST_ROOT}/include)
endif()
set(BOOST_ROOT ${Libraries_ROOT}/boost_1_86_0_msvc2022_64bit)
set(Boost_INCLUDE_DIR ${BOOST_ROOT}/include/boost-1_86)
option(Boost_USE_STATIC_LIBS OFF)
add_compile_definitions(
BOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_WIN10
)
set(FFmpeg_ROOT ${Libraries_ROOT}/ffmpeg-7.0.1-full_build-shared)
set(FFmpeg_INCLUDE_DIR ${FFmpeg_ROOT}/include)
@ -25,11 +38,15 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)
add_subdirectory(${Projects_ROOT}/Kylin/Universal Universal)
add_subdirectory(${Projects_ROOT}/Kylin/Encrypt Encrypt)
add_subdirectory(${Projects_ROOT}/Kylin/Fluent Fluent)
include(FetchContent)
FetchContent_Declare(Kylin
GIT_REPOSITORY https://gitea.amass.fun/amass/Kylin.git
)
FetchContent_MakeAvailable(Kylin)
add_subdirectory(Peripheral)
add_subdirectory(Database)
add_subdirectory(Analyser)
add_subdirectory(OtaUpdate)
if(WIN32)
add_subdirectory(OtaUpdate)
endif()

View File

@ -3,6 +3,7 @@
#include <string>
#include <vector>
#include <cstdint>
class PalmFeature {
public:

View File

@ -4,7 +4,7 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS SerialPort)
set(CMAKE_AUTOMOC ON)
add_library(Peripheral
DeviceDiscovery.h DeviceDiscovery.cpp
$<$<PLATFORM_ID:Windows>:DeviceDiscovery.h DeviceDiscovery.cpp>
CdcUpdater.h CdcUpdater.cpp
)