From 0b43ead9bf1feb35d0b4b47ce3c9310172ef7f32 Mon Sep 17 00:00:00 2001 From: Christopher P Yarger Date: Wed, 15 Jul 2020 05:49:41 -0400 Subject: [PATCH 1/6] ugh --- azure-testing.yml | 162 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 azure-testing.yml diff --git a/azure-testing.yml b/azure-testing.yml new file mode 100644 index 00000000..a1ba590b --- /dev/null +++ b/azure-testing.yml @@ -0,0 +1,162 @@ +variables: + isReleaseMode: ${{ startsWith(variables['Build.SourceBranch'], 'refs/tags/') }} + + +trigger: + branches: + include: + - testing + tags: + include: + - '*' + +jobs: +- job: 'GenerateDocs' + condition: | + or( + eq(variables['Build.SourceBranch'], 'refs/heads/4.x-current'), + eq(variables['Build.SourceBranch'], 'refs/heads/master') + ) + pool: + vmImage: 'ubuntu-18.04' + steps: + - checkout: self + submodules: false + + - script: ./CI/generate-docs.sh + displayName: 'Generate docs' + env: + CHECKOUT_REF: $(Build.SourceBranch) + GH_TOKEN: $(GithubToken) + +- job: 'Build_Windows' + pool: + vmImage: 'windows-2019' + variables: + build_config: RelWithDebInfo + DepsBasePath: 'D:\obsdependencies' + DepsPath32: '$(DepsBasePath)\win32' + DepsPath64: '$(DepsBasePath)\win64' + QtBaseDir: 'D:\QtDep' + QTDIR32: '$(QtBaseDir)\5.10.1\msvc2017' + QTDIR64: '$(QtBaseDir)\5.10.1\msvc2017_64' + OBSPath: 'D:\obs-studio' + isAzure: 'true' + steps: + - checkout: self + submodules: true + - script: ./CI/install-qt-win.cmd + displayName: 'Install Qt' + env: + QtBaseDir: $(QtBaseDir) + - task: Cache@2 + displayName: Restore cached OBS Studio dependencies + inputs: + key: 'obsdeps | "$(Agent.OS)"' + restoreKeys: | + obsdeps | "$(Agent.OS)" + path: $(DepsBasePath) + - script: ./CI/download-obs-deps.cmd + displayName: 'Download OBS Studio dependencies' + - task: Cache@2 + displayName: Restore cached OBS Studio builds + inputs: + key: 'obs | "$(Agent.OS)"' + restoreKeys: | + obs | "$(Agent.OS)" + path: $(OBSPath) + - script: ./CI/prepare-obs-windows.cmd + displayName: 'Checkout & CMake OBS Studio' + env: + build_config: $(build_config) + DepsPath32: $(DepsPath32) + DepsPath64: $(DepsPath64) + QTDIR32: $(QTDIR32) + QTDIR64: $(QTDIR64) + OBSPath: $(OBSPath) + isAzure: $(isAzure) + - task: MSBuild@1 + displayName: 'Build OBS Studio 32-bit' + inputs: + msbuildArguments: '/m /p:Configuration=$(build_config)' + solution: '$(OBSPath)\build32\obs-studio.sln' + - task: MSBuild@1 + displayName: 'Build OBS Studio 64-bit' + inputs: + msbuildArguments: '/m /p:Configuration=$(build_config)' + solution: '$(OBSPath)\build64\obs-studio.sln' + - script: ./CI/prepare-windows.cmd + displayName: 'CMake obs-midi' + env: + build_config: $(build_config) + QTDIR32: $(QTDIR32) + QTDIR64: $(QTDIR64) + OBSPath: $(OBSPath) + isAzure: $(isAzure) + - task: MSBuild@1 + displayName: 'Build obs-midi 32-bit' + inputs: + msbuildArguments: '/m /p:Configuration=$(build_config)' + solution: '.\build32\obs-midi.sln' + - task: MSBuild@1 + displayName: 'Build obs-midi 64-bit' + inputs: + msbuildArguments: '/m /p:Configuration=$(build_config)' + solution: '.\build64\obs-midi.sln' + + - script: ./CI/package-windows.cmd + displayName: 'Package obs-midi' + - task: PublishBuildArtifacts@1 + displayName: 'Upload package artifacts' + inputs: + pathtoPublish: './package' + artifactName: 'windows_build' + +- job: 'Build_Linux' + pool: + vmImage: 'ubuntu-18.04' + variables: + BUILD_REASON: $(Build.Reason) + BRANCH_SHORT_NAME: $(Build.SourceBranchName) + BRANCH_FULL_NAME: $(Build.SourceBranch) + isAzure: true + steps: + - checkout: self + submodules: true + - script: ./CI/install-dependencies-ubuntu.sh + displayName: 'Install dependencies' + - script: ./CI/build-ubuntu.sh + displayName: 'Build obs-midi' + env: + isAzure: $(isAzure) + - script: ./CI/package-ubuntu.sh + displayName: 'Package obs-midi' + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: './package' + artifactName: 'deb_build' + +- job: 'Build_macOS' + pool: + vmImage: 'macos-10.14' + variables: + isAzure: true + steps: + - checkout: self + submodules: true + - script: ./CI/install-dependencies-macos.sh + displayName: 'Install dependencies' + - script: ./CI/install-build-obs-macos.sh + displayName: 'Build OBS' + - script: ./CI/build-macos.sh + displayName: 'Build obs-midi' + env: + isAzure: $(isAzure) + - script: ./CI/package-macos.sh + displayName: 'Package obs-midi' + env: + RELEASE_MODE: false + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: './release' + artifactName: 'macos_build' From 3ac1b7fbca6ea34003dd25466a25c91cfcd2b32a Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Thu, 16 Jul 2020 04:26:04 -0400 Subject: [PATCH 2/6] maybe? --- CMakeLists.txt | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91d045f0..95da0682 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_definitions(-DASIO_STANDALONE) -if (${isAzure}) +if (DEFINED ${isAzure}) if (WIN32 OR APPLE) include(external/FindLibObs.cmake) endif() @@ -57,12 +57,12 @@ find_package(Qt5 REQUIRED COMPONENTS Core Widgets) #qt5_add_resources(midi_qrc_sources src/Forms/midi.qrc) include_directories( - "${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api" - + "${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api" SYSTEM - ${Qt5Core_INCLUDES} - ${Qt5Widgets_INCLUDES} + ${Qt5Core_INCLUDES} + ${Qt5Widgets_INCLUDES} "${CMAKE_SOURCE_DIR}/UI") + execute_process( COMMAND git rev-parse --abbrev-ref HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} @@ -82,9 +82,11 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/version.h ) + + set(obs-midi_SOURCES -${midi_ui_headers} - src/utils.cpp + ${midi_ui_headers} + src/utils.cpp src/config.cpp src/midi-agent.cpp src/device-manager.cpp @@ -107,8 +109,8 @@ list(APPEND obs-midi_HEADERS src/obs-midi.h src/events.h src/rpc/RpcEvent.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/version.h - #"${CMAKE_SOURCE_DIR}/UI/window-control.hpp" + src/version.h + ) set(obs-midi_UI @@ -122,7 +124,7 @@ add_library(obs-midi MODULE ${obs-midi_HEADERS}) set_target_properties(obs-midi PROPERTIES FOLDER "plugins/obs-midi") set_target_properties(RtMidi17 PROPERTIES FOLDER "plugins/obs-midi") -if (${isAzure}) +if (DEFINED ${isAzure}) if(WIN32 OR LINUX) @@ -144,12 +146,12 @@ else() Qt5::Widgets libobs) endif() -endif() +endif()#azure # --- Windows-specific build settings and tasks --- if(WIN32) - if (${isAzure}) + if (DEFINED ${isAzure}) if(NOT DEFINED OBS_FRONTEND_LIB) set(OBS_FRONTEND_LIB "OBS_FRONTEND_LIB-NOTFOUND" CACHE FILEPATH "OBS frontend library") message(FATAL_ERROR "Could not find OBS Frontend API's library !") From 9d98697f527a83436e1f65329c762eb47c36e090 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Thu, 16 Jul 2020 04:30:26 -0400 Subject: [PATCH 3/6] maybe 2? --- CMakeLists.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95da0682..599b5f54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_definitions(-DASIO_STANDALONE) -if (DEFINED ${isAzure}) +if (${isAzure}) if (WIN32 OR APPLE) include(external/FindLibObs.cmake) endif() @@ -124,7 +124,7 @@ add_library(obs-midi MODULE ${obs-midi_HEADERS}) set_target_properties(obs-midi PROPERTIES FOLDER "plugins/obs-midi") set_target_properties(RtMidi17 PROPERTIES FOLDER "plugins/obs-midi") -if (DEFINED ${isAzure}) +if ( ${isAzure}) if(WIN32 OR LINUX) @@ -151,7 +151,7 @@ endif()#azure if(WIN32) - if (DEFINED ${isAzure}) + if (${isAzure}) if(NOT DEFINED OBS_FRONTEND_LIB) set(OBS_FRONTEND_LIB "OBS_FRONTEND_LIB-NOTFOUND" CACHE FILEPATH "OBS frontend library") message(FATAL_ERROR "Could not find OBS Frontend API's library !") @@ -282,5 +282,8 @@ if(APPLE) target_link_libraries(obs-midi "${OBS_FRONTEND_LIB}") endif() # -- End of section -- - +if(NOT DEFINED ${isAzure}) + target_link_libraries(obs-midi obs-frontend-api ${obs-midi_DEPS} Qt5::Core Qt5::Widgets libobs) + install_obs_plugin_with_data(obs-midi data) +endif() From 057ce456329c2416a3988e6fe753a03bf201e298 Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Thu, 16 Jul 2020 04:34:47 -0400 Subject: [PATCH 4/6] maybe 3 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 599b5f54..2a0ef4d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -282,7 +282,7 @@ if(APPLE) target_link_libraries(obs-midi "${OBS_FRONTEND_LIB}") endif() # -- End of section -- -if(NOT DEFINED ${isAzure}) +if(NOT ${isAzure}) target_link_libraries(obs-midi obs-frontend-api ${obs-midi_DEPS} Qt5::Core Qt5::Widgets libobs) install_obs_plugin_with_data(obs-midi data) endif() From d27f90bf4a17e64df2580a19963c8479bd521ffb Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Thu, 16 Jul 2020 04:49:10 -0400 Subject: [PATCH 5/6] revert test? --- CMakeLists.txt | 112 ++++++++++++++++--------------------------------- 1 file changed, 36 insertions(+), 76 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a0ef4d1..f84ae7b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,14 +24,11 @@ endif() # RTMIDI add_subdirectory(src/RtMidi17) - set(obs-midi_DEPS RtMidi17) - include_directories(src/RtMidi17) - # OBS MIDI set(CMAKE_PREFIX_PATH "${QTDIR}") set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -55,89 +52,61 @@ endif() find_package(Qt5 REQUIRED COMPONENTS Core Widgets) -#qt5_add_resources(midi_qrc_sources src/Forms/midi.qrc) include_directories( - "${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api" + "${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api" SYSTEM - ${Qt5Core_INCLUDES} - ${Qt5Widgets_INCLUDES} + ${Qt5Core_INCLUDES} + ${Qt5Widgets_INCLUDES} "${CMAKE_SOURCE_DIR}/UI") - -execute_process( - COMMAND git rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE GIT_BRANCH - OUTPUT_STRIP_TRAILING_WHITESPACE -) - -# Get the latest abbreviated commit hash of the working branch -execute_process( - COMMAND git log -1 --format=%h - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT_VARIABLE GIT_COMMIT_HASH - OUTPUT_STRIP_TRAILING_WHITESPACE -) - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/include/version.h.in - ${CMAKE_CURRENT_SOURCE_DIR}/src/version.h -) - set(obs-midi_SOURCES - ${midi_ui_headers} - src/utils.cpp + src/utils.cpp src/config.cpp src/midi-agent.cpp src/device-manager.cpp src/obs-controller.cpp - src/forms/settings-dialog.cpp + src/forms/settings-dialog.cpp src/forms/configwindow.cpp - src/obs-midi.cpp + src/obs-midi.cpp src/events.cpp src/rpc/RpcEvent.cpp - ) -list(APPEND obs-midi_HEADERS - src/utils.h - src/config.h - src/midi-agent.h - src/device-manager.h - src/obs-controller.h - src/forms/settings-dialog.h - src/forms/configwindow.h - src/obs-midi.h - src/events.h - src/rpc/RpcEvent.h - src/version.h - ) -set(obs-midi_UI - src/forms/settings-dialog.ui - src/forms/configwindow.ui +list(APPEND obs-midi_HEADERS + src/utils.h + src/config.h + src/midi-agent.h + src/device-manager.h + src/obs-controller.h + src/forms/settings-dialog.h + src/forms/configwindow.h + src/obs-midi.h + src/events.h + src/rpc/RpcEvent.h ) -qt5_wrap_ui(obs-midi_UI_HEADERS ${obs-midi_UI}) + add_library(obs-midi MODULE - ${obs-midi_UI_HEADERS} ${obs-midi_SOURCES} ${obs-midi_HEADERS}) -set_target_properties(obs-midi PROPERTIES FOLDER "plugins/obs-midi") -set_target_properties(RtMidi17 PROPERTIES FOLDER "plugins/obs-midi") -if ( ${isAzure}) -if(WIN32 OR LINUX) +if(WIN32 OR LINUX) + if (${isAzure}) target_link_libraries(obs-midi "${OBS_FRONTEND_LIB}" ${obs-midi_DEPS} Qt5::Core Qt5::Widgets - libobs - window-control) - - - + libobs) + else() + target_link_libraries(obs-midi + obs-frontend-api + ${obs-midi_DEPS} + Qt5::Core + Qt5::Widgets + libobs) + endif() else() target_link_libraries(obs-midi "${OBS_FRONTEND_LIB}" @@ -146,12 +115,10 @@ else() Qt5::Widgets libobs) endif() -endif()#azure +if (${isAzure}) # --- Windows-specific build settings and tasks --- - - -if(WIN32) - if (${isAzure}) + message(WARNING "IS AZURE") + if(WIN32) if(NOT DEFINED OBS_FRONTEND_LIB) set(OBS_FRONTEND_LIB "OBS_FRONTEND_LIB-NOTFOUND" CACHE FILEPATH "OBS frontend library") message(FATAL_ERROR "Could not find OBS Frontend API's library !") @@ -246,12 +213,10 @@ if(WIN32) ) # --- End of sub-section --- - - endif()# -- End of if AZURE - - -endif()# --- End of win--- - + endif() + # --- End of section --- +endif() +# -- End of if AZURE # --- Linux-specific build settings and tasks --- if(UNIX AND NOT APPLE) @@ -282,8 +247,3 @@ if(APPLE) target_link_libraries(obs-midi "${OBS_FRONTEND_LIB}") endif() # -- End of section -- -if(NOT ${isAzure}) - target_link_libraries(obs-midi obs-frontend-api ${obs-midi_DEPS} Qt5::Core Qt5::Widgets libobs) - install_obs_plugin_with_data(obs-midi data) -endif() - From 04a3c44a91e1138294238b15fe73958f76ddb05c Mon Sep 17 00:00:00 2001 From: "Christopher P. Yarger" Date: Thu, 16 Jul 2020 05:05:22 -0400 Subject: [PATCH 6/6] hmm redo? --- CMakeLists.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f84ae7b6..0303aafc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,28 @@ if(WIN32) set(MODULE_DESCRIPTION "OBS MIDI module") endif() +# Version bits +execute_process( + COMMAND git rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +# Get the latest abbreviated commit hash of the working branch +execute_process( + COMMAND git log -1 --format=%h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_COMMIT_HASH + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/include/version.h.in + ${CMAKE_CURRENT_SOURCE_DIR}/src/version.h +) + + ################## # THE GOOD STUFF # ##################