-
Notifications
You must be signed in to change notification settings - Fork 54
/
CMakeLists.txt
108 lines (83 loc) · 2.66 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
106
107
cmake_minimum_required(VERSION 3.5)
include(external/GitInfoHelper.cmake)
get_git_version(OBS_PLUGUN_GIT_TAG OBS_PLUGUIN_VERSION OBS_PLUGUIN_SHORT_VERSION OBS_PLUGUIN_LONG_VERSION)
project(obs-rtspserver VERSION ${OBS_PLUGUIN_LONG_VERSION}
HOMEPAGE_URL "https://obsproject.com/forum/resources/obs-rtspserver.1037"
DESCRIPTION "RTSP server plugin for obs-studio")
set(LINUX_MAINTAINER_EMAIL "[email protected]")
set(LINUX_MAINTAINER "Scott Xu")
set(MACOS_BUNDLEID "com.scottxu.obs-rtspserver")
set(OBS_PLUGIN_OBS_SOURCE_DIR ${CMAKE_SOURCE_DIR})
set(OBS_FRONTEND_API_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/UI/obs-frontend-api")
add_library(${CMAKE_PROJECT_NAME} MODULE)
if (NOT COMMAND setup_plugin_target)
include(external/BuildHelper.cmake)
endif()
add_subdirectory(rtsp-server)
if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()
#set(CMAKE_AUTOMOC ON)
#set(CMAKE_AUTOUIC ON)
set(OBS_RTSPSERVER_SOURCES
rtsp_main.cpp
rtsp_output.cpp
rtsp_properties.cpp
rtsp_output_helper.cpp
)
set(OBS_RTSPSERVER_HEADERS
rtsp_output.h
rtsp_properties.h
rtsp_output_helper.h
)
file(GLOB OBS_RTSPSERVER_UI_SOURCES
ui/*.cpp)
file(GLOB OBS_RTSPSERVER_MAIN_SOURCES
*.cpp)
set(OBS_RTSPSERVER_SOURCES
${OBS_RTSPSERVER_UI_SOURCES}
${OBS_RTSPSERVER_MAIN_SOURCES}
)
file(GLOB OBS_RTSPSERVER_UI_HEADERS
ui/*.hpp)
file(GLOB OBS_RTSPSERVER_MAIN_HEADERS
*.h)
set(OBS_RTSPSERVER_HEADERS
${OBS_RTSPSERVER_UI_HEADERS}
${OBS_RTSPSERVER_MAIN_HEADERS}
)
set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 17)
set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY C_STANDARD 17)
find_qt(COMPONENTS Widgets Core)
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES AUTOMOC ON AUTOUIC ON AUTORCC ON)
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
${OBS_RTSPSERVER_SOURCES}
${OBS_RTSPSERVER_HEADERS})
if(WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rtspoutput.rc.in ${CMAKE_CURRENT_SOURCE_DIR}/rtspoutput.rc)
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/rtspoutput.rc)
endif()
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
${OBS_FRONTEND_API_INCLUDE_DIRS}
${LIBOBS_INCLUDE_DIRS}
"rtsp-server")
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE
rtsp-server
obs-frontend-api
libobs
Qt::Core
Qt::Widgets)
add_definitions(-DVERSION_STRING="${OBS_PLUGUIN_VERSION}")
if(APPLE)
set_target_properties(${CMAKE_PROJECT_NAME}
PROPERTIES
FOLDER "plugins"
PRODUCTNAME "OBS RTSP Server Plugin")
else()
set_target_properties(${CMAKE_PROJECT_NAME}
PROPERTIES
FOLDER "plugins"
VERSION "${OBS_PLUGUIN_VERSION}"
PRODUCTNAME "OBS RTSP Server Plugin")
endif()
setup_plugin_target(${CMAKE_PROJECT_NAME})