优化输出目录

This commit is contained in:
DevWiki 2024-09-26 16:08:35 +08:00
parent ef0798dc04
commit 2d9ae52f48
2 changed files with 15 additions and 2 deletions

View File

@ -10,7 +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 "v142") set(CMAKE_GENERATOR_TOOLSET "v143")
if (NOT DEFINED CMAKE_GENERATOR_PLATFORM) if (NOT DEFINED CMAKE_GENERATOR_PLATFORM)
if (CMAKE_SIZEOF_VOID_P EQUAL 8) if (CMAKE_SIZEOF_VOID_P EQUAL 8)
@ -85,7 +85,7 @@ target_include_directories(WinDevice
target_link_libraries(WinDevice PRIVATE ${DirectX_LIBS}) target_link_libraries(WinDevice PRIVATE ${DirectX_LIBS})
# output # output
set(OUTPUT_DIR ${CMAKE_SOURCE_DIR}/output) set(OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/output)
file(MAKE_DIRECTORY ${OUTPUT_DIR}) file(MAKE_DIRECTORY ${OUTPUT_DIR})
set_target_properties(WinDevice PROPERTIES set_target_properties(WinDevice PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/debug" ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIR}/debug"
@ -107,6 +107,15 @@ 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")

View File

@ -1,8 +1,12 @@
// //
// 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;
} }