优化输出目录
This commit is contained in:
parent
ef0798dc04
commit
2d9ae52f48
@ -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 $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
|
||||
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")
|
||||
|
@ -1,8 +1,12 @@
|
||||
//
|
||||
// Created by zyz on 2023/12/20.
|
||||
//
|
||||
#include <iostream>
|
||||
#include "Video/ScreenManager.h"
|
||||
int main() {
|
||||
ScreenManager screenManager;
|
||||
screenManager.UpdateDisplayInfo();
|
||||
std::cout << "Press Enter to exit..." << std::endl; // 输出提示信息
|
||||
std::cin.get(); // 等待用户输入
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user