From 1d96655b01f1db12052636e944e4947625750c70 Mon Sep 17 00:00:00 2001 From: Exeldro Date: Tue, 1 Feb 2022 06:50:26 +0100 Subject: [PATCH] update build --- .github/workflows/build.yml | 31 ++++++++++++++++++++++------ CMakeLists.txt | 40 +++++++++++++++++++++++++++++-------- 2 files changed, 57 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85aa5b5..ef1cad9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: if [ -d /usr/local/opt/speexdsp ]; then brew unlink speexdsp fi - brew uninstall curl php + brew uninstall curl php composer brew bundle --file ./CI/scripts/macos/Brewfile echo "NPROC=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV - name: 'Install prerequisite: Pre-built dependencies' @@ -70,7 +70,7 @@ jobs: echo "add_subdirectory(${{ env.PLUGIN_NAME }})" >> UI/frontend-plugins/CMakeLists.txt mkdir ./build cd ./build - cmake -DDISABLE_PYTHON=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DQTDIR="/tmp/obsdeps" -DSWIGDIR="/tmp/obsdeps" -DDepsPath="/tmp/obsdeps" .. + cmake -DDISABLE_PYTHON=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -DQTDIR="/tmp/obsdeps" -DSWIGDIR="/tmp/obsdeps" -DDepsPath="/tmp/obsdeps" -DBUILD_BROWSER=OFF -DENABLE_PIPEWIRE=OFF -DBUILD_VST=OFF -DBUILD_VIRTUALCAM=OFF -DENABLE_SCRIPTING=OFF .. cd - - name: Build shell: bash @@ -177,6 +177,7 @@ jobs: pkg-config \ python3-dev \ qtbase5-dev \ + qtbase5-private-dev \ libqt5svg5-dev \ swig \ linux-generic @@ -185,7 +186,7 @@ jobs: run: | mkdir ./build cd ./build - cmake -DUNIX_STRUCTURE=0 -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/obs-studio-portable" -DBUILD_CAPTIONS=OFF -DWITH_RTMPS=OFF -DBUILD_BROWSER=OFF .. + cmake -DUNIX_STRUCTURE=0 -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/obs-studio-portable" -DBUILD_CAPTIONS=OFF -DWITH_RTMPS=OFF -DBUILD_BROWSER=OFF -DBUILD_VIRTUALCAM=OFF -DBUILD_VST=OFF -DENABLE_PIPEWIRE=OFF -DENABLE_SCRIPTING=OFF .. - name: 'Build' shell: bash working-directory: ${{ github.workspace }}/build @@ -262,11 +263,11 @@ jobs: mkdir ./package mkdir ./build32 cd ./build32 - cmake -G"${{ env.CMAKE_GENERATOR }}" -A"Win32" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=false -DBUILD_CAPTIONS=false -DCOMPILE_D3D12_HOOK=false -DDepsPath="${{ github.workspace }}/cmbuild/deps/win32" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2019" -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE .. + cmake -G"${{ env.CMAKE_GENERATOR }}" -A"Win32" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=false -DBUILD_VST=false -DBUILD_VIRTUALCAM=false -DBUILD_CAPTIONS=false -DCOMPILE_D3D12_HOOK=false -DENABLE_SCRIPTING=false -DDepsPath="${{ github.workspace }}/cmbuild/deps/win32" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2019" -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE .. cd .. mkdir ./build64 cd ./build64 - cmake -G"${{ env.CMAKE_GENERATOR }}" -A"x64" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=false -DBUILD_CAPTIONS=false -DCOMPILE_D3D12_HOOK=false -DDepsPath="${{ github.workspace }}/cmbuild/deps/win64" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2019_64" -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE .. + cmake -G"${{ env.CMAKE_GENERATOR }}" -A"x64" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=false -DBUILD_VST=false -DBUILD_VIRTUALCAM=false -DBUILD_CAPTIONS=false -DCOMPILE_D3D12_HOOK=false -DENABLE_SCRIPTING=false -DDepsPath="${{ github.workspace }}/cmbuild/deps/win64" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2019_64" -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE .. - name: 'Build 32' run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-studio.sln - name: 'Build 64' @@ -281,6 +282,20 @@ jobs: robocopy .\build64\rundir\RelWithDebInfo\obs-plugins\64bit\ .\package\obs-plugins\64bit ${{ env.PLUGIN_NAME }}.* /E /XF .gitignore robocopy .\build64\rundir\RelWithDebInfo\data\obs-plugins\${{ env.PLUGIN_NAME }}\ .\package\data\obs-plugins\${{ env.PLUGIN_NAME }}\ /E /XF .gitignore exit 0 + - name: Create Code Signing Certificate + if: success() && github.event_name != 'pull_request' + run: | + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.CERTIFICATE }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + - name: Code Sign 32 + if: success() && github.event_name != 'pull_request' + run: | + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x86/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\obs-plugins\32bit\${{ env.PLUGIN_NAME }}.dll + - name: Code Sign 64 + if: success() && github.event_name != 'pull_request' + run: | + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\obs-plugins\64bit\${{ env.PLUGIN_NAME }}.dll - name: Publish zip if: success() uses: actions/upload-artifact@v2.2.0 @@ -295,9 +310,13 @@ jobs: - name: "Package Installer (Compile)" run: | & 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' /Qp ".\build64\UI\frontend-plugins\${{ env.PLUGIN_NAME }}\installer.iss" + - name: Code Sign Installer + if: success() && github.event_name != 'pull_request' + run: | + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\${{ env.PLUGIN_NAME }}-installer.exe - name: Publish installer if: success() uses: actions/upload-artifact@v2.2.0 with: name: '${{ env.FILE_NAME }}-installer' - path: package/*.exe \ No newline at end of file + path: package/*.exe diff --git a/CMakeLists.txt b/CMakeLists.txt index fe96750..14c4598 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,18 @@ +cmake_minimum_required(VERSION 3.18) project(transition-table VERSION 0.2.2) set(PROJECT_FULL_NAME "Transition Table") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/version.h) +find_package(Qt5Widgets) + +set(CMAKE_AUTOMOC ON) + set(transition-table_HEADERS - transition-table.hpp + transition-table.hpp version.h) - set(transition-table_SOURCES - transition-table.cpp) + transition-table.cpp) if(WIN32) get_filename_component(ISS_FILES_DIR "${CMAKE_BINARY_DIR}\\..\\package" ABSOLUTE) @@ -25,14 +29,34 @@ if(WIN32) transition-table.rc) endif() +if(BUILD_OUT_OF_TREE) + find_package(LibObs REQUIRED) +endif() + add_library(transition-table MODULE ${transition-table_HEADERS} ${transition-table_SOURCES}) target_link_libraries(transition-table - obs-frontend-api - Qt5::Widgets - libobs) + obs-frontend-api + Qt5::Widgets + libobs) -set_target_properties(transition-table PROPERTIES FOLDER "plugins/exeldro") -install_obs_plugin_with_data(transition-table data) +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/transition-table") + endif() + set_target_properties(transition-table PROPERTIES PREFIX "") + install(TARGETS transition-table + LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_OUT_DIR}) + install(DIRECTORY data/locale + DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATA_OUT_DIR}) +else() + target_include_directories(transition-table PRIVATE + "${CMAKE_SOURCE_DIR}/UI/obs-frontend-api") + set_target_properties(transition-table PROPERTIES FOLDER "plugins/exeldro") + install_obs_plugin_with_data(transition-table data) +endif()