适配Linux。
This commit is contained in:
parent
fd494f2a03
commit
798962e8bb
@ -6,7 +6,12 @@ set(APPLICATION_NAME "视觉防夹设备上位机工具")
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(Libraries_ROOT E:/Projects/Libraries CACHE STRING "Libraries directory.")
|
||||
if(LINUX)
|
||||
set(Libraries_ROOT /opt/Libraries CACHE STRING "Libraries directory.")
|
||||
else()
|
||||
set(Libraries_ROOT E:/Projects/Libraries CACHE STRING "Libraries directory.")
|
||||
endif()
|
||||
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Qml Quick Network QuickControls2)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Qml Quick Network QuickControls2)
|
||||
@ -24,7 +29,11 @@ else()
|
||||
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
if(LINUX)
|
||||
set(BOOST_ROOT ${Libraries_ROOT}/boost_1_83_0)
|
||||
else()
|
||||
set(BOOST_ROOT ${Libraries_ROOT}/boost_1_83_0_msvc2022_64bit)
|
||||
endif()
|
||||
set(Boost_INCLUDE_DIR ${BOOST_ROOT}/include/boost-1_83)
|
||||
set(FFmpeg_ROOT ${Libraries_ROOT}/ffmpeg-6.1.1-full_build-shared)
|
||||
endif()
|
||||
@ -39,8 +48,13 @@ set(FFmpeg_INCLUDE_DIR ${FFmpeg_ROOT}/include)
|
||||
set(FFmpeg_LIB_DIR ${FFmpeg_ROOT}/lib)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(JPEGTURBO_ROOT ${Libraries_ROOT}/libjpeg-turbo-3.0.3_msvc2022_64bit_debug)
|
||||
if(LINUX)
|
||||
set(MBEDTLS_ROOT ${Libraries_ROOT}/mbedtls-3.6.2)
|
||||
set(JPEGTURBO_ROOT ${Libraries_ROOT}/libjpeg-turbo-3.1.0)
|
||||
else()
|
||||
set(MBEDTLS_ROOT ${Libraries_ROOT}/mbedtls-3.6.2_msvc2022_64bit_debug)
|
||||
set(JPEGTURBO_ROOT ${Libraries_ROOT}/libjpeg-turbo-3.0.3_msvc2022_64bit_debug)
|
||||
endif()
|
||||
else()
|
||||
set(JPEGTURBO_ROOT ${Libraries_ROOT}/libjpeg-turbo-3.0.3_msvc2022_64bit_release)
|
||||
set(MBEDTLS_ROOT ${Libraries_ROOT}/mbedtls-3.6.2_msvc2022_64bit_release)
|
||||
@ -137,8 +151,9 @@ target_link_libraries(AntiClipSettings
|
||||
PRIVATE avformat
|
||||
PRIVATE Universal
|
||||
PRIVATE Encrypt
|
||||
PRIVATE turbojpeg-static
|
||||
PRIVATE Ws2_32
|
||||
$<$<PLATFORM_ID:Linux>:turbojpeg>
|
||||
$<$<PLATFORM_ID:Windows>:turbojpeg-static>
|
||||
$<$<PLATFORM_ID:Windows>:Ws2_32>
|
||||
)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
@ -5,13 +5,17 @@
|
||||
#include <QPointF>
|
||||
#include <QTimer>
|
||||
#include <QTimerEvent>
|
||||
#include <WinSock2.h>
|
||||
#include <boost/json/object.hpp>
|
||||
#include <boost/json/parse.hpp>
|
||||
#include <boost/json/serialize.hpp>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <mbedtls/md5.h>
|
||||
#ifdef Q_OS_LINUX
|
||||
#include <arpa/inet.h>
|
||||
#else
|
||||
#include <WinSock2.h>
|
||||
#endif
|
||||
|
||||
DeviceConnection::DeviceConnection(QObject *parent) : QObject{parent} {
|
||||
}
|
||||
|
@ -9,8 +9,10 @@
|
||||
#include <QTcpSocket>
|
||||
#include <queue>
|
||||
#include <string_view>
|
||||
#include <QPointF>
|
||||
|
||||
class NetworkInfomation;
|
||||
class QTimer;
|
||||
|
||||
class DeviceConnection : public QObject {
|
||||
Q_OBJECT
|
||||
|
Loading…
Reference in New Issue
Block a user