forked from Andersama/obs-asio
/
CMakeLists.txt
105 lines (85 loc) · 2.79 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
cmake_minimum_required(VERSION 3.5)
project(obs-asio)
# in cmake gui set the following:
# BASS_ASIO_LIB == path of bassasio.lib
# BASS_ASIO_INCLUDE_DIR == path of bassasio.h
# put also bassasio.dll in obs-plugins/bin folder
# be careful there are two versions of the lib and dll (x86 and x64)
##########################################
# find libobs #
##########################################
include(external/FindLibobs.cmake)
find_package(Libobs REQUIRED)
##########################################
# set architecture #
##########################################
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(ARCH 64)
else()
set(ARCH 32)
endif()
if(ARCH EQUAL 64)
set(OBS_ARCH_NAME "64bit")
set(OBS_BUILDDIR_ARCH "build64")
else()
set(OBS_ARCH_NAME "32bit")
set(OBS_BUILDDIR_ARCH "build32")
endif()
##########################################
# QT support #
##########################################
# Find includes in corresponding build directories
#set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
#set(CMAKE_AUTOMOC ON)
# Find the QtWidgets library
#find_package(Qt5Widgets)
include_directories(
# SYSTEM "${CMAKE_SOURCE_DIR}/libobs"
${BASS_ASIO_INCLUDE_DIR}
)
set(obs-asio-sdk_HEADERS
)
set(obs-asio_HEADERS
)
set(obs-asio_SOURCES
src/asio-input.cpp
)
add_library(obs-asio MODULE
${obs-asio_SOURCES}
${obs-asio_HEADERS}
${obs-asio-sdk_HEADERS}
)
target_link_libraries(obs-asio
libobs
${BASS_ASIO_LIB}
)
#install_obs_plugin_with_data(win-asio data) ==> internal plugin install
#install_external_plugin_with_data(obs-asio data)
set(RELEASE_DIR "${PROJECT_SOURCE_DIR}/release")
add_custom_command(TARGET obs-asio POST_BUILD
COMMAND if $<CONFIG:Release>==1 (
"${CMAKE_COMMAND}" -E make_directory
"${RELEASE_DIR}/data/obs-plugins/obs-asio"
"${RELEASE_DIR}/obs-plugins/${OBS_ARCH_NAME}")
COMMAND if $<CONFIG:Release>==1 (
"${CMAKE_COMMAND}" -E copy_directory
"${PROJECT_SOURCE_DIR}/src/data"
"${RELEASE_DIR}/data/obs-plugins/obs-asio")
COMMAND if $<CONFIG:Release>==1 (
"${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:obs-asio>"
"${RELEASE_DIR}/obs-plugins/${OBS_ARCH_NAME}")
#Copy to obs-studio dev environment for immediate testing
COMMAND if $<CONFIG:Debug>==1 (
"${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:obs-asio>"
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/obs-plugins/${OBS_ARCH_NAME}")
COMMAND if $<CONFIG:Debug>==1 (
"${CMAKE_COMMAND}" -E make_directory
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/obs-asio")
COMMAND if $<CONFIG:Debug>==1 (
"${CMAKE_COMMAND}" -E copy_directory
"${PROJECT_SOURCE_DIR}/data"
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/obs-asio")
)