添加演示demo项目
This commit is contained in:
parent
ac0eca92a9
commit
0b683b9a8e
1
.gitignore
vendored
1
.gitignore
vendored
@ -79,3 +79,4 @@ CMakeLists.txt.user*
|
|||||||
*/out
|
*/out
|
||||||
*/lib
|
*/lib
|
||||||
*/cmake*
|
*/cmake*
|
||||||
|
*/build
|
||||||
|
@ -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)
|
||||||
|
16
WinDeviceDemo/WinDeviceDemo.cpp
Normal file
16
WinDeviceDemo/WinDeviceDemo.cpp
Normal 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;
|
||||||
|
}
|
8
WinDeviceDemo/WinDeviceDemo.h
Normal file
8
WinDeviceDemo/WinDeviceDemo.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// WinDeviceDemo.h: 标准系统包含文件的包含文件
|
||||||
|
// 或项目特定的包含文件。
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
// TODO: 在此处引用程序需要的其他标头。
|
Loading…
Reference in New Issue
Block a user