Skip to content

Commit 2b01c0a

Browse files
committed
0.25.3
1 parent c5f126c commit 2b01c0a

46 files changed

Lines changed: 1293 additions & 1608 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,10 @@
2727
# Exclude macOS legacy resource forks
2828
.DS_Store
2929

30-
# Exclude CMake build number cache
31-
/cmake/.CMakeBuildNumber
30+
31+
32+
# Exclude generated packages
33+
/packages
34+
35+
# Exclude dependency cache (now in build directories)
36+
/.deps

CMakeLists.txt

Lines changed: 138 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,138 @@
1-
cmake_minimum_required(VERSION 3.28...3.30)
2-
3-
include(./lib/atkaudio/cmake/preconfig.cmake)
4-
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/bootstrap.cmake")
5-
6-
project(${_name} VERSION ${_version})
7-
8-
option(ENABLE_FRONTEND_API "Use obs-frontend-api for UI functionality" OFF)
9-
option(ENABLE_QT "Use Qt functionality" OFF)
10-
11-
include(compilerconfig)
12-
include(defaults)
13-
include(helpers)
14-
15-
add_library(${CMAKE_PROJECT_NAME} MODULE)
16-
17-
find_package(libobs REQUIRED)
18-
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::libobs)
19-
20-
if(ENABLE_FRONTEND_API)
21-
find_package(obs-frontend-api REQUIRED)
22-
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::obs-frontend-api)
23-
endif()
24-
25-
if(ENABLE_QT)
26-
find_package(Qt6 COMPONENTS Widgets Core)
27-
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets)
28-
target_compile_options(
29-
${CMAKE_PROJECT_NAME}
30-
PRIVATE
31-
$<$<C_COMPILER_ID:Clang,AppleClang>:-Wno-quoted-include-in-framework-header
32-
-Wno-comma>
33-
)
34-
set_target_properties(
35-
${CMAKE_PROJECT_NAME}
36-
PROPERTIES AUTOMOC ON AUTOUIC ON AUTORCC ON
37-
)
38-
endif()
39-
40-
file(GLOB_RECURSE _sources CONFIGURE_DEPENDS src/*.cpp)
41-
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${_sources})
42-
43-
set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name})
44-
45-
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES CXX_STANDARD 23)
46-
47-
add_subdirectory(lib/atkaudio)
48-
49-
file(READ "${CMAKE_SOURCE_DIR}/buildspec.json" buildspec)
50-
string(JSON PLUGIN_DISPLAY_NAME GET ${buildspec} displayName)
51-
string(JSON PLUGIN_AUTHOR GET ${buildspec} author)
52-
string(JSON PLUGIN_OBS_VERSION_REQUIRED GET ${buildspec} dependencies obs-studio version)
53-
string(TIMESTAMP PLUGIN_YEAR "%Y")
54-
set(PLUGIN_AUTHOR "${PLUGIN_AUTHOR}")
55-
56-
configure_file(src/config.h.in config.h @ONLY)
57-
58-
include(./lib/atkaudio/cmake/cpack.cmake)
1+
cmake_minimum_required(VERSION 3.28...3.30)
2+
3+
include(./lib/atkaudio/cmake/preconfig.cmake)
4+
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/bootstrap.cmake")
5+
6+
project(${_name} VERSION ${_version})
7+
8+
# Set default build type to Debug
9+
if(NOT CMAKE_BUILD_TYPE)
10+
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
11+
endif()
12+
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
13+
14+
option(ENABLE_FRONTEND_API "Use obs-frontend-api for UI functionality" ON)
15+
16+
include(compilerconfig)
17+
include(defaults)
18+
include(helpers)
19+
20+
# Read buildspec.json early for Qt configuration
21+
file(READ "${CMAKE_SOURCE_DIR}/buildspec.json" buildspec)
22+
string(JSON QT6_VERSION GET ${buildspec} dependencies qt6 version)
23+
24+
# Define architecture-specific dependency directory in the build directory
25+
# Use CMAKE_BINARY_DIR so it works with any configured build directory
26+
set(DEPS_DIR "${CMAKE_BINARY_DIR}/obs-deps")
27+
28+
# Configure Qt paths for cross-compilation on Windows
29+
if(WIN32)
30+
if(CMAKE_VS_PLATFORM_NAME STREQUAL "ARM64")
31+
# ARM64 Cross-compilation setup
32+
set(QT_HOST_PATH "${DEPS_DIR}/obs-deps-qt6-${QT6_VERSION}-x64")
33+
set(Qt6_DIR "${DEPS_DIR}/obs-deps-qt6-${QT6_VERSION}-ARM64/lib/cmake/Qt6" CACHE STRING "Qt6 ARM64 CMake directory" FORCE)
34+
35+
message(STATUS "ARM64 Cross-compilation detected")
36+
message(STATUS "QT_HOST_PATH: ${QT_HOST_PATH}")
37+
message(STATUS "Qt6_DIR: ${Qt6_DIR}")
38+
39+
# Check if x64 Qt host tools exist
40+
if(EXISTS "${QT_HOST_PATH}/bin/moc.exe")
41+
message(STATUS "Found x64 Qt host tools at: ${QT_HOST_PATH}")
42+
else()
43+
message(FATAL_ERROR "x64 Qt host tools not found at: ${QT_HOST_PATH}. ARM64 cross-compilation requires both x64 and ARM64 Qt dependencies.")
44+
endif()
45+
46+
# Set Qt host tools for cross-compilation (use x64 tools for ARM64 builds)
47+
set(Qt6CoreTools_DIR "${QT_HOST_PATH}/lib/cmake/Qt6CoreTools" CACHE STRING "Qt6 x64 Core Tools" FORCE)
48+
set(Qt6GuiTools_DIR "${QT_HOST_PATH}/lib/cmake/Qt6GuiTools" CACHE STRING "Qt6 x64 GUI Tools" FORCE)
49+
set(Qt6WidgetsTools_DIR "${QT_HOST_PATH}/lib/cmake/Qt6WidgetsTools" CACHE STRING "Qt6 x64 Widget Tools" FORCE)
50+
51+
# Explicitly set tool executables that AUTOMOC/AUTOUIC/AUTORCC will use
52+
set(CMAKE_AUTOMOC_MOC_EXECUTABLE "${QT_HOST_PATH}/bin/moc.exe" CACHE FILEPATH "MOC executable for ARM64 cross-compilation" FORCE)
53+
set(CMAKE_AUTOUIC_UIC_EXECUTABLE "${QT_HOST_PATH}/bin/uic.exe" CACHE FILEPATH "UIC executable for ARM64 cross-compilation" FORCE)
54+
set(CMAKE_AUTORCC_RCC_EXECUTABLE "${QT_HOST_PATH}/bin/rcc.exe" CACHE FILEPATH "RCC executable for ARM64 cross-compilation" FORCE)
55+
56+
# Also set the legacy variables for compatibility
57+
set(QT_MOC_EXECUTABLE "${QT_HOST_PATH}/bin/moc.exe")
58+
set(QT_RCC_EXECUTABLE "${QT_HOST_PATH}/bin/rcc.exe")
59+
set(QT_UIC_EXECUTABLE "${QT_HOST_PATH}/bin/uic.exe")
60+
61+
message(STATUS "Set CMAKE_AUTOMOC_MOC_EXECUTABLE to: ${CMAKE_AUTOMOC_MOC_EXECUTABLE}")
62+
else()
63+
# x64 build - set paths to x64 Qt
64+
set(Qt6_DIR "${DEPS_DIR}/obs-deps-qt6-${QT6_VERSION}-x64/lib/cmake/Qt6" CACHE STRING "Qt6 x64 CMake directory" FORCE)
65+
message(STATUS "x64 build detected - using x64 Qt at: ${Qt6_DIR}")
66+
endif()
67+
endif()
68+
69+
add_library(${CMAKE_PROJECT_NAME} MODULE)
70+
71+
find_package(libobs REQUIRED)
72+
find_package(obs-frontend-api REQUIRED)
73+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::libobs)
74+
75+
if(ENABLE_FRONTEND_API)
76+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::obs-frontend-api)
77+
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE ENABLE_FRONTEND_API)
78+
endif()
79+
80+
# Qt is always required for proper window parenting
81+
find_package(Qt6 COMPONENTS Widgets Core REQUIRED)
82+
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets)
83+
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE ENABLE_QT)
84+
target_compile_options(
85+
${CMAKE_PROJECT_NAME}
86+
PRIVATE
87+
$<$<C_COMPILER_ID:Clang,AppleClang>:-Wno-quoted-include-in-framework-header
88+
-Wno-comma>
89+
)
90+
set_target_properties(
91+
${CMAKE_PROJECT_NAME}
92+
PROPERTIES AUTOMOC ON AUTOUIC ON AUTORCC ON
93+
)
94+
95+
file(GLOB_RECURSE _sources CONFIGURE_DEPENDS src/*.cpp)
96+
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${_sources})
97+
98+
set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name})
99+
100+
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES CXX_STANDARD 23)
101+
102+
add_subdirectory(lib/atkaudio)
103+
104+
string(JSON PLUGIN_DISPLAY_NAME GET ${buildspec} displayName)
105+
string(JSON PLUGIN_AUTHOR GET ${buildspec} author)
106+
string(JSON PLUGIN_OBS_VERSION_REQUIRED GET ${buildspec} dependencies obs-studio version)
107+
string(TIMESTAMP PLUGIN_YEAR "%Y")
108+
set(PLUGIN_AUTHOR "${PLUGIN_AUTHOR}")
109+
110+
configure_file(src/config.h.in config.h @ONLY)
111+
112+
include(./lib/atkaudio/cmake/cpack.cmake)
113+
114+
# Automatically run install after build (skip in CI or when installing to system directories without permissions)
115+
if(NOT DEFINED ENV{CI} OR NOT CMAKE_INSTALL_PREFIX MATCHES "^/usr")
116+
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
117+
COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --config $<CONFIG> --component plugin
118+
COMMENT "Installing plugin after build..."
119+
)
120+
endif()
121+
122+
# On non-CI Linux builds, copy plugin to user home directory after build
123+
if(NOT DEFINED ENV{CI} AND UNIX AND NOT APPLE)
124+
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
125+
set(_user_arch "64bit")
126+
else()
127+
set(_user_arch "32bit")
128+
endif()
129+
130+
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD
131+
COMMAND ${CMAKE_COMMAND} -E make_directory "$ENV{HOME}/.config/obs-studio/plugins/${_name}/bin/${_user_arch}"
132+
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:${CMAKE_PROJECT_NAME}>" "$ENV{HOME}/.config/obs-studio/plugins/${_name}/bin/${_user_arch}/"
133+
COMMAND ${CMAKE_COMMAND} -E make_directory "$ENV{HOME}/.config/obs-studio/plugins/${_name}/data"
134+
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/data" "$ENV{HOME}/.config/obs-studio/plugins/${_name}/data"
135+
COMMENT "Copying ${_name} to user home OBS plugins directory..."
136+
VERBATIM
137+
)
138+
endif()

CMakePresets.json

Lines changed: 86 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,30 @@
1111
"hidden": true,
1212
"cacheVariables": {
1313
"CMAKE_COMPILE_WARNING_AS_ERROR": false,
14-
"ENABLE_FRONTEND_API": true,
15-
"ENABLE_QT": true
14+
"ENABLE_FRONTEND_API": true
15+
}
16+
},
17+
{
18+
"name": "ubuntu-cross-compile-template",
19+
"hidden": true,
20+
"inherits": [
21+
"template"
22+
],
23+
"condition": {
24+
"type": "equals",
25+
"lhs": "${hostSystemName}",
26+
"rhs": "Linux"
27+
},
28+
"generator": "Ninja",
29+
"warnings": {
30+
"dev": true,
31+
"deprecated": true
32+
},
33+
"cacheVariables": {
34+
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
35+
"CMAKE_INSTALL_LIBDIR": "lib/CMAKE_SYSTEM_PROCESSOR-linux-gnu",
36+
"CMAKE_POSITION_INDEPENDENT_CODE": true,
37+
"CMAKE_SYSTEM_NAME": "Linux"
1638
}
1739
},
1840
{
@@ -49,8 +71,7 @@
4971
"generator": "Xcode",
5072
"cacheVariables": {
5173
"CMAKE_COMPILE_WARNING_AS_ERROR": false,
52-
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0",
53-
"ENABLE_CCACHE": false
74+
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0"
5475
}
5576
},
5677
{
@@ -67,10 +88,13 @@
6788
"rhs": "Windows"
6889
},
6990
"generator": "Visual Studio 17 2022",
70-
"architecture": "x64,version=10.0.22621",
91+
"architecture": "x64",
7192
"warnings": {
7293
"dev": true,
7394
"deprecated": true
95+
},
96+
"cacheVariables": {
97+
"CMAKE_TOOLCHAIN_FILE": ""
7498
}
7599
},
76100
{
@@ -84,6 +108,40 @@
84108
"CMAKE_COMPILE_WARNING_AS_ERROR": true
85109
}
86110
},
111+
{
112+
"name": "windows-arm64",
113+
"displayName": "Windows ARM64",
114+
"description": "Build for Windows ARM64",
115+
"inherits": [
116+
"template"
117+
],
118+
"binaryDir": "${sourceDir}/build_arm64",
119+
"condition": {
120+
"type": "equals",
121+
"lhs": "${hostSystemName}",
122+
"rhs": "Windows"
123+
},
124+
"generator": "Visual Studio 17 2022",
125+
"architecture": "ARM64",
126+
"warnings": {
127+
"dev": true,
128+
"deprecated": true
129+
},
130+
"cacheVariables": {
131+
"CMAKE_TOOLCHAIN_FILE": ""
132+
}
133+
},
134+
{
135+
"name": "windows-ci-arm64",
136+
"inherits": [
137+
"windows-arm64"
138+
],
139+
"displayName": "Windows ARM64 CI build",
140+
"description": "Build for Windows ARM64 on CI",
141+
"cacheVariables": {
142+
"CMAKE_COMPILE_WARNING_AS_ERROR": true
143+
}
144+
},
87145
{
88146
"name": "ubuntu-x86_64",
89147
"displayName": "Ubuntu x86_64",
@@ -117,8 +175,7 @@
117175
"description": "Build for Ubuntu x86_64 on CI",
118176
"cacheVariables": {
119177
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
120-
"CMAKE_COMPILE_WARNING_AS_ERROR": false,
121-
"ENABLE_CCACHE": true
178+
"CMAKE_COMPILE_WARNING_AS_ERROR": false
122179
}
123180
}
124181
],
@@ -142,7 +199,7 @@
142199
"configurePreset": "windows-x64",
143200
"displayName": "Windows x64",
144201
"description": "Windows build for x64",
145-
"configuration": "Debug"
202+
"configuration": "RelWithDebInfo"
146203
},
147204
{
148205
"name": "windows-x64-release",
@@ -158,6 +215,27 @@
158215
"description": "Windows CI build for x64 (RelWithDebInfo configuration)",
159216
"configuration": "RelWithDebInfo"
160217
},
218+
{
219+
"name": "windows-arm64",
220+
"configurePreset": "windows-arm64",
221+
"displayName": "Windows ARM64",
222+
"description": "Windows build for ARM64",
223+
"configuration": "Debug"
224+
},
225+
{
226+
"name": "windows-arm64-release",
227+
"configurePreset": "windows-arm64",
228+
"displayName": "Windows ARM64 Release",
229+
"description": "Windows build for ARM64",
230+
"configuration": "Release"
231+
},
232+
{
233+
"name": "windows-ci-arm64",
234+
"configurePreset": "windows-ci-arm64",
235+
"displayName": "Windows ARM64 CI",
236+
"description": "Windows CI build for ARM64 (RelWithDebInfo configuration)",
237+
"configuration": "RelWithDebInfo"
238+
},
161239
{
162240
"name": "ubuntu-x86_64",
163241
"configurePreset": "ubuntu-x86_64",

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,9 @@ If you find this project useful, please consider making [a donation](https://www
6060

6161
- Download and install [latest release](https://github.com/atkAudio/PluginForObsRelease/releases/latest)
6262
- Manual/portable installations e.g. on major Linux distros: extract `portable-Linux.zip` file and copy the directory `atkaudio-pluginforobs` into `~/.config/obs-studio/plugins/`.
63+
64+
## Development
65+
66+
For developers working on this project:
67+
68+
- **Release Process**: Releases are automatically created when tags matching `x.y.z` or `x.y.z-beta.n` format are pushed

0 commit comments

Comments
 (0)