generated from obsproject/obs-plugintemplate
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
148 lines (120 loc) · 5.29 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
cmake_minimum_required(VERSION 3.20)
cmake_policy(SET CMP0111 OLD)
project(RewardsTheater VERSION 1.0.6)
add_library(${CMAKE_PROJECT_NAME} MODULE)
# Replace `Your Name Here` with the name (yours or your organization's) you want to see as the
# author of the plugin (in the plugin's metadata itself and in the installers)
set(PLUGIN_AUTHOR "gottagofaster")
# Replace 'https://www.example.com` with a link to the website of your plugin or repository
set(PLUGIN_WEBSITE "https://github.com/gottagofaster236/RewardsTheater")
# Replace `com.example.obs-plugin-template` with a unique Bundle ID for macOS releases (used both in
# the installer and when submitting the installer for notarization)
set(MACOS_BUNDLEID "com.gottagofaster.RewardsTheater")
# Replace `me@contoso.com` with the maintainer email address you want to put in Linux packages
set(LINUX_MAINTAINER_EMAIL "lr.soft.now@gmail.com")
set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 20)
set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
# Add your custom source files here - header files are optional and only required for visibility
# e.g. in Xcode or Visual Studio
target_sources(
${CMAKE_PROJECT_NAME}
PRIVATE images/icons.qrc
src/RewardsTheaterMain.cpp
src/SettingsDialog.cpp
src/SettingsDialog.h
src/TwitchAuth.cpp
src/TwitchAuth.h
src/Reward.h
src/Reward.cpp
src/RewardRedemptionQueue.h
src/RewardRedemptionQueue.cpp
src/TwitchRewardsApi.h
src/TwitchRewardsApi.cpp
src/TwitchAuthDialog.cpp
src/TwitchAuthDialog.h
src/RewardsTheaterPlugin.cpp
src/RewardsTheaterPlugin.h
src/Settings.h
src/Settings.cpp
src/HttpClient.h
src/HttpClient.cpp
src/Log.h
src/BoostAsio.h
src/IoThreadPool.h
src/IoThreadPool.cpp
src/EditRewardDialog.h
src/EditRewardDialog.cpp
src/RewardWidget.h
src/RewardWidget.cpp
src/GithubUpdateApi.h
src/GithubUpdateApi.cpp
src/ErrorMessageBox.h
src/ErrorMessageBox.cpp
src/ConfirmDeleteReward.h
src/ConfirmDeleteReward.cpp
src/PubsubListener.h
src/PubsubListener.cpp
src/RewardRedemptionWidget.h
src/RewardRedemptionWidget.cpp
src/RewardRedemptionQueueDialog.h
src/RewardRedemptionQueueDialog.cpp
src/QObjectCallback.h)
# GCC ignores the "pragma GCC diagnostic ignored" in precompiled headers
if(MSVC)
target_precompile_headers(${CMAKE_PROJECT_NAME} PRIVATE src/BoostAsio.h)
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE /bigobj)
endif()
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
# Libraries from vcpkg
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED COMPONENTS system url json)
find_package(OpenSSL REQUIRED)
find_package(fmt REQUIRED)
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${Boost_INCLUDE_DIRS})
target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC Boost::system Boost::url Boost::json
OpenSSL::SSL OpenSSL::Crypto fmt::fmt)
# Import libobs as main plugin dependency
find_package(libobs REQUIRED)
include(cmake/ObsPluginHelpers.cmake)
find_package(obs-frontend-api REQUIRED)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::obs-frontend-api)
find_qt(COMPONENTS Core Widgets Gui)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt::Core Qt::Widgets Qt::Gui)
set_target_properties(
${CMAKE_PROJECT_NAME}
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON)
configure_file(src/RewardsTheaterVersion.h.in
${CMAKE_SOURCE_DIR}/src/RewardsTheaterVersion.generated.h)
target_sources(${CMAKE_PROJECT_NAME} PRIVATE src/RewardsTheaterVersion.generated.h)
# /!\ TAKE NOTE: No need to edit things past this point /!\
# --- Platform-independent build settings ---
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::libobs)
# --- End of section ---
# --- Windows-specific build settings and tasks ---
if(OS_WINDOWS)
configure_file(cmake/bundle/windows/installer-Windows.iss.in
${CMAKE_BINARY_DIR}/installer-Windows.generated.iss)
configure_file(cmake/bundle/windows/resource.rc.in ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc)
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc)
if(MSVC)
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE /W4)
endif()
# --- End of section ---
# -- macOS specific build settings and tasks --
elseif(OS_MACOS)
configure_file(cmake/bundle/macos/installer-macos.pkgproj.in
${CMAKE_BINARY_DIR}/installer-macos.generated.pkgproj)
set(MACOSX_PLUGIN_GUI_IDENTIFIER "${MACOS_BUNDLEID}")
set(MACOSX_PLUGIN_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION}")
set(MACOSX_PLUGIN_SHORT_VERSION_STRING "1")
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall)
# --- End of section ---
# --- Linux-specific build settings and tasks ---
else()
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall)
endif()
# --- End of section ---
setup_plugin_target(${CMAKE_PROJECT_NAME})