-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to rebuild with obs-backgroundremoval plugin build pipeline (…
…most likely goinbg to break)
- Loading branch information
Showing
87 changed files
with
75,323 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: build obs plugin | |
|
||
on: | ||
push: | ||
branches: [ main, ci, dev, zip-support ] | ||
branches: [ main, ci, dev, face-detection-mediapipe ] | ||
tags: [ '*' ] | ||
#pull_request: | ||
# branches: [ main ] | ||
|
@@ -142,7 +142,7 @@ jobs: | |
linux-in-tree: | ||
name: 'Linux' | ||
runs-on: ${{ matrix.ubuntu }} | ||
if: startsWith(github.ref, 'refs/tags/') | ||
#if: startsWith(github.ref, 'refs/tags/') | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -245,6 +245,7 @@ jobs: | |
echo "FILE_NAME=${FILE_NAME}" >> $GITHUB_ENV | ||
mkdir -p ./${{ env.PLUGIN_NAME }}/bin/64bit/ | ||
mv ./build/obs-studio/plugins/${{ env.PLUGIN_NAME }}/${{ env.PLUGIN_NAME }}.so ./${{ env.PLUGIN_NAME }}/bin/64bit/${{ env.PLUGIN_NAME }}.so | ||
mv ./build/obs-studio/plugins/${{ env.PLUGIN_NAME }}/lib ./${{ env.PLUGIN_NAME }}/bin/64bit/ | ||
mv ./plugins/${{ env.PLUGIN_NAME }}/data ./${{ env.PLUGIN_NAME }}/data | ||
zip -r "${FILE_NAME}" ${{ env.PLUGIN_NAME }} | ||
- name: 'Publish' | ||
|
@@ -291,15 +292,15 @@ jobs: | |
CMAKE_SYSTEM_VERSION: "10.0.18363.657" | ||
WINDOWS_DEPS_VERSION: '2022-08-02' | ||
steps: | ||
- name: Add msbuild to PATH | ||
- name: 'Add msbuild to PATH' | ||
uses: microsoft/[email protected] | ||
- name: Checkout obs | ||
- name: 'Checkout obs' | ||
uses: actions/[email protected] | ||
with: | ||
repository: obsproject/obs-studio | ||
ref: ${{ env.OBS_VERSION }} | ||
submodules: 'recursive' | ||
- name: Checkout plugin | ||
- name: 'Checkout plugin' | ||
uses: actions/[email protected] | ||
with: | ||
path: plugins/${{ env.PLUGIN_NAME}} | ||
|
@@ -396,10 +397,10 @@ jobs: | |
path: | | ||
build/libzip/distrib | ||
key: libzip-win-${{steps.zlib-info.outputs.version}}-${{steps.libzip-info.outputs.version}} | ||
- name: Add plugin to obs cmake | ||
- name: 'Add plugin to obs cmake' | ||
shell: cmd | ||
run: echo add_subdirectory(${{ env.PLUGIN_NAME }}) >> plugins/CMakeLists.txt | ||
- name: Remove un-needed plugins for this build | ||
- name: 'Remove un-needed plugins for this build' | ||
shell: pwsh | ||
run: | | ||
Set-Content -Path "plugins\CMakeLists.txt" -Value (get-content -Path "plugins\CMakeLists.txt" | Select-String -Pattern 'add_subdirectory\(aja\)' -NotMatch) | ||
|
@@ -428,7 +429,7 @@ jobs: | |
Set-Content -Path "UI\frontend-plugins\CMakeLists.txt" -Value (get-content -Path "UI\frontend-plugins\CMakeLists.txt" | Select-String -Pattern 'add_subdirectory\(frontend-tools\)' -NotMatch) | ||
Set-Content -Path "UI\frontend-plugins\CMakeLists.txt" -Value (get-content -Path "UI\frontend-plugins\CMakeLists.txt" | Select-String -Pattern 'add_subdirectory\(decklink-captions\)' -NotMatch) | ||
type UI\frontend-plugins\CMakeLists.txt | ||
- name: Fetch Git Tags | ||
- name: 'Fetch Git Tags' | ||
run: git fetch --prune --tags --unshallow | ||
- name: 'Install prerequisite: QT' | ||
run: | | ||
|
@@ -438,7 +439,7 @@ jobs: | |
run: | | ||
curl -kLO https://github.com/obsproject/obs-deps/releases/download/${{ env.WINDOWS_DEPS_VERSION }}/windows-deps-${{ env.WINDOWS_DEPS_VERSION }}-${{ matrix.target }}.zip -f --retry 5 -C - | ||
7z x windows-deps-${{ env.WINDOWS_DEPS_VERSION }}-${{ matrix.target }}.zip -o"${{ github.workspace }}/cmbuild/deps" | ||
- name: Configure | ||
- name: 'Configure' | ||
shell: bash | ||
run: | | ||
mkdir ./package | ||
|
@@ -472,7 +473,7 @@ jobs: | |
- name: 'Build' | ||
run: msbuild /m /p:Configuration=RelWithDebInfo .\build\obs-studio\obs-studio.sln | ||
- name: Package | ||
- name: 'Package' | ||
if: success() | ||
run: | | ||
$env:FILE_NAME="${{ env.PLUGIN_NAME }}-${{ github.sha }}-windows-${{ matrix.target }}" | ||
|
@@ -482,18 +483,18 @@ jobs: | |
copy .\build\obs-studio\plugins\${{ env.PLUGIN_NAME }}\installer.iss .\installer\installer.iss | ||
robocopy .\plugins\${{ env.PLUGIN_NAME}}\media\ .\installer\media\ /E /XF .gitignore | ||
exit 0 | ||
- name: Publish zip | ||
- name: 'Publish zip' | ||
if: success() | ||
uses: actions/[email protected] | ||
with: | ||
name: '${{ env.FILE_NAME }}' | ||
path: package/* | ||
# - name: Publish zip 2 | ||
# if: failure() | ||
# uses: actions/[email protected] | ||
# with: | ||
# name: '${{ env.FILE_NAME }}-debug-files' | ||
# path: build/* | ||
- name: 'Build failed - all files' | ||
if: failure() | ||
uses: actions/[email protected] | ||
with: | ||
name: '${{ env.FILE_NAME }}-debug-files' | ||
path: build/* | ||
- name: Publish Installer Files | ||
if: success() | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,124 +1,121 @@ | ||
# --- Detect if the plugin is build out of tree or not --- | ||
if(CMAKE_PROJECT_NAME STREQUAL "obs-studio") | ||
set(BUILD_OUT_OF_TREE OFF) | ||
else() | ||
set(BUILD_OUT_OF_TREE ON) | ||
cmake_minimum_required(VERSION 3.18) | ||
endif() | ||
cmake_minimum_required(VERSION 3.18) | ||
|
||
if(DEV_MODE EQUAL 1) | ||
add_compile_definitions(DEV_MODE) | ||
project(shadertastic-dev VERSION 0.0.8) | ||
else() | ||
project(shadertastic VERSION 0.0.8) | ||
endif() | ||
set(PROJECT_FULL_NAME "Shadertastic") | ||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/bootstrap.cmake" NO_POLICY_SCOPE) | ||
|
||
set(CMAKE_COMPILE_WARNING_AS_ERROR ON) | ||
project(${_name} VERSION ${_version}) | ||
|
||
# Set new UUIDs when you start to create a new plugin. | ||
set(MACOS_PACKAGE_UUID "90e83546-fa37-453a-9adb-b51149c78df1") | ||
set(MACOS_INSTALLER_UUID "14c0a640-0656-4528-8243-4a2ab2595dd5") | ||
option(ENABLE_FRONTEND_API "Use obs-frontend-api for UI functionality" OFF) | ||
option(ENABLE_QT "Use Qt functionality" OFF) | ||
|
||
# libzip | ||
set(LIBZIP_LIBRARY "" CACHE FILEPATH "Path to libzip library.") | ||
set(LIBZIP_INCLUDE "" CACHE PATH "Path zo libzip's includes.") | ||
set(LIBZIP_INCLUDE_CONF "" CACHE PATH "Path zo libzip's includes (config file).") | ||
include(compilerconfig) | ||
include(defaults) | ||
include(helpers) | ||
|
||
add_library(${PROJECT_NAME} MODULE) | ||
add_library(${CMAKE_PROJECT_NAME} MODULE) | ||
|
||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/version.h) | ||
find_package(libobs REQUIRED) | ||
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::libobs) | ||
|
||
file(GLOB sources_HPP | ||
"src/shader/*.hpp" | ||
"src/util/*.hpp" | ||
"src/parameters/*.hpp" | ||
"src/*.hpp" | ||
) | ||
if(ENABLE_FRONTEND_API) | ||
find_package(obs-frontend-api REQUIRED) | ||
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::obs-frontend-api) | ||
endif() | ||
|
||
target_sources(${PROJECT_NAME} PRIVATE | ||
src/shadertastic.cpp | ||
src/version.h | ||
${sources_HPP} | ||
) | ||
if(ENABLE_QT) | ||
find_qt(COMPONENTS Widgets Core) | ||
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt::Core Qt::Widgets) | ||
target_compile_options( | ||
${CMAKE_PROJECT_NAME} PRIVATE $<$<C_COMPILER_ID:Clang,AppleClang>:-Wno-quoted-include-in-framework-header | ||
-Wno-comma>) | ||
set_target_properties( | ||
${CMAKE_PROJECT_NAME} | ||
PROPERTIES AUTOMOC ON | ||
AUTOUIC ON | ||
AUTORCC ON) | ||
endif() | ||
|
||
set(USE_SYSTEM_ONNXRUNTIME | ||
OFF | ||
CACHE STRING "Use system ONNX Runtime") | ||
|
||
set(DISABLE_ONNXRUNTIME_GPU | ||
OFF | ||
CACHE STRING "Disables GPU support of ONNX Runtime (Only valid on Linux)") | ||
|
||
if(BUILD_OUT_OF_TREE) | ||
find_package(libobs REQUIRED) | ||
find_package(obs-frontend-api REQUIRED) | ||
include(cmake/ObsPluginHelpers.cmake) | ||
set(OBS_FRONTEND_API_NAME "obs-frontend-api") | ||
if(DISABLE_ONNXRUNTIME_GPU) | ||
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE DISABLE_ONNXRUNTIME_GPU) | ||
endif() | ||
|
||
if(USE_SYSTEM_ONNXRUNTIME) | ||
if(OS_LINUX) | ||
find_package(Onnxruntime 1.16.3 REQUIRED) | ||
set(Onnxruntime_INCLUDE_PATH | ||
${Onnxruntime_INCLUDE_DIR} ${Onnxruntime_INCLUDE_DIR}/onnxruntime | ||
${Onnxruntime_INCLUDE_DIR}/onnxruntime/core/session ${Onnxruntime_INCLUDE_DIR}/onnxruntime/core/providers/cpu) | ||
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE "${Onnxruntime_LIBRARIES}") | ||
target_include_directories(${CMAKE_PROJECT_NAME} SYSTEM PUBLIC "${Onnxruntime_INCLUDE_PATH}") | ||
else() | ||
message(FATAL_ERROR "System ONNX Runtime is only supported on Linux!") | ||
endif() | ||
else() | ||
include(cmake/FetchOnnxruntime.cmake) | ||
endif() | ||
|
||
set(USE_SYSTEM_OPENCV | ||
OFF | ||
CACHE STRING "Use system OpenCV") | ||
if(USE_SYSTEM_OPENCV) | ||
if(OS_LINUX) | ||
find_package(OpenCV REQUIRED COMPONENTS core imgproc) | ||
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE "${OpenCV_LIBRARIES}") | ||
target_include_directories(${CMAKE_PROJECT_NAME} SYSTEM PUBLIC "${OpenCV_INCLUDE_DIRS}") | ||
else() | ||
message(FATAL_ERROR "System OpenCV is only supported on Linux!") | ||
endif() | ||
else() | ||
set(OBS_FRONTEND_API_NAME "frontend-api") | ||
include(cmake/FetchOpenCV.cmake) | ||
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OpenCV) | ||
endif() | ||
|
||
# Update checker | ||
#if(APPLE) | ||
# add_subdirectory(src/update-checker/URLSessionClient) | ||
# target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE URLSessionClient) | ||
# # add Foundation framework | ||
# target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE "-framework Foundation") | ||
#elseif(MSVC) | ||
# add_subdirectory(src/update-checker/WinRTHttpClient) | ||
# target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE WinRTHttpClient) | ||
#elseif(UNIX) | ||
# add_subdirectory(src/update-checker/CurlClient) | ||
# target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE CurlClient) | ||
#endif() | ||
|
||
# libzip | ||
set(LIBZIP_LIBRARY "" CACHE FILEPATH "Path to libzip library.") | ||
set(LIBZIP_INCLUDE "" CACHE PATH "Path to libzip's includes.") | ||
set(LIBZIP_INCLUDE_CONF "" CACHE PATH "Path to libzip's includes (config file).") | ||
if(OS_WINDOWS) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:avx2 /O2 /openmp") | ||
get_filename_component(ISS_FILES_DIR "${CMAKE_BINARY_DIR}\\..\\package" ABSOLUTE) | ||
file(TO_NATIVE_PATH "${ISS_FILES_DIR}" ISS_FILES_DIR) | ||
get_filename_component(ISS_PACKAGE_DIR "${CMAKE_PACKAGE_PREFIX}\\.." ABSOLUTE) | ||
file(TO_NATIVE_PATH "${ISS_PACKAGE_DIR}" ISS_PACKAGE_DIR) | ||
get_filename_component(ISS_SOURCE_DIR "${PROJECT_SOURCE_DIR}" ABSOLUTE) | ||
file(TO_NATIVE_PATH "${ISS_SOURCE_DIR}" ISS_SOURCE_DIR) | ||
configure_file("installer.iss.in" | ||
"${PROJECT_BINARY_DIR}/installer.iss" | ||
) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resource.rc.in ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.rc) | ||
|
||
include_directories(AFTER ${LIBZIP_INCLUDE}) | ||
include_directories(AFTER ${LIBZIP_INCLUDE_CONF}) | ||
target_link_libraries(${PROJECT_NAME} | ||
${LIBZIP_LIBRARY} | ||
) | ||
set(ZLIB_USE_STATIC_LIBS ON) | ||
find_package(ZLIB REQUIRED) | ||
target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES}) | ||
include_directories(${ZLIB_INCLUDE_DIRS}) | ||
|
||
target_sources(${PROJECT_NAME} PRIVATE | ||
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.rc) | ||
include_directories(AFTER ${LIBZIP_INCLUDE}) | ||
include_directories(AFTER ${LIBZIP_INCLUDE_CONF}) | ||
target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBZIP_LIBRARY}) | ||
elseif(OS_MACOS) | ||
set(MACOS_BUNDLEID "com.xureilab.${PROJECT_NAME}") | ||
set(MACOSX_PLUGIN_GUI_IDENTIFIER "${MACOS_BUNDLEID}") | ||
set(MACOSX_PLUGIN_BUNDLE_VERSION "${PROJECT_VERSION}") | ||
set(MACOSX_PLUGIN_SHORT_VERSION_STRING "1") | ||
configure_file(cmake/bundle/macos/installer-macos.pkgproj.in ${CMAKE_BINARY_DIR}/installer-macos.generated.pkgproj) | ||
target_compile_options(${PROJECT_NAME} PRIVATE -Wall) | ||
# TODO | ||
elseif(OS_LINUX) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2 -O3 -fopenmp") | ||
include_directories(AFTER ${LIBZIP_INCLUDE}) | ||
include_directories(AFTER ${LIBZIP_INCLUDE_CONF}) | ||
target_link_libraries(${PROJECT_NAME} | ||
${LIBZIP_LIBRARY} | ||
) | ||
find_package(ZLIB REQUIRED) | ||
target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES}) | ||
include_directories(${ZLIB_INCLUDE_DIRS}) | ||
include_directories(AFTER ${LIBZIP_INCLUDE}) | ||
include_directories(AFTER ${LIBZIP_INCLUDE_CONF}) | ||
target_link_libraries(${PROJECT_NAME} | ||
PRIVATE ${LIBZIP_LIBRARY} | ||
) | ||
endif() | ||
|
||
# lines if you want add Qt UI in your plugin | ||
find_qt(COMPONENTS Core Widgets Gui) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES AUTOMOC ON AUTOUIC ON AUTORCC ON) | ||
|
||
target_link_libraries(${PROJECT_NAME} | ||
OBS::${OBS_FRONTEND_API_NAME} | ||
Qt::Widgets | ||
OBS::libobs | ||
target_sources( | ||
${CMAKE_PROJECT_NAME} | ||
PRIVATE src/shadertastic.cpp | ||
src/version.h | ||
#${ovmediapipe_CPP} # TODO Remove this | ||
) | ||
target_compile_options(${CMAKE_PROJECT_NAME} | ||
PRIVATE $<$<C_COMPILER_ID:Clang,AppleClang>:-Wno-error=unused-command-line-argument>) | ||
|
||
if(BUILD_OUT_OF_TREE) | ||
if(NOT LIB_OUT_DIR) | ||
set(LIB_OUT_DIR "/lib/obs-plugins") | ||
endif() | ||
if(NOT DATA_OUT_DIR) | ||
set(DATA_OUT_DIR "/share/obs/obs-plugins/${PROJECT_NAME}") | ||
endif() | ||
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") | ||
install(TARGETS ${PROJECT_NAME} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_OUT_DIR}) | ||
install(DIRECTORY data/locale | ||
DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATA_OUT_DIR}) | ||
else() | ||
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_SOURCE_DIR}/UI/obs-frontend-api") | ||
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "plugins/xurei") | ||
endif() | ||
setup_plugin_target(${PROJECT_NAME}) | ||
set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name}) |
Oops, something went wrong.