forked from obsproject/obs-studio
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
65 lines (51 loc) · 1.95 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
project(graphics-hook)
find_package(Detours REQUIRED)
find_package(Vulkan REQUIRED)
add_library(graphics-hook MODULE)
target_sources(
graphics-hook
PRIVATE graphics-hook.c
graphics-hook.h
gl-capture.c
gl-decs.h
d3d8-capture.cpp
d3d9-capture.cpp
d3d9-patches.hpp
dxgi-capture.cpp
d3d10-capture.cpp
d3d11-capture.cpp
d3d12-capture.cpp
../../../deps/ipc-util/ipc-util/pipe.h
../../../deps/ipc-util/ipc-util/pipe-windows.c
../../../libobs/util/windows/obfuscate.c
../../../libobs/util/windows/obfuscate.h
../graphics-hook-ver.h
../graphics-hook-info.h
../hook-helpers.h
graphics-hook.rc)
target_include_directories(graphics-hook
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
target_link_libraries(graphics-hook PRIVATE Detours::Detours dxguid)
target_link_options(graphics-hook PRIVATE "LINKER:/IGNORE:4099")
add_definitions(-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS)
if(MSVC)
target_compile_options(graphics-hook PRIVATE "$<IF:$<CONFIG:Debug>,/MTd,/MT>")
endif()
set_target_properties(
graphics-hook
PROPERTIES FOLDER "plugins/win-capture"
OUTPUT_NAME
"graphics-hook$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,64,32>")
target_compile_definitions(graphics-hook PRIVATE COMPILE_D3D12_HOOK)
if(TARGET Vulkan::Vulkan)
target_sources(graphics-hook PRIVATE vulkan-capture.c vulkan-capture.h)
target_link_libraries(graphics-hook PRIVATE Vulkan::Vulkan)
target_compile_definitions(graphics-hook PRIVATE COMPILE_VULKAN_HOOK)
add_target_resource(
graphics-hook "${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan64.json"
"obs-plugins/win-capture/")
add_target_resource(
graphics-hook "${CMAKE_CURRENT_SOURCE_DIR}/obs-vulkan32.json"
"obs-plugins/win-capture/")
endif()
set(OBS_PLUGIN_DESTINATION "${OBS_DATA_DESTINATION}/obs-plugins/win-capture/")