Compare commits
No commits in common. "9371d67b0085fbfeac7f59ef66c1bbc109a927b1" and "8fd78ae6256a7d2d9822a818c8d14ff801e4b16a" have entirely different histories.
9371d67b00
...
8fd78ae625
@ -10,15 +10,7 @@ project(WinDevice VERSION 0.1 LANGUAGES CXX)
|
|||||||
# 允许 Windows 导出所有符号
|
# 允许 Windows 导出所有符号
|
||||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||||
# 设置Windows相关配置
|
# 设置Windows相关配置
|
||||||
set(CMAKE_GENERATOR_TOOLSET "v143")
|
set(CMAKE_GENERATOR_TOOLSET "v142")
|
||||||
|
|
||||||
if (NOT DEFINED CMAKE_GENERATOR_PLATFORM)
|
|
||||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
||||||
set(CMAKE_GENERATOR_PLATFORM x64)
|
|
||||||
else()
|
|
||||||
set(CMAKE_GENERATOR_PLATFORM x86)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# 设置C++标准
|
# 设置C++标准
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
@ -85,25 +77,8 @@ target_include_directories(WinDevice
|
|||||||
target_link_libraries(WinDevice PRIVATE ${DirectX_LIBS})
|
target_link_libraries(WinDevice PRIVATE ${DirectX_LIBS})
|
||||||
|
|
||||||
# 创建 output 目录
|
# 创建 output 目录
|
||||||
set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/output)
|
set(OUTPUT_DIR ${CMAKE_SOURCE_DIR}/output)
|
||||||
# 获取架构信息
|
file(MAKE_DIRECTORY ${OUTPUT_DIR})
|
||||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
||||||
set(ARCH_DIR "x64")
|
|
||||||
else()
|
|
||||||
set(ARCH_DIR "x86")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# 创建架构特定的输出目录
|
|
||||||
file(MAKE_DIRECTORY ${OUTPUT_DIR}/${ARCH_DIR})
|
|
||||||
set_target_properties(WinDevice PROPERTIES
|
|
||||||
ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/${ARCH_DIR}/debug"
|
|
||||||
LIBRARY_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/${ARCH_DIR}/debug"
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/${ARCH_DIR}/debug"
|
|
||||||
|
|
||||||
ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/${ARCH_DIR}/release"
|
|
||||||
LIBRARY_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/${ARCH_DIR}/release"
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/${ARCH_DIR}/release"
|
|
||||||
)
|
|
||||||
|
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
# Debug 模式下的配置
|
# Debug 模式下的配置
|
||||||
@ -115,15 +90,6 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|||||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
|
||||||
PRIVATE ${Third_Include_DIR} ${Windows_Kits_UM_DIR} ${Windows_Kits_SHARED_DIR})
|
PRIVATE ${Third_Include_DIR} ${Windows_Kits_UM_DIR} ${Windows_Kits_SHARED_DIR})
|
||||||
target_link_libraries(WinDeviceTest PRIVATE ${DirectX_LIBS})
|
target_link_libraries(WinDeviceTest PRIVATE ${DirectX_LIBS})
|
||||||
set_target_properties(WinDeviceTest PROPERTIES
|
|
||||||
ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/debug"
|
|
||||||
LIBRARY_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/debug"
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/debug"
|
|
||||||
|
|
||||||
ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/release"
|
|
||||||
LIBRARY_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/release"
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIR}/release"
|
|
||||||
)
|
|
||||||
else()
|
else()
|
||||||
# Release 模式下的配置
|
# Release 模式下的配置
|
||||||
set(LIBRARY_OUTPUT_PATH "${OUTPUT_DIR}/release")
|
set(LIBRARY_OUTPUT_PATH "${OUTPUT_DIR}/release")
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
//
|
//
|
||||||
// Created by zyz on 2023/12/20.
|
// Created by zyz on 2023/12/20.
|
||||||
//
|
//
|
||||||
#include <iostream>
|
|
||||||
#include "Video/ScreenManager.h"
|
#include "Video/ScreenManager.h"
|
||||||
int main() {
|
int main() {
|
||||||
ScreenManager screenManager;
|
ScreenManager screenManager;
|
||||||
screenManager.UpdateDisplayInfo();
|
screenManager.UpdateDisplayInfo();
|
||||||
std::cout << "Press Enter to exit..." << std::endl; // 输出提示信息
|
|
||||||
std::cin.get(); // 等待用户输入
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user