-
Notifications
You must be signed in to change notification settings - Fork 209
/
CMakeLists.txt
71 lines (57 loc) · 2.05 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
66
67
68
69
70
71
cmake_minimum_required(VERSION 3.20)
project(win-capture-audio VERSION 2.2.3)
set(PLUGIN_AUTHOR "bozbez")
set(RELEASE_DIR "${PROJECT_SOURCE_DIR}/release")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH_NAME "64bit")
else()
set(ARCH_NAME "32bit")
endif()
configure_file(
installer/installer.iss.in
../installer/installer.generated.iss
)
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
OUTPUT_VARIABLE GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
configure_file(
src/plugin-macros.hpp.in
${CMAKE_SOURCE_DIR}/src/plugin-macros.generated.hpp
)
find_package(libobs REQUIRED)
set(win-capture-audio_SOURCES
src/plugin.cpp
src/audio-capture.cpp
src/audio-capture-helper.cpp
src/session-monitor.cpp
src/mixer.cpp)
add_library(win-capture-audio MODULE ${win-capture-audio_SOURCES})
target_link_libraries(win-capture-audio libobs dwmapi psapi ksuser mmdevapi mfplat)
set_property(TARGET win-capture-audio PROPERTY CXX_STANDARD 23)
target_include_directories(win-capture-audio PUBLIC ${CMAKE_SOURCE_DIR}/deps/wil/include)
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
COMMAND if $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>==1 (
"${CMAKE_COMMAND}" -E make_directory
"${RELEASE_DIR}/data/obs-plugins/${CMAKE_PROJECT_NAME}"
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}"
)
COMMAND if $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>==1 (
"${CMAKE_COMMAND}" -E copy_directory
"${PROJECT_SOURCE_DIR}/data"
"${RELEASE_DIR}/data/obs-plugins/${CMAKE_PROJECT_NAME}"
)
COMMAND if $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>==1 (
"${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:${CMAKE_PROJECT_NAME}>"
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}"
)
COMMAND if $<CONFIG:RelWithDebInfo>==1 (
"${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE_BASE_NAME:${CMAKE_PROJECT_NAME}>.pdb"
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}"
)
VERBATIM
)