add um and shared includ
This commit is contained in:
parent
94c19cf117
commit
8fd78ae625
@ -1,3 +1,6 @@
|
||||
message(STATUS "CMAKE_SIZEOF_VOID_P: ${CMAKE_SIZEOF_VOID_P}")
|
||||
message(STATUS "CMAKE_LIBRARY_ARCHITECTURE: ${CMAKE_LIBRARY_ARCHITECTURE}")
|
||||
|
||||
# 设置CMake的最低版本要求
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
@ -6,6 +9,8 @@ project(WinDevice VERSION 0.1 LANGUAGES CXX)
|
||||
|
||||
# 允许 Windows 导出所有符号
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||
# 设置Windows相关配置
|
||||
set(CMAKE_GENERATOR_TOOLSET "v142")
|
||||
|
||||
# 设置C++标准
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
@ -30,7 +35,8 @@ endif()
|
||||
# DirectX目录
|
||||
set(Windows_Kits_DIR "C:\\Program Files (x86)\\Windows Kits\\10")
|
||||
set(Windows_Kits_Version "10.0.19041.0")
|
||||
set(DirectX_SDK_INCLUDE_DIR "${Windows_Kits_DIR}\\Include\\${Windows_Kits_Version}\\um")
|
||||
set(Windows_Kits_UM_DIR "${Windows_Kits_DIR}\\Include\\${Windows_Kits_Version}\\um")
|
||||
set(Windows_Kits_SHARED_DIR "${Windows_Kits_DIR}\\Include\\${Windows_Kits_Version}\\shared")
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# 64-bit 架构
|
||||
@ -63,7 +69,8 @@ target_include_directories(WinDevice
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
|
||||
PRIVATE
|
||||
${DirectX_SDK_INCLUDE_DIR}
|
||||
${Windows_Kits_UM_DIR}
|
||||
${Windows_Kits_SHARED_DIR}
|
||||
${Third_Include_DIR}
|
||||
)
|
||||
# 链接 d3d 的 lib
|
||||
@ -81,7 +88,7 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_executable(WinDeviceTest "src/main.cpp" ${SOURCE_FILES})
|
||||
target_include_directories(WinDeviceTest
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src>
|
||||
PRIVATE ${Third_Include_DIR} ${DirectX_SDK_INCLUDE_DIR})
|
||||
PRIVATE ${Third_Include_DIR} ${Windows_Kits_UM_DIR} ${Windows_Kits_SHARED_DIR})
|
||||
target_link_libraries(WinDeviceTest PRIVATE ${DirectX_LIBS})
|
||||
else()
|
||||
# Release 模式下的配置
|
||||
|
Loading…
Reference in New Issue
Block a user