修改以解决引用问题
This commit is contained in:
parent
50298ad6e8
commit
3145ee0d7d
@ -15,11 +15,6 @@ add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/source-charset:utf-8>")
|
|||||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
|
||||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
|
||||||
|
|
||||||
# 添加sdplog目录
|
|
||||||
include_directories(include/third_lib)
|
|
||||||
|
|
||||||
# 添加WinDevice项目
|
|
||||||
add_subdirectory(../WinDevice WinDevice)
|
|
||||||
|
|
||||||
set(PROJECT_SOURCES
|
set(PROJECT_SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
@ -51,14 +46,17 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# 添加WinDevice项目
|
||||||
|
add_subdirectory(../WinDevice WinDevice)
|
||||||
|
|
||||||
target_link_libraries(DeviceManager PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
|
target_link_libraries(DeviceManager PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
|
||||||
# 链接WinDevice项目
|
# 链接WinDevice项目
|
||||||
|
target_link_libraries(DeviceManager PRIVATE WinDevice)
|
||||||
|
# 链接WinDevice项目
|
||||||
target_include_directories(DeviceManager PRIVATE
|
target_include_directories(DeviceManager PRIVATE
|
||||||
../WinDevice
|
include/third_lib
|
||||||
)
|
../WinDevice/src
|
||||||
# 将WinDevice项目的头文件路径添加到DeviceManager项目中
|
|
||||||
target_include_directories(DeviceManager PRIVATE
|
|
||||||
../WinDevice/src # 根据实际路径进行修改
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(DeviceManager PROPERTIES
|
set_target_properties(DeviceManager PROPERTIES
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
#include "Video/ScreenManager.h"
|
#include "Video/ScreenManager.h"
|
||||||
|
#include "Utils/CmdUtil.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -9,5 +11,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
w.show();
|
w.show();
|
||||||
|
// ScreenManager screen_manager;
|
||||||
|
// screen_manager.UpdateDisplayInfo();
|
||||||
|
CmdUtil::ExecuteCommand("ls");
|
||||||
|
spdlog::info("000");
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
@ -1,23 +1,48 @@
|
|||||||
|
# 设置CMake的最低版本要求
|
||||||
cmake_minimum_required(VERSION 3.12)
|
cmake_minimum_required(VERSION 3.12)
|
||||||
|
|
||||||
|
# 设置项目名称和版本,以及编程语言
|
||||||
project(WinDevice VERSION 0.1 LANGUAGES CXX)
|
project(WinDevice VERSION 0.1 LANGUAGES CXX)
|
||||||
|
|
||||||
set(CMAKE_AUTOUIC ON)
|
# 设置C++标准
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
set(CMAKE_AUTORCC ON)
|
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
# 设置源代码文件编码为UTF-8
|
# 添加源代码文件编码为UTF-8的选项,可选择启用或禁用
|
||||||
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/source-charset:utf-8>")
|
option(ENABLE_UTF8_SOURCE "Enable UTF-8 source code encoding" ON)
|
||||||
|
|
||||||
# 添加sdplog目录
|
# 如果启用了UTF-8源码编码选项
|
||||||
include_directories(include/third_lib)
|
if (ENABLE_UTF8_SOURCE)
|
||||||
|
# 如果是MSVC编译器
|
||||||
|
if (MSVC)
|
||||||
|
# 设置MSVC编译器的UTF-8源码编码选项
|
||||||
|
add_compile_options("/source-charset:utf-8")
|
||||||
|
# 如果是MinGW编译器
|
||||||
|
elseif (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
# 设置MinGW编译器的UTF-8源码编码选项
|
||||||
|
add_compile_options("-fexec-charset=UTF-8" "-finput-charset=UTF-8")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# 使用通配符自动列举源文件
|
||||||
|
file(GLOB WinDevice_SOURCES
|
||||||
|
"${CMAKE_SOURCE_DIR}/src/*.cpp"
|
||||||
|
"${CMAKE_SOURCE_DIR}/src/Audio/*.cpp"
|
||||||
|
"${CMAKE_SOURCE_DIR}/src/Video/*.cpp"
|
||||||
|
"${CMAKE_SOURCE_DIR}/src/Utils/*.cpp"
|
||||||
|
)
|
||||||
|
|
||||||
# 添加功能模块的源文件
|
# 添加功能模块的源文件
|
||||||
set(PROJECT_SOURCES
|
add_library(WinDevice ${WinDevice_SOURCES})
|
||||||
"src/Audio"
|
|
||||||
"src/Video"
|
# 设置WinDevice库的公共包含目录
|
||||||
"src/Utils"
|
target_include_directories(WinDevice PUBLIC
|
||||||
|
"${CMAKE_SOURCE_DIR}/src"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 设置WinDevice库的私有包含目录,包括第三方库和源码目录
|
||||||
|
set(THIRD_LIB_DIR ${CMAKE_SOURCE_DIR}/include/third_lib)
|
||||||
|
target_include_directories(WinDevice PRIVATE
|
||||||
|
${THIRD_LIB_DIR}
|
||||||
|
"${CMAKE_SOURCE_DIR}/src"
|
||||||
|
)
|
@ -110,7 +110,7 @@ void SysInfoUtil::GetInfoByEdid()
|
|||||||
wcout << L"SerialNumberID =" << pwsSerialNumberID << endl;
|
wcout << L"SerialNumberID =" << pwsSerialNumberID << endl;
|
||||||
// swprintf(wsText, L"Serial Number ID = %s\r\n", pwsSerialNumberID);
|
// swprintf(wsText, L"Serial Number ID = %s\r\n", pwsSerialNumberID);
|
||||||
OutputDebugString(wsText);
|
OutputDebugString(wsText);
|
||||||
|
|
||||||
if (!pWmiAllData->WnodeHeader.Linkage)
|
if (!pWmiAllData->WnodeHeader.Linkage)
|
||||||
break;
|
break;
|
||||||
pAllDataBuffer += pWmiAllData->WnodeHeader.Linkage;
|
pAllDataBuffer += pWmiAllData->WnodeHeader.Linkage;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
ScreenManager::ScreenManager()
|
ScreenManager::ScreenManager()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScreenManager::~ScreenManager()
|
ScreenManager::~ScreenManager()
|
||||||
|
Loading…
Reference in New Issue
Block a user