添加演示demo项目

This commit is contained in:
DevWiki 2023-10-30 16:44:02 +08:00
parent ac0eca92a9
commit 0b683b9a8e
4 changed files with 36 additions and 8 deletions

1
.gitignore vendored
View File

@ -79,3 +79,4 @@ CMakeLists.txt.user*
*/out */out
*/lib */lib
*/cmake* */cmake*
*/build

View File

@ -27,6 +27,15 @@ if (ENABLE_UTF8_SOURCE)
endif() endif()
endif() endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
# Debug
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG")
set(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/build/debug/lib")
else()
# Release
set(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/build/release/lib")
endif()
# 使 # 使
file(GLOB PROJECT_SOURCES file(GLOB PROJECT_SOURCES
src/*.cpp src/*.cpp
@ -54,13 +63,8 @@ target_include_directories(WinDevice PRIVATE
src src
) )
# WinDevice target_include_directories(WinDevice PUBLIC "${CMAKE_SOURCE_DIR}/src")
set(LIB_OUTPUT_DIR "${CMAKE_SOURCE_DIR}/lib") target_include_directories(WinDevice PRIVATE "${CMAKE_SOURCE_DIR}/include/third_lib")
#
set_target_properties(WinDevice PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR} #
LIBRARY_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR} #
)
# "install" # "install"
set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/install") set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/install")
@ -72,5 +76,4 @@ install(TARGETS WinDevice
) )
target_link_libraries(WinDevice PRIVATE dxguid) target_link_libraries(WinDevice PRIVATE dxguid)
target_compile_definitions(WinDevice PRIVATE -DWINDEVICE_EXPORTS) target_compile_definitions(WinDevice PRIVATE -DWINDEVICE_EXPORTS)

View File

@ -0,0 +1,16 @@
// WinDeviceDemo.cpp: 定义应用程序的入口点。
//
#include "WinDeviceDemo.h"
#include "Video/ScreenManager.h"
using namespace std;
int main()
{
cout << "Hello CMake." << endl;
ScreenManager screenManager;
screenManager.UpdateDisplayInfo();
return 0;
}

View File

@ -0,0 +1,8 @@
// WinDeviceDemo.h: 标准系统包含文件的包含文件
// 或项目特定的包含文件。
#pragma once
#include <iostream>
// TODO: 在此处引用程序需要的其他标头。