From 2d9ae52f4837998b93b4f468d28134336cba8157 Mon Sep 17 00:00:00 2001 From: DevWiki Date: Thu, 26 Sep 2024 16:08:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BE=93=E5=87=BA=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WinDevice/CMakeLists.txt | 13 +++++++++++-- WinDevice/src/main.cpp | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/WinDevice/CMakeLists.txt b/WinDevice/CMakeLists.txt index 37aaf23..57c3577 100644 --- a/WinDevice/CMakeLists.txt +++ b/WinDevice/CMakeLists.txt @@ -10,7 +10,7 @@ project(WinDevice VERSION 0.1 LANGUAGES CXX) # 允许 Windows 导出所有符号 set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) # 设置Windows相关配置 -set(CMAKE_GENERATOR_TOOLSET "v142") +set(CMAKE_GENERATOR_TOOLSET "v143") if (NOT DEFINED CMAKE_GENERATOR_PLATFORM) if (CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -85,7 +85,7 @@ target_include_directories(WinDevice target_link_libraries(WinDevice PRIVATE ${DirectX_LIBS}) # 创建 output 目录 -set(OUTPUT_DIR ${CMAKE_SOURCE_DIR}/output) +set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/output) file(MAKE_DIRECTORY ${OUTPUT_DIR}) set_target_properties(WinDevice PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/debug" @@ -107,6 +107,15 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug") PUBLIC $ PRIVATE ${Third_Include_DIR} ${Windows_Kits_UM_DIR} ${Windows_Kits_SHARED_DIR}) 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() # Release 模式下的配置 set(LIBRARY_OUTPUT_PATH "${OUTPUT_DIR}/release") diff --git a/WinDevice/src/main.cpp b/WinDevice/src/main.cpp index bf53b39..d5076bc 100644 --- a/WinDevice/src/main.cpp +++ b/WinDevice/src/main.cpp @@ -1,8 +1,12 @@ // // Created by zyz on 2023/12/20. // +#include #include "Video/ScreenManager.h" int main() { ScreenManager screenManager; screenManager.UpdateDisplayInfo(); + std::cout << "Press Enter to exit..." << std::endl; // 输出提示信息 + std::cin.get(); // 等待用户输入 + return 0; } \ No newline at end of file