Эх сурвалжийг харах

cmake: Update CMake files to current state found on obs-studio

PatTheMav 10 сар өмнө
parent
commit
5da535ca68

+ 0 - 8
.github/scripts/build-ubuntu

@@ -203,14 +203,6 @@ ${_usage_host:-}"
         local cmake_version
         read -r _ _ cmake_version <<< "$(cmake --version)"
 
-        if [[ ${CPUTYPE} != ${target##*-} ]] {
-          if is-at-least 3.21.0 ${cmake_version}; then
-            cmake_args+=(--toolchain "${project_root}/cmake/linux/toolchains/${target##*-}-linux-gcc.cmake")
-          else
-            cmake_args+=(-D"CMAKE_TOOLCHAIN_FILE=${project_root}/cmake/linux/toolchains/${target##*-}-linux-gcc.cmake")
-          fi
-        }
-
         cmake_build_args+=(--preset ${_preset}-${target##*-} --config ${config})
         if [[ ${generator} == 'Unix Makefiles' ]] {
           cmake_build_args+=(--parallel $(( $(nproc) + 1 )))

+ 6 - 6
CMakeLists.txt

@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.16...3.26)
+cmake_minimum_required(VERSION 3.28...3.30)
 
 include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/bootstrap.cmake" NO_POLICY_SCOPE)
 
@@ -25,13 +25,13 @@ if(ENABLE_QT)
   find_package(Qt6 COMPONENTS Widgets Core)
   target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets)
   target_compile_options(
-    ${CMAKE_PROJECT_NAME} PRIVATE $<$<C_COMPILER_ID:Clang,AppleClang>:-Wno-quoted-include-in-framework-header
-                                  -Wno-comma>)
+    ${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)
+    PROPERTIES AUTOMOC ON AUTOUIC ON AUTORCC ON
+  )
 endif()
 
 target_sources(${CMAKE_PROJECT_NAME} PRIVATE src/plugin-main.c)

+ 26 - 66
CMakePresets.json

@@ -1,8 +1,8 @@
 {
-  "version": 3,
+  "version": 8,
   "cmakeMinimumRequired": {
     "major": 3,
-    "minor": 22,
+    "minor": 28,
     "patch": 0
   },
   "configurePresets": [
@@ -29,6 +29,7 @@
       "warnings": {"dev": true, "deprecated": true},
       "cacheVariables": {
         "CMAKE_OSX_DEPLOYMENT_TARGET": "11.0",
+        "CMAKE_OSX_ARCHITECTURES": "arm64;x86_64",
         "CODESIGN_IDENTITY": "$penv{CODESIGN_IDENT}",
         "CODESIGN_TEAM": "$penv{CODESIGN_TEAM}"
       }
@@ -40,7 +41,8 @@
       "description": "Build for macOS 11.0+ (Universal binary) for CI",
       "generator": "Xcode",
       "cacheVariables": {
-        "CMAKE_COMPILE_WARNING_AS_ERROR": true
+        "CMAKE_COMPILE_WARNING_AS_ERROR": true,
+        "ENABLE_CCACHE": true
       }
     },
     {
@@ -55,11 +57,8 @@
         "rhs": "Windows"
       },
       "generator": "Visual Studio 17 2022",
-      "architecture": "x64",
-      "warnings": {"dev": true, "deprecated": true},
-      "cacheVariables": {
-        "CMAKE_SYSTEM_VERSION": "10.0.18363.657"
-      }
+      "architecture": "x64,version=10.0.22621",
+      "warnings": {"dev": true, "deprecated": true}
     },
     {
       "name": "windows-ci-x64",
@@ -71,9 +70,9 @@
       }
     },
     {
-      "name": "linux-x86_64",
-      "displayName": "Linux x86_64",
-      "description": "Build for Linux x86_64",
+      "name": "ubuntu-x86_64",
+      "displayName": "Ubuntu x86_64",
+      "description": "Build for Ubuntu x86_64",
       "inherits": ["template"],
       "binaryDir": "${sourceDir}/build_x86_64",
       "condition": {
@@ -83,45 +82,20 @@
       },
       "generator": "Ninja",
       "warnings": {"dev": true, "deprecated": true},
-      "cacheVariables": {
-        "CMAKE_BUILD_TYPE": "RelWithDebInfo"
-      }
-    },
-    {
-      "name": "linux-ci-x86_64",
-      "inherits": ["linux-x86_64"],
-      "displayName": "Linux x86_64 CI build",
-      "description": "Build for Linux x86_64 on CI",
       "cacheVariables": {
         "CMAKE_BUILD_TYPE": "RelWithDebInfo",
-        "CMAKE_COMPILE_WARNING_AS_ERROR": true
+        "CMAKE_INSTALL_LIBDIR": "lib/CMAKE_SYSTEM_PROCESSOR-linux-gnu"
       }
     },
     {
-      "name": "linux-aarch64",
-      "displayName": "Linux aarch64",
-      "description": "Build for Linux aarch64",
-      "inherits": ["template"],
-      "binaryDir": "${sourceDir}/build_aarch64",
-      "condition": {
-        "type": "equals",
-        "lhs": "${hostSystemName}",
-        "rhs": "Linux"
-      },
-      "generator": "Ninja",
-      "warnings": {"dev": true, "deprecated": true},
-      "cacheVariables": {
-        "CMAKE_BUILD_TYPE": "RelWithDebInfo"
-      }
-    },
-    {
-      "name": "linux-ci-aarch64",
-      "inherits": ["linux-aarch64"],
-      "displayName": "Linux aarch64 CI build",
-      "description": "Build for Linux aarch64 on CI",
+      "name": "ubuntu-ci-x86_64",
+      "inherits": ["ubuntu-x86_64"],
+      "displayName": "Ubuntu x86_64 CI build",
+      "description": "Build for Ubuntu x86_64 on CI",
       "cacheVariables": {
         "CMAKE_BUILD_TYPE": "RelWithDebInfo",
-        "CMAKE_COMPILE_WARNING_AS_ERROR": true
+        "CMAKE_COMPILE_WARNING_AS_ERROR": true,
+        "ENABLE_CCACHE": true
       }
     }
   ],
@@ -131,7 +105,7 @@
       "configurePreset": "macos",
       "displayName": "macOS Universal",
       "description": "macOS build for Universal architectures",
-      "configuration": "Release"
+      "configuration": "RelWithDebInfo"
     },
     {
       "name": "macos-ci",
@@ -155,31 +129,17 @@
       "configuration": "RelWithDebInfo"
     },
     {
-      "name": "linux-x86_64",
-      "configurePreset": "linux-x86_64",
-      "displayName": "Linux x86_64",
-      "description": "Linux build for x86_64",
-      "configuration": "RelWithDebInfo"
-    },
-    {
-      "name": "linux-ci-x86_64",
-      "configurePreset": "linux-ci-x86_64",
-      "displayName": "Linux x86_64 CI",
-      "description": "Linux CI build for x86_64",
-      "configuration": "RelWithDebInfo"
-    },
-    {
-      "name": "linux-aarch64",
-      "configurePreset": "linux-aarch64",
-      "displayName": "Linux aarch64",
-      "description": "Linux build for aarch64",
+      "name": "ubuntu-x86_64",
+      "configurePreset": "ubuntu-x86_64",
+      "displayName": "Ubuntu x86_64",
+      "description": "Ubuntu build for x86_64",
       "configuration": "RelWithDebInfo"
     },
     {
-      "name": "linux-ci-aarch64",
-      "configurePreset": "linux-ci-aarch64",
-      "displayName": "Linux aarch64 CI",
-      "description": "Linux CI build for aarch64",
+      "name": "ubuntu-ci-x86_64",
+      "configurePreset": "ubuntu-ci-x86_64",
+      "displayName": "Ubuntu x86_64 CI",
+      "description": "Ubuntu CI build for x86_64",
       "configuration": "RelWithDebInfo"
     }
   ]

+ 14 - 17
buildspec.json

@@ -1,48 +1,45 @@
 {
     "dependencies": {
         "obs-studio": {
-            "version": "30.1.2",
+            "version": "31.0.0",
             "baseUrl": "https://github.com/obsproject/obs-studio/archive/refs/tags",
             "label": "OBS sources",
             "hashes": {
-                "macos": "490bae1c392b3b344b0270afd8cb887da4bc50bd92c0c426e96713c1ccb9701a",
-                "windows-x64": "c2dd03fa7fd01fad5beafce8f7156da11f9ed9a588373fd40b44a06f4c03b867"
+                "macos": "a22966ff07aba38833ba57c36c9e0d190d083be5dec5048d0a60cd9e6b997242",
+                "windows-x64": "e8434dcee06f1702f0a0bbd1489296c77116fc51356835c3af4a6ed21b1e1c74"
             }
         },
         "prebuilt": {
-            "version": "2024-03-19",
+            "version": "2024-09-12",
             "baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
             "label": "Pre-Built obs-deps",
             "hashes": {
-                "macos": "2e9bfb55a5e0e4c1086fa1fda4cf268debfead473089df2aaea80e1c7a3ca7ff",
-                "windows-x64": "6e86068371526a967e805f6f9903f9407adb683c21820db5f07da8f30d11e998"
+                "macos": "c857b211ee378772994b632036e1e5befe66b37e85286cb8e3cefc1435d5220a",
+                "windows-x64": "d4a4f194591766891ad3c0b267deec3c4b85239c8fe557273559927456aeedbb"
             }
         },
         "qt6": {
-            "version": "2024-03-19",
+            "version": "2024-09-12",
             "baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
             "label": "Pre-Built Qt6",
             "hashes": {
-                "macos": "694f1e639c017e3b1f456f735330dc5afae287cbea85757101af1368de3142c8",
-                "windows-x64": "72d1df34a0ef7413a681d5fcc88cae81da60adc03dcd23ef17862ab170bcc0dd"
+                "macos": "34a2de6b7f4d4d58fc5a15a4dba49a61d81a4045d0cedfc1a1f08c0dfb8047cf",
+                "windows-x64": "4d15ce13dbb0a8a2cabcce5ae0da5e80ee589b482a61b2025378465c1da32c4f"
             },
             "debugSymbols": {
-                "windows-x64": "fbddd1f659c360f2291911ac5709b67b6f8182e6bca519d24712e4f6fd3cc865"
+                "windows-x64": "dad2351a5c9cd438168e1ed8fb453a2534532252edb555f1001a5e8eb3f1bbd4"
             }
         }
     },
     "platformConfig": {
         "macos": {
-            "bundleId": "com.example.obs-plugintemplate"
+            "bundleId": "com.example.plugintemplate-for-obs"
         }
     },
-    "name": "obs-plugintemplate",
-    "displayName": "OBS Plugin Template",
+    "name": "plugintemplate-for-obs",
+    "displayName": "Plugin Template for OBS",
     "version": "1.0.0",
     "author": "Your Name Here",
     "website": "https://example.com",
-    "email": "me@example.com",
-    "uuids": {
-        "windowsApp": "00000000-0000-0000-0000-000000000000"
-    }
+    "email": "me@example.com"
 }

+ 52 - 37
cmake/common/bootstrap.cmake

@@ -1,56 +1,56 @@
-cmake_minimum_required(VERSION 3.16...3.26)
+# Plugin bootstrap module
 
 include_guard(GLOBAL)
 
-# Enable automatic PUSH and POP of policies to parent scope
-if(POLICY CMP0011)
-  cmake_policy(SET CMP0011 NEW)
-endif()
-
-# Enable distinction between Clang and AppleClang
-if(POLICY CMP0025)
-  cmake_policy(SET CMP0025 NEW)
-endif()
-
-# Enable strict checking of "break()" usage
-if(POLICY CMP0055)
-  cmake_policy(SET CMP0055 NEW)
-endif()
-
-# Honor visibility presets for all target types (executable, shared, module, static)
-if(POLICY CMP0063)
-  cmake_policy(SET CMP0063 NEW)
-endif()
-
-# Disable export function calls to populate package registry by default
-if(POLICY CMP0090)
-  cmake_policy(SET CMP0090 NEW)
-endif()
+# Map fallback configurations for optimized build configurations
+# gersemi: off
+set(
+  CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO
+    RelWithDebInfo
+    Release
+    MinSizeRel
+    None
+    ""
+)
+set(
+  CMAKE_MAP_IMPORTED_CONFIG_MINSIZEREL
+    MinSizeRel
+    Release
+    RelWithDebInfo
+    None
+    ""
+)
+set(
+  CMAKE_MAP_IMPORTED_CONFIG_RELEASE
+    Release
+    RelWithDebInfo
+    MinSizeRel
+    None
+    ""
+)
+# gersemi: on
 
 # Prohibit in-source builds
 if("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
-  message(FATAL_ERROR "In-source builds are not supported. "
-                      "Specify a build directory via 'cmake -S <SOURCE DIRECTORY> -B <BUILD_DIRECTORY>' instead.")
+  message(
+    FATAL_ERROR
+    "In-source builds are not supported. "
+    "Specify a build directory via 'cmake -S <SOURCE DIRECTORY> -B <BUILD_DIRECTORY>' instead."
+  )
   file(REMOVE_RECURSE "${CMAKE_CURRENT_SOURCE_DIR}/CMakeCache.txt" "${CMAKE_CURRENT_SOURCE_DIR}/CMakeFiles")
 endif()
 
-# Use folders for source file organization with IDE generators (Visual Studio/Xcode)
-set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-
 # Add common module directories to default search path
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/common")
 
 file(READ "${CMAKE_CURRENT_SOURCE_DIR}/buildspec.json" buildspec)
 
-# cmake-format: off
 string(JSON _name GET ${buildspec} name)
 string(JSON _website GET ${buildspec} website)
 string(JSON _author GET ${buildspec} author)
 string(JSON _email GET ${buildspec} email)
 string(JSON _version GET ${buildspec} version)
 string(JSON _bundleId GET ${buildspec} platformConfig macos bundleId)
-string(JSON _windowsAppUUID GET ${buildspec} uuids windowsApp)
-# cmake-format: on
 
 set(PLUGIN_AUTHOR ${_author})
 set(PLUGIN_WEBSITE ${_website})
@@ -58,15 +58,30 @@ set(PLUGIN_EMAIL ${_email})
 set(PLUGIN_VERSION ${_version})
 set(MACOS_BUNDLEID ${_bundleId})
 
+string(REPLACE "." ";" _version_canonical "${_version}")
+list(GET _version_canonical 0 PLUGIN_VERSION_MAJOR)
+list(GET _version_canonical 1 PLUGIN_VERSION_MINOR)
+list(GET _version_canonical 2 PLUGIN_VERSION_PATCH)
+unset(_version_canonical)
+
 include(buildnumber)
 include(osconfig)
 
 # Allow selection of common build types via UI
-if(NOT CMAKE_BUILD_TYPE)
-  set(CMAKE_BUILD_TYPE
+if(NOT CMAKE_GENERATOR MATCHES "(Xcode|Visual Studio .+)")
+  if(NOT CMAKE_BUILD_TYPE)
+    set(
+      CMAKE_BUILD_TYPE
       "RelWithDebInfo"
-      CACHE STRING "OBS build type [Release, RelWithDebInfo, Debug, MinSizeRel]" FORCE)
-  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Release RelWithDebInfo Debug MinSizeRel)
+      CACHE STRING
+      "OBS build type [Release, RelWithDebInfo, Debug, MinSizeRel]"
+      FORCE
+    )
+    set_property(
+      CACHE CMAKE_BUILD_TYPE
+      PROPERTY STRINGS Release RelWithDebInfo Debug MinSizeRel
+    )
+  endif()
 endif()
 
 # Disable exports automatically going into the CMake package registry

+ 20 - 17
cmake/common/buildnumber.cmake

@@ -3,25 +3,28 @@
 include_guard(GLOBAL)
 
 # Define build number cache file
-set(_BUILD_NUMBER_CACHE
-    "${CMAKE_CURRENT_SOURCE_DIR}/cmake/.CMakeBuildNumber"
-    CACHE INTERNAL "OBS build number cache file")
+set(
+  _BUILD_NUMBER_CACHE
+  "${CMAKE_CURRENT_SOURCE_DIR}/cmake/.CMakeBuildNumber"
+  CACHE INTERNAL
+  "OBS build number cache file"
+)
 
 # Read build number from cache file or manual override
-if(NOT DEFINED PLUGIN_BUILD_NUMBER AND EXISTS "${_BUILD_NUMBER_CACHE}")
-  file(READ "${_BUILD_NUMBER_CACHE}" PLUGIN_BUILD_NUMBER)
-  math(EXPR PLUGIN_BUILD_NUMBER "${PLUGIN_BUILD_NUMBER}+1")
-elseif(NOT DEFINED PLUGIN_BUILD_NUMBER)
-  if($ENV{CI})
-    if($ENV{GITHUB_RUN_ID})
-      set(PLUGIN_BUILD_NUMBER "$ENV{GITHUB_RUN_ID}")
-    elseif($ENV{GITLAB_RUN_ID})
-      set(PLUGIN_BUILD_NUMBER "$ENV{GITLAB_RUN_ID}")
-    else()
-      set(PLUGIN_BUILD_NUMBER "1")
-    endif()
+if(NOT DEFINED PLUGIN_BUILD_NUMBER)
+  if(EXISTS "${_BUILD_NUMBER_CACHE}")
+    file(READ "${_BUILD_NUMBER_CACHE}" PLUGIN_BUILD_NUMBER)
+    math(EXPR PLUGIN_BUILD_NUMBER "${PLUGIN_BUILD_NUMBER}+1")
   else()
-    set(PLUGIN_BUILD_NUMBER "1")
+    if("$ENV{CI}")
+      if("$ENV{GITHUB_RUN_ID}")
+        set(PLUGIN_BUILD_NUMBER "$ENV{GITHUB_RUN_ID}")
+      elseif("$ENV{GITLAB_RUN_ID}")
+        set(PLUGIN_BUILD_NUMBER "$ENV{GITLAB_RUN_ID}")
+      else()
+        set(PLUGIN_BUILD_NUMBER "1")
+      endif()
+    endif()
   endif()
+  file(WRITE "${_BUILD_NUMBER_CACHE}" "${PLUGIN_BUILD_NUMBER}")
 endif()
-file(WRITE "${_BUILD_NUMBER_CACHE}" "${PLUGIN_BUILD_NUMBER}")

+ 74 - 62
cmake/common/buildspec_common.cmake

@@ -1,26 +1,15 @@
 # Common build dependencies module
 
-# cmake-format: off
-# cmake-lint: disable=C0103
-# cmake-lint: disable=E1126
-# cmake-lint: disable=R0912
-# cmake-lint: disable=R0915
-# cmake-format: on
-
 include_guard(GLOBAL)
 
 # _check_deps_version: Checks for obs-deps VERSION file in prefix paths
 function(_check_deps_version version)
-  # cmake-format: off
-  set(found FALSE PARENT_SCOPE)
-  # cmake-format: on
+  set(found FALSE)
 
   foreach(path IN LISTS CMAKE_PREFIX_PATH)
     if(EXISTS "${path}/share/obs-deps/VERSION")
       if(dependency STREQUAL qt6 AND NOT EXISTS "${path}/lib/cmake/Qt6/Qt6Config.cmake")
-        # cmake-format: off
-        set(found FALSE PARENT_SCOPE)
-        # cmake-format: on
+        set(found FALSE)
         continue()
       endif()
 
@@ -30,29 +19,31 @@ function(_check_deps_version version)
       string(REPLACE "-" "." version "${version}")
 
       if(_check_version VERSION_EQUAL version)
-        # cmake-format: off
-        set(found TRUE PARENT_SCOPE)
-        # cmake-format: on
+        set(found TRUE)
         break()
       elseif(_check_version VERSION_LESS version)
-        message(AUTHOR_WARNING "Older ${label} version detected in ${path}: \n"
-                               "Found ${_check_version}, require ${version}")
+        message(
+          AUTHOR_WARNING
+          "Older ${label} version detected in ${path}: \n"
+          "Found ${_check_version}, require ${version}"
+        )
         list(REMOVE_ITEM CMAKE_PREFIX_PATH "${path}")
         list(APPEND CMAKE_PREFIX_PATH "${path}")
-        # cmake-format: off
-        set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE)
-        # cmake-format: on
+        set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH})
         continue()
       else()
-        message(AUTHOR_WARNING "Newer ${label} version detected in ${path}: \n"
-                               "Found ${_check_version}, require ${version}")
-        # cmake-format: off
-        set(found TRUE PARENT_SCOPE)
-        # cmake-format: on
+        message(
+          AUTHOR_WARNING
+          "Newer ${label} version detected in ${path}: \n"
+          "Found ${_check_version}, require ${version}"
+        )
+        set(found TRUE)
         break()
       endif()
     endif()
   endforeach()
+
+  return(PROPAGATE found CMAKE_PREFIX_PATH)
 endfunction()
 
 # _setup_obs_studio: Create obs-studio build project, then build libobs and obs-frontend-api
@@ -63,14 +54,12 @@ function(_setup_obs_studio)
 
   if(OS_WINDOWS)
     set(_cmake_generator "${CMAKE_GENERATOR}")
-    set(_cmake_arch "-A ${arch}")
+    set(_cmake_arch "-A ${arch},version=${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
     set(_cmake_extra "-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION} -DCMAKE_ENABLE_SCRIPTING=OFF")
-    set(_cmake_version "2.0.0")
   elseif(OS_MACOS)
     set(_cmake_generator "Xcode")
     set(_cmake_arch "-DCMAKE_OSX_ARCHITECTURES:STRING='arm64;x86_64'")
     set(_cmake_extra "-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
-    set(_cmake_version "3.0.0")
   endif()
 
   message(STATUS "Configure ${label} (${arch})")
@@ -78,55 +67,68 @@ function(_setup_obs_studio)
     COMMAND
       "${CMAKE_COMMAND}" -S "${dependencies_dir}/${_obs_destination}" -B
       "${dependencies_dir}/${_obs_destination}/build_${arch}" -G ${_cmake_generator} "${_cmake_arch}"
-      -DOBS_CMAKE_VERSION:STRING=${_cmake_version} -DENABLE_PLUGINS:BOOL=OFF -DENABLE_UI:BOOL=OFF
+      -DOBS_CMAKE_VERSION:STRING=3.0.0 -DENABLE_PLUGINS:BOOL=OFF -DENABLE_UI:BOOL=OFF
       -DOBS_VERSION_OVERRIDE:STRING=${_obs_version} "-DCMAKE_PREFIX_PATH='${CMAKE_PREFIX_PATH}'" ${_is_fresh}
       ${_cmake_extra}
-    RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
-    OUTPUT_QUIET)
+    RESULT_VARIABLE _process_result
+    COMMAND_ERROR_IS_FATAL ANY
+    OUTPUT_QUIET
+  )
   message(STATUS "Configure ${label} (${arch}) - done")
 
-  message(STATUS "Build ${label} (${arch})")
+  message(STATUS "Build ${label} (Debug - ${arch})")
   execute_process(
     COMMAND "${CMAKE_COMMAND}" --build build_${arch} --target obs-frontend-api --config Debug --parallel
     WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
-    RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
-    OUTPUT_QUIET)
-  message(STATUS "Build ${label} (${arch}) - done")
+    RESULT_VARIABLE _process_result
+    COMMAND_ERROR_IS_FATAL ANY
+    OUTPUT_QUIET
+  )
+  message(STATUS "Build ${label} (Debug - ${arch}) - done")
+
+  message(STATUS "Build ${label} (Release - ${arch})")
+  execute_process(
+    COMMAND "${CMAKE_COMMAND}" --build build_${arch} --target obs-frontend-api --config Release --parallel
+    WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
+    RESULT_VARIABLE _process_result
+    COMMAND_ERROR_IS_FATAL ANY
+    OUTPUT_QUIET
+  )
+  message(STATUS "Build ${label} (Reelase - ${arch}) - done")
 
   message(STATUS "Install ${label} (${arch})")
-  if(OS_WINDOWS)
-    set(_cmake_extra "--component obs_libraries")
-  else()
-    set(_cmake_extra "")
-  endif()
   execute_process(
-    COMMAND "${CMAKE_COMMAND}" --install build_${arch} --component Development --config Debug --prefix
-            "${dependencies_dir}" ${_cmake_extra}
+    COMMAND
+      "${CMAKE_COMMAND}" --install build_${arch} --component Development --config Debug --prefix "${dependencies_dir}"
+    WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
+    RESULT_VARIABLE _process_result
+    COMMAND_ERROR_IS_FATAL ANY
+    OUTPUT_QUIET
+  )
+  execute_process(
+    COMMAND
+      "${CMAKE_COMMAND}" --install build_${arch} --component Development --config Release --prefix "${dependencies_dir}"
     WORKING_DIRECTORY "${dependencies_dir}/${_obs_destination}"
-    RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY
-    OUTPUT_QUIET)
+    RESULT_VARIABLE _process_result
+    COMMAND_ERROR_IS_FATAL ANY
+    OUTPUT_QUIET
+  )
   message(STATUS "Install ${label} (${arch}) - done")
 endfunction()
 
 # _check_dependencies: Fetch and extract pre-built OBS build dependencies
 function(_check_dependencies)
-  if(NOT buildspec)
-    file(READ "${CMAKE_CURRENT_SOURCE_DIR}/buildspec.json" buildspec)
-  endif()
+  file(READ "${CMAKE_CURRENT_SOURCE_DIR}/buildspec.json" buildspec)
 
-  # cmake-format: off
   string(JSON dependency_data GET ${buildspec} dependencies)
-  # cmake-format: on
 
   foreach(dependency IN LISTS dependencies_list)
-    # cmake-format: off
     string(JSON data GET ${dependency_data} ${dependency})
     string(JSON version GET ${data} version)
     string(JSON hash GET ${data} hashes ${platform})
     string(JSON url GET ${data} baseUrl)
     string(JSON label GET ${data} label)
     string(JSON revision ERROR_VARIABLE error GET ${data} revision ${platform})
-    # cmake-format: on
 
     message(STATUS "Setting up ${label} (${arch})")
 
@@ -144,12 +146,22 @@ function(_check_dependencies)
       string(REPLACE "-REVISION" "" file "${file}")
     endif()
 
+    if(EXISTS "${dependencies_dir}/.dependency_${dependency}_${arch}.sha256")
+      file(
+        READ
+        "${dependencies_dir}/.dependency_${dependency}_${arch}.sha256"
+        OBS_DEPENDENCY_${dependency}_${arch}_HASH
+      )
+    endif()
+
     set(skip FALSE)
     if(dependency STREQUAL prebuilt OR dependency STREQUAL qt6)
-      _check_deps_version(${version})
+      if(OBS_DEPENDENCY_${dependency}_${arch}_HASH STREQUAL ${hash})
+        _check_deps_version(${version})
 
-      if(found)
-        set(skip TRUE)
+        if(found)
+          set(skip TRUE)
+        endif()
       endif()
     endif()
 
@@ -166,10 +178,7 @@ function(_check_dependencies)
 
     if(NOT EXISTS "${dependencies_dir}/${file}")
       message(STATUS "Downloading ${url}")
-      file(
-        DOWNLOAD "${url}" "${dependencies_dir}/${file}"
-        STATUS download_status
-        EXPECTED_HASH SHA256=${hash})
+      file(DOWNLOAD "${url}" "${dependencies_dir}/${file}" STATUS download_status EXPECTED_HASH SHA256=${hash})
 
       list(GET download_status 0 error_code)
       list(GET download_status 1 error_message)
@@ -182,6 +191,10 @@ function(_check_dependencies)
       endif()
     endif()
 
+    if(NOT OBS_DEPENDENCY_${dependency}_${arch}_HASH STREQUAL ${hash})
+      file(REMOVE_RECURSE "${dependencies_dir}/${destination}")
+    endif()
+
     if(NOT EXISTS "${dependencies_dir}/${destination}")
       file(MAKE_DIRECTORY "${dependencies_dir}/${destination}")
       if(dependency STREQUAL obs-studio)
@@ -191,6 +204,8 @@ function(_check_dependencies)
       endif()
     endif()
 
+    file(WRITE "${dependencies_dir}/.dependency_${dependency}_${arch}.sha256" "${hash}")
+
     if(dependency STREQUAL prebuilt)
       list(APPEND CMAKE_PREFIX_PATH "${dependencies_dir}/${destination}")
     elseif(dependency STREQUAL qt6)
@@ -199,7 +214,6 @@ function(_check_dependencies)
       set(_obs_version ${version})
       set(_obs_destination "${destination}")
       list(APPEND CMAKE_PREFIX_PATH "${dependencies_dir}")
-
     endif()
 
     message(STATUS "Setting up ${label} (${arch}) - done")
@@ -207,9 +221,7 @@ function(_check_dependencies)
 
   list(REMOVE_DUPLICATES CMAKE_PREFIX_PATH)
 
-  # cmake-format: off
   set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} CACHE PATH "CMake prefix search path" FORCE)
-  # cmake-format: on
 
   _setup_obs_studio()
 endfunction()

+ 7 - 4
cmake/common/ccache.cmake

@@ -1,16 +1,17 @@
-# CMake ccache module
+# OBS CMake ccache module
 
 include_guard(GLOBAL)
 
 if(NOT DEFINED CCACHE_PROGRAM)
-  message(DEBUG "Trying to find ccache on build host...")
+  message(DEBUG "Trying to find ccache on build host")
   find_program(CCACHE_PROGRAM "ccache")
   mark_as_advanced(CCACHE_PROGRAM)
 endif()
 
 if(CCACHE_PROGRAM)
-  message(DEBUG "Ccache found as ${CCACHE_PROGRAM}...")
-  option(ENABLE_CCACHE "Enable compiler acceleration with ccache" ON)
+  message(DEBUG "Trying to find ccache on build host - done")
+  message(DEBUG "Ccache found as ${CCACHE_PROGRAM}")
+  option(ENABLE_CCACHE "Enable compiler acceleration with ccache" OFF)
 
   if(ENABLE_CCACHE)
     set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
@@ -19,4 +20,6 @@ if(CCACHE_PROGRAM)
     set(CMAKE_OBJCXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
     set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
   endif()
+else()
+  message(DEBUG "Trying to find ccache on build host - skipped")
 endif()

+ 62 - 66
cmake/common/compiler_common.cmake

@@ -3,11 +3,7 @@
 include_guard(GLOBAL)
 
 # Set C and C++ language standards to C17 and C++17
-if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.21)
-  set(CMAKE_C_STANDARD 17)
-else()
-  set(CMAKE_C_STANDARD 11)
-endif()
+set(CMAKE_C_STANDARD 17)
 set(CMAKE_C_STANDARD_REQUIRED TRUE)
 set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
@@ -17,70 +13,70 @@ set(CMAKE_C_VISIBILITY_PRESET hidden)
 set(CMAKE_CXX_VISIBILITY_PRESET hidden)
 set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
 
+# clang options for C, C++, ObjC, and ObjC++
+set(
+  _obs_clang_common_options
+  -fno-strict-aliasing
+  -Wno-trigraphs
+  -Wno-missing-field-initializers
+  -Wno-missing-prototypes
+  -Werror=return-type
+  -Wunreachable-code
+  -Wquoted-include-in-framework-header
+  -Wno-missing-braces
+  -Wparentheses
+  -Wswitch
+  -Wno-unused-function
+  -Wno-unused-label
+  -Wunused-parameter
+  -Wunused-variable
+  -Wunused-value
+  -Wempty-body
+  -Wuninitialized
+  -Wno-unknown-pragmas
+  -Wfour-char-constants
+  -Wconstant-conversion
+  -Wno-conversion
+  -Wint-conversion
+  -Wbool-conversion
+  -Wenum-conversion
+  -Wnon-literal-null-conversion
+  -Wsign-compare
+  -Wshorten-64-to-32
+  -Wpointer-sign
+  -Wnewline-eof
+  -Wno-implicit-fallthrough
+  -Wdeprecated-declarations
+  -Wno-sign-conversion
+  -Winfinite-recursion
+  -Wcomma
+  -Wno-strict-prototypes
+  -Wno-semicolon-before-method-body
+  -Wformat-security
+  -Wvla
+  -Wno-error=shorten-64-to-32
+)
+
 # clang options for C
-set(_obs_clang_c_options
-    # cmake-format: sortable
-    -fno-strict-aliasing
-    -Wbool-conversion
-    -Wcomma
-    -Wconstant-conversion
-    -Wdeprecated-declarations
-    -Wempty-body
-    -Wenum-conversion
-    -Werror=return-type
-    -Wextra
-    -Wformat
-    -Wformat-security
-    -Wfour-char-constants
-    -Winfinite-recursion
-    -Wint-conversion
-    -Wnewline-eof
-    -Wno-conversion
-    -Wno-float-conversion
-    -Wno-implicit-fallthrough
-    -Wno-missing-braces
-    -Wno-missing-field-initializers
-    -Wno-missing-prototypes
-    -Wno-semicolon-before-method-body
-    -Wno-shadow
-    -Wno-sign-conversion
-    -Wno-strict-prototypes
-    -Wno-trigraphs
-    -Wno-unknown-pragmas
-    -Wno-unused-function
-    -Wno-unused-label
-    -Wnon-literal-null-conversion
-    -Wobjc-literal-conversion
-    -Wparentheses
-    -Wpointer-sign
-    -Wquoted-include-in-framework-header
-    -Wshadow
-    -Wshorten-64-to-32
-    -Wuninitialized
-    -Wunreachable-code
-    -Wunused-parameter
-    -Wunused-value
-    -Wunused-variable
-    -Wvla)
+set(_obs_clang_c_options ${_obs_clang_common_options} -Wno-shadow -Wno-float-conversion)
 
 # clang options for C++
-set(_obs_clang_cxx_options
-    # cmake-format: sortable
-    ${_obs_clang_c_options}
-    -Wconversion
-    -Wdeprecated-implementations
-    -Wduplicate-method-match
-    -Wfloat-conversion
-    -Wfour-char-constants
-    -Wimplicit-retain-self
-    -Winvalid-offsetof
-    -Wmove
-    -Wno-c++11-extensions
-    -Wno-exit-time-destructors
-    -Wno-implicit-atomic-properties
-    -Wno-objc-interface-ivars
-    -Wno-overloaded-virtual
-    -Wrange-loop-analysis)
+set(
+  _obs_clang_cxx_options
+  ${_obs_clang_common_options}
+  -Wno-non-virtual-dtor
+  -Wno-overloaded-virtual
+  -Wno-exit-time-destructors
+  -Wno-shadow
+  -Winvalid-offsetof
+  -Wmove
+  -Werror=block-capture-autoreleasing
+  -Wrange-loop-analysis
+)
+
+if(CMAKE_CXX_STANDARD GREATER_EQUAL 20)
+  list(APPEND _obs_clang_cxx_options -fno-char8_t)
+endif()
 
 if(NOT DEFINED CMAKE_COMPILE_WARNING_AS_ERROR)
   set(CMAKE_COMPILE_WARNING_AS_ERROR ON)

+ 5 - 14
cmake/common/helpers_common.cmake

@@ -1,15 +1,13 @@
 # CMake common helper functions module
 
-# cmake-format: off
-# cmake-lint: disable=C0103
-# cmake-format: on
-
 include_guard(GLOBAL)
 
 # check_uuid: Helper function to check for valid UUID
 function(check_uuid uuid_string return_value)
   set(valid_uuid TRUE)
+  # gersemi: off
   set(uuid_token_lengths 8 4 4 4 12)
+  # gersemi: on
   set(token_num 0)
 
   string(REPLACE "-" ";" uuid_tokens ${uuid_string})
@@ -36,22 +34,15 @@ function(check_uuid uuid_string return_value)
     set(valid_uuid FALSE)
   endif()
   message(DEBUG "UUID ${uuid_string} valid: ${valid_uuid}")
-  set(${return_value}
-      ${valid_uuid}
-      PARENT_SCOPE)
+  set(${return_value} ${valid_uuid} PARENT_SCOPE)
 endfunction()
 
 if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/plugin-support.c.in")
   configure_file(src/plugin-support.c.in plugin-support.c @ONLY)
   add_library(plugin-support STATIC)
-  target_sources(
-    plugin-support
-    PRIVATE plugin-support.c
-    PUBLIC src/plugin-support.h)
+  target_sources(plugin-support PRIVATE plugin-support.c PUBLIC src/plugin-support.h)
   target_include_directories(plugin-support PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")
-  if(OS_LINUX
-     OR OS_FREEBSD
-     OR OS_OPENBSD)
+  if(OS_LINUX OR OS_FREEBSD OR OS_OPENBSD)
     # add fPIC on Linux to prevent shared object errors
     set_property(TARGET plugin-support PROPERTY POSITION_INDEPENDENT_CODE ON)
   endif()

+ 0 - 2
cmake/common/osconfig.cmake

@@ -2,8 +2,6 @@
 
 include_guard(GLOBAL)
 
-# Set minimum CMake version specific to host operating system, add OS-specific module directory to default search paths,
-# and set helper variables for OS detection in other CMake list files.
 if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
   set(CMAKE_C_EXTENSIONS FALSE)
   set(CMAKE_CXX_EXTENSIONS FALSE)

+ 47 - 54
cmake/linux/compilerconfig.cmake

@@ -9,67 +9,62 @@ option(ENABLE_COMPILER_TRACE "Enable Clang time-trace (required Clang and Ninja)
 mark_as_advanced(ENABLE_COMPILER_TRACE)
 
 # gcc options for C
-set(_obs_gcc_c_options
-    # cmake-format: sortable
-    -fno-strict-aliasing
-    -fopenmp-simd
-    -Wdeprecated-declarations
-    -Wempty-body
-    -Wenum-conversion
-    -Werror=return-type
-    -Wextra
-    -Wformat
-    -Wformat-security
-    -Wno-conversion
-    -Wno-float-conversion
-    -Wno-implicit-fallthrough
-    -Wno-missing-braces
-    -Wno-missing-field-initializers
-    -Wno-shadow
-    -Wno-sign-conversion
-    -Wno-trigraphs
-    -Wno-unknown-pragmas
-    -Wno-unused-function
-    -Wno-unused-label
-    -Wparentheses
-    -Wshadow
-    -Wuninitialized
-    -Wunreachable-code
-    -Wunused-parameter
-    -Wunused-value
-    -Wunused-variable
-    -Wvla)
-
-# gcc options for C++
-set(_obs_gcc_cxx_options
-    # cmake-format: sortable
-    ${_obs_gcc_c_options} -Wconversion -Wfloat-conversion -Winvalid-offsetof -Wno-overloaded-virtual)
+set(
+  _obs_gcc_c_options
+  -fno-strict-aliasing
+  -fopenmp-simd
+  -Wdeprecated-declarations
+  -Wempty-body
+  -Wenum-conversion
+  -Werror=return-type
+  -Wextra
+  -Wformat
+  -Wformat-security
+  -Wno-conversion
+  -Wno-float-conversion
+  -Wno-implicit-fallthrough
+  -Wno-missing-braces
+  -Wno-missing-field-initializers
+  -Wno-shadow
+  -Wno-sign-conversion
+  -Wno-trigraphs
+  -Wno-unknown-pragmas
+  -Wno-unused-function
+  -Wno-unused-label
+  -Wparentheses
+  -Wuninitialized
+  -Wunreachable-code
+  -Wunused-parameter
+  -Wunused-value
+  -Wunused-variable
+  -Wvla
+)
 
 add_compile_options(
   -fopenmp-simd
   "$<$<COMPILE_LANG_AND_ID:C,GNU>:${_obs_gcc_c_options}>"
   "$<$<COMPILE_LANG_AND_ID:C,GNU>:-Wint-conversion;-Wno-missing-prototypes;-Wno-strict-prototypes;-Wpointer-sign>"
-  "$<$<COMPILE_LANG_AND_ID:CXX,GNU>:${_obs_gcc_cxx_options}>"
+  "$<$<COMPILE_LANG_AND_ID:CXX,GNU>:${_obs_gcc_c_options}>"
+  "$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Winvalid-offsetof;-Wno-overloaded-virtual>"
   "$<$<COMPILE_LANG_AND_ID:C,Clang>:${_obs_clang_c_options}>"
-  "$<$<COMPILE_LANG_AND_ID:CXX,Clang>:${_obs_clang_cxx_options}>")
-
-# Add support for color diagnostics and CMake switch for warnings as errors to CMake < 3.24
-if(CMAKE_VERSION VERSION_LESS 3.24.0)
-  add_compile_options($<$<C_COMPILER_ID:Clang>:-fcolor-diagnostics> $<$<CXX_COMPILER_ID:Clang>:-fcolor-diagnostics>)
-  if(CMAKE_COMPILE_WARNING_AS_ERROR)
-    add_compile_options(-Werror)
-  endif()
-else()
-  set(CMAKE_COLOR_DIAGNOSTICS ON)
-endif()
+  "$<$<COMPILE_LANG_AND_ID:CXX,Clang>:${_obs_clang_cxx_options}>"
+)
 
 if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
-  # Disable false-positive warning in GCC 12.1.0 and later
-  add_compile_options(-Wno-error=maybe-uninitialized)
+  # * Disable false-positive warning in GCC 12.1.0 and later
+  # * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105562
+  if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.1.0)
+    add_compile_options(-Wno-error=maybe-uninitialized)
+  endif()
 
-  # Add warning for infinite recursion (added in GCC 12)
+  # * Add warning for infinite recursion (added in GCC 12)
+  # * Also disable warnings for stringop-overflow due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106297
   if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0.0)
-    add_compile_options(-Winfinite-recursion)
+    add_compile_options(-Winfinite-recursion -Wno-stringop-overflow)
+  endif()
+
+  if(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
+    add_compile_options(-Wno-error=type-limits)
   endif()
 endif()
 
@@ -77,9 +72,7 @@ endif()
 if(ENABLE_COMPILER_TRACE AND CMAKE_GENERATOR STREQUAL "Ninja")
   add_compile_options($<$<COMPILE_LANG_AND_ID:C,Clang>:-ftime-trace> $<$<COMPILE_LANG_AND_ID:CXX,Clang>:-ftime-trace>)
 else()
-  set(ENABLE_COMPILER_TRACE
-      OFF
-      CACHE STRING "Enable Clang time-trace (required Clang and Ninja)" FORCE)
+  set(ENABLE_COMPILER_TRACE OFF CACHE STRING "Enable Clang time-trace (required Clang and Ninja)" FORCE)
 endif()
 
 add_compile_definitions($<$<CONFIG:DEBUG>:DEBUG> $<$<CONFIG:DEBUG>:_DEBUG> SIMDE_ENABLE_OPENMP)

+ 23 - 21
cmake/linux/defaults.cmake

@@ -1,14 +1,14 @@
 # CMake Linux defaults module
 
-# cmake-format: off
-# cmake-lint: disable=C0103
-# cmake-lint: disable=C0111
-# cmake-format: on
-
 include_guard(GLOBAL)
 
+# Set default installation directories
 include(GNUInstallDirs)
 
+if(CMAKE_INSTALL_LIBDIR MATCHES "(CMAKE_SYSTEM_PROCESSOR)")
+  string(REPLACE "CMAKE_SYSTEM_PROCESSOR" "${CMAKE_SYSTEM_PROCESSOR}" CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
+endif()
+
 # Enable find_package targets to become globally available targets
 set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL TRUE)
 
@@ -28,15 +28,17 @@ endif()
 set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/release")
 
 set(CPACK_SOURCE_GENERATOR "TXZ")
-set(CPACK_SOURCE_IGNORE_FILES
-    # cmake-format: sortable
-    ".*~$"
-    \\.git/
-    \\.github/
-    \\.gitignore
-    build_.*
-    cmake/\\.CMakeBuildNumber
-    release/)
+set(
+  CPACK_SOURCE_IGNORE_FILES
+  ".*~$"
+  \\.git/
+  \\.github/
+  \\.gitignore
+  \\.ccache/
+  build_.*
+  cmake/\\.CMakeBuildNumber
+  release/
+)
 
 set(CPACK_VERBATIM_VARIABLES YES)
 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-source")
@@ -55,12 +57,10 @@ if(NOT TARGET OBS::libobs)
       obs-frontend-api_INCLUDE_DIR
       NAMES obs-frontend-api.h
       PATHS /usr/include /usr/local/include
-      PATH_SUFFIXES obs)
+      PATH_SUFFIXES obs
+    )
 
-    find_library(
-      obs-frontend-api_LIBRARY
-      NAMES obs-frontend-api
-      PATHS /usr/lib /usr/local/lib)
+    find_library(obs-frontend-api_LIBRARY NAMES obs-frontend-api PATHS /usr/lib /usr/local/lib)
 
     if(obs-frontend-api_LIBRARY)
       if(NOT TARGET OBS::obs-frontend-api)
@@ -72,8 +72,10 @@ if(NOT TARGET OBS::libobs)
           set_property(TARGET OBS::obs-frontend-api PROPERTY IMPORTED_LIBNAME "${obs-frontend-api_LIBRARY}")
         endif()
 
-        set_target_properties(OBS::obs-frontend-api PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
-                                                               "${obs-frontend-api_INCLUDE_DIR}")
+        set_target_properties(
+          OBS::obs-frontend-api
+          PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${obs-frontend-api_INCLUDE_DIR}"
+        )
       endif()
     endif()
   endif()

+ 43 - 11
cmake/linux/helpers.cmake

@@ -20,28 +20,35 @@ function(set_target_properties_plugin target)
 
   set_target_properties(
     ${target}
-    PROPERTIES VERSION 0
-               SOVERSION ${PLUGIN_VERSION}
-               PREFIX "")
+    PROPERTIES VERSION ${PLUGIN_VERSION} SOVERSION ${PLUGIN_VERSION_MAJOR} PREFIX ""
+  )
 
   install(
     TARGETS ${target}
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/obs-plugins)
+    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/obs-plugins
+  )
 
   if(TARGET plugin-support)
     target_link_libraries(${target} PRIVATE plugin-support)
   endif()
 
+  add_custom_command(
+    TARGET ${target}
+    POST_BUILD
+    COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>"
+    COMMAND
+      "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:${target}>" "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>"
+    COMMENT "Copy ${target} to rundir"
+    VERBATIM
+  )
+
   target_install_resources(${target})
 
   get_target_property(target_sources ${target} SOURCES)
   set(target_ui_files ${target_sources})
   list(FILTER target_ui_files INCLUDE REGEX ".+\\.(ui|qrc)")
-  source_group(
-    TREE "${CMAKE_CURRENT_SOURCE_DIR}"
-    PREFIX "UI Files"
-    FILES ${target_ui_files})
+  source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "UI Files" FILES ${target_ui_files})
 endfunction()
 
 # Helper function to add resources into bundle
@@ -50,8 +57,12 @@ function(target_install_resources target)
   if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/data")
     file(GLOB_RECURSE data_files "${CMAKE_CURRENT_SOURCE_DIR}/data/*")
     foreach(data_file IN LISTS data_files)
-      cmake_path(RELATIVE_PATH data_file BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/" OUTPUT_VARIABLE
-                 relative_path)
+      cmake_path(
+        RELATIVE_PATH
+        data_file
+        BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
+        OUTPUT_VARIABLE relative_path
+      )
       cmake_path(GET relative_path PARENT_PATH relative_path)
       target_sources(${target} PRIVATE "${data_file}")
       source_group("Resources/${relative_path}" FILES "${data_file}")
@@ -60,7 +71,19 @@ function(target_install_resources target)
     install(
       DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
       DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target}
-      USE_SOURCE_PERMISSIONS)
+      USE_SOURCE_PERMISSIONS
+    )
+
+    add_custom_command(
+      TARGET ${target}
+      POST_BUILD
+      COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>/${target}"
+      COMMAND
+        "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/data"
+        "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>/${target}"
+      COMMENT "Copy ${target} resources to rundir"
+      VERBATIM
+    )
   endif()
 endfunction()
 
@@ -70,5 +93,14 @@ function(target_add_resource target resource)
 
   install(FILES "${resource}" DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/obs/obs-plugins/${target})
 
+  add_custom_command(
+    TARGET ${target}
+    POST_BUILD
+    COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>/${target}"
+    COMMAND "${CMAKE_COMMAND}" -E copy "${resource}" "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>/${target}"
+    COMMENT "Copy ${target} resource ${resource} to rundir"
+    VERBATIM
+  )
+
   source_group("Resources" FILES "${resource}")
 endfunction()

+ 0 - 56
cmake/linux/toolchains/aarch64-linux-clang.cmake

@@ -1,56 +0,0 @@
-set(CMAKE_SYSTEM_NAME Linux)
-set(CMAKE_SYSTEM_PROCESSOR aarch64)
-set(CMAKE_CROSSCOMPILING TRUE)
-
-set(CMAKE_C_COMPILER /usr/bin/clang)
-set(CMAKE_CXX_COMPILER /usr/bin/clang++)
-
-set(CMAKE_C_COMPILER_TARGET aarch64-linux-gnu)
-set(CMAKE_CXX_COMPILER_TARGET aarch64-linux-gnu)
-
-set(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu)
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(PKG_CONFIG_EXECUTABLE
-    /usr/bin/aarch64-linux-gnu-pkg-config
-    CACHE FILEPATH "pkg-config executable")
-
-execute_process(
-  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-ranlib
-  OUTPUT_VARIABLE CMAKE_RANLIB
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-execute_process(
-  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-ar
-  OUTPUT_VARIABLE CMAKE_LLVM_AR
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-execute_process(
-  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-readelf
-  OUTPUT_VARIABLE READELF
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-execute_process(
-  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-objcopy
-  OUTPUT_VARIABLE CMAKE_LLVM_OBJCOPY
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-execute_process(
-  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-objdump
-  OUTPUT_VARIABLE CMAKE_LLVM_OBJDUMP
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-set(CMAKE_AR
-    "${CMAKE_LLVM_AR}"
-    CACHE INTERNAL "${CMAKE_SYSTEM_NAME} ar" FORCE)
-set(CMAKE_OBJCOPY
-    "${CMAKE_LLVM_OBJCOPY}"
-    CACHE INTERNAL "${CMAKE_SYSTEM_NAME} objcopy" FORCE)
-set(CMAKE_OBJDUMP
-    "${CMAKE_LLVM_OBJDUMP}"
-    CACHE INTERNAL "${CMAKE_SYSTEM_NAME} objdump" FORCE)
-
-set(CPACK_READELF_EXECUTABLE "${READELF}")
-set(CPACK_OBJCOPY_EXECUTABLE "${CMAKE_LLVM_OBJCOPY}")
-set(CPACK_OBJDUMP_EXECUTABLE "${CMAKE_LLVM_OBJDUMP}")
-set(CPACK_PACKAGE_ARCHITECTURE arm64)
-set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE arm64)

+ 0 - 20
cmake/linux/toolchains/aarch64-linux-gcc.cmake

@@ -1,20 +0,0 @@
-set(CMAKE_SYSTEM_NAME Linux)
-set(CMAKE_SYSTEM_PROCESSOR aarch64)
-set(CMAKE_CROSSCOMPILING TRUE)
-
-set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc)
-set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++)
-
-set(CMAKE_FIND_ROOT_PATH /usr/aarch64-linux-gnu)
-
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-
-set(PKG_CONFIG_EXECUTABLE
-    /usr/bin/aarch64-linux-gnu-pkg-config
-    CACHE FILEPATH "pkg-config executable")
-
-set(CPACK_READELF_EXECUTABLE /usr/bin/aarch64-linux-gnu-readelf)
-set(CPACK_OBJCOPY_EXECUTABLE /usr/bin/aarch64-linux-gnu-objcopy)
-set(CPACK_OBJDUMP_EXECUTABLE /usr/bin/aarch64-linux-gnu-objdump)
-set(CPACK_PACKAGE_ARCHITECTURE arm64)
-set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE arm64)

+ 0 - 56
cmake/linux/toolchains/x86_64-linux-clang.cmake

@@ -1,56 +0,0 @@
-set(CMAKE_SYSTEM_NAME Linux)
-set(CMAKE_SYSTEM_PROCESSOR x86_64)
-set(CMAKE_CROSSCOMPILING TRUE)
-
-set(CMAKE_C_COMPILER /usr/bin/clang)
-set(CMAKE_CXX_COMPILER /usr/bin/clang++)
-
-set(CMAKE_C_COMPILER_TARGET x86_64-linux-gnu)
-set(CMAKE_CXX_COMPILER_TARGET x86_64-linux-gnu)
-
-set(CMAKE_FIND_ROOT_PATH /usr/x86_64-linux-gnu)
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(PKG_CONFIG_EXECUTABLE
-    /usr/bin/x86_64-linux-gnu-pkg-config
-    CACHE FILEPATH "pkg-config executable")
-
-execute_process(
-  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-ranlib
-  OUTPUT_VARIABLE CMAKE_RANLIB
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-execute_process(
-  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-ar
-  OUTPUT_VARIABLE CMAKE_LLVM_AR
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-execute_process(
-  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-readelf
-  OUTPUT_VARIABLE READELF
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-execute_process(
-  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-objcopy
-  OUTPUT_VARIABLE CMAKE_LLVM_OBJCOPY
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-execute_process(
-  COMMAND ${CMAKE_C_COMPILER} -print-prog-name=llvm-objdump
-  OUTPUT_VARIABLE CMAKE_LLVM_OBJDUMP
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-set(CMAKE_AR
-    "${CMAKE_LLVM_AR}"
-    CACHE INTERNAL "${CMAKE_SYSTEM_NAME} ar" FORCE)
-set(CMAKE_OBJCOPY
-    "${CMAKE_LLVM_OBJCOPY}"
-    CACHE INTERNAL "${CMAKE_SYSTEM_NAME} objcopy" FORCE)
-set(CMAKE_OBJDUMP
-    "${CMAKE_LLVM_OBJDUMP}"
-    CACHE INTERNAL "${CMAKE_SYSTEM_NAME} objdump" FORCE)
-
-set(CPACK_READELF_EXECUTABLE "${READELF}")
-set(CPACK_OBJCOPY_EXECUTABLE "${CMAKE_LLVM_OBJCOPY}")
-set(CPACK_OBJDUMP_EXECUTABLE "${CMAKE_LLVM_OBJDUMP}")
-set(CPACK_PACKAGE_ARCHITECTURE x86_64)
-set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE x86_64)

+ 0 - 20
cmake/linux/toolchains/x86_64-linux-gcc.cmake

@@ -1,20 +0,0 @@
-set(CMAKE_SYSTEM_NAME Linux)
-set(CMAKE_SYSTEM_PROCESSOR x86_64)
-set(CMAKE_CROSSCOMPILING TRUE)
-
-set(CMAKE_C_COMPILER /usr/bin/x86_64-linux-gnu-gcc)
-set(CMAKE_CXX_COMPILER /usr/bin/x86_64-linux-gnu-g++)
-
-set(CMAKE_FIND_ROOT_PATH /usr/x86_64-linux-gnu)
-
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-
-set(PKG_CONFIG_EXECUTABLE
-    /usr/bin/x86_64-linux-gnu-pkg-config
-    CACHE FILEPATH "pkg-config executable")
-
-set(CPACK_READELF_EXECUTABLE /usr/bin/x86_64-linux-gnu-readelf)
-set(CPACK_OBJCOPY_EXECUTABLE /usr/bin/x86_64-linux-gnu-objcopy)
-set(CPACK_OBJDUMP_EXECUTABLE /usr/bin/x86_64-linux-gnu-objdump)
-set(CPACK_PACKAGE_ARCHITECTURE x86_64)
-set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE x86_64)

+ 6 - 5
cmake/macos/buildspec.cmake

@@ -22,13 +22,14 @@ function(_check_dependencies_macos)
 
   _check_dependencies()
 
-  execute_process(COMMAND "xattr" -r -d com.apple.quarantine "${dependencies_dir}"
-                  RESULT_VARIABLE result COMMAND_ERROR_IS_FATAL ANY)
+  execute_process(
+    COMMAND "xattr" -r -d com.apple.quarantine "${dependencies_dir}"
+    RESULT_VARIABLE result
+    COMMAND_ERROR_IS_FATAL ANY
+  )
 
   list(APPEND CMAKE_FRAMEWORK_PATH "${dependencies_dir}/Frameworks")
-  set(CMAKE_FRAMEWORK_PATH
-      ${CMAKE_FRAMEWORK_PATH}
-      PARENT_SCOPE)
+  set(CMAKE_FRAMEWORK_PATH ${CMAKE_FRAMEWORK_PATH} PARENT_SCOPE)
 endfunction()
 
 _check_dependencies_macos()

+ 67 - 47
cmake/macos/compilerconfig.cmake

@@ -2,56 +2,76 @@
 
 include_guard(GLOBAL)
 
+option(ENABLE_COMPILER_TRACE "Enable clang time-trace" OFF)
+mark_as_advanced(ENABLE_COMPILER_TRACE)
+
+if(NOT XCODE)
+  message(FATAL_ERROR "Building OBS Studio on macOS requires Xcode generator.")
+endif()
+
 include(ccache)
 include(compiler_common)
 
-add_compile_options(-fopenmp-simd)
-
-if(XCODE)
-  # Use Xcode's standard architecture selection
-  set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)")
-  # Enable dSYM generation for Release builds
-  string(APPEND CMAKE_C_FLAGS_RELEASE " -g")
-  string(APPEND CMAKE_CXX_FLAGS_RELEASE " -g")
-else()
-  option(ENABLE_COMPILER_TRACE "Enable clang time-trace (requires Ninja)" OFF)
-  mark_as_advanced(ENABLE_COMPILER_TRACE)
-
-  # clang options for ObjC
-  set(_obs_clang_objc_options
-      # cmake-format: sortable
-      -Werror=block-capture-autoreleasing -Wno-selector -Wno-strict-selector-match -Wnon-virtual-dtor -Wprotocol
-      -Wundeclared-selector)
-
-  # clang options for ObjC++
-  set(_obs_clang_objcxx_options
-      # cmake-format: sortable
-      ${_obs_clang_objc_options} -Warc-repeated-use-of-weak -Wno-arc-maybe-repeated-use-of-weak)
+add_compile_options("$<$<NOT:$<COMPILE_LANGUAGE:Swift>>:-fopenmp-simd>")
 
-  add_compile_options(
-    "$<$<COMPILE_LANGUAGE:C>:${_obs_clang_c_options}>" "$<$<COMPILE_LANGUAGE:CXX>:${_obs_clang_cxx_options}>"
-    "$<$<COMPILE_LANGUAGE:OBJC>:${_obs_clang_objc_options}>"
-    "$<$<COMPILE_LANGUAGE:OBJCXX>:${_obs_clang_objcxx_options}>")
-
-  # Enable stripping of dead symbols when not building for Debug configuration
-  set(_release_configs RelWithDebInfo Release MinSizeRel)
-  if(CMAKE_BUILD_TYPE IN_LIST _release_configs)
-    add_link_options(LINKER:-dead_strip)
-  endif()
-
-  # Enable color diagnostics for AppleClang
-  set(CMAKE_COLOR_DIAGNOSTICS ON)
-  # Set universal architectures via CMake flag for non-Xcode generators
-  set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
-
-  # Enable compiler and build tracing (requires Ninja generator)
-  if(ENABLE_COMPILER_TRACE AND CMAKE_GENERATOR STREQUAL "Ninja")
-    add_compile_options($<$<COMPILE_LANGUAGE:C>:-ftime-trace> $<$<COMPILE_LANGUAGE:CXX>:-ftime-trace>)
-  else()
-    set(ENABLE_COMPILER_TRACE
-        OFF
-        CACHE STRING "Enable clang time-trace (requires Ninja)" FORCE)
-  endif()
+# Ensure recent enough Xcode and platform SDK
+set(_obs_macos_minimum_sdk 15.0) # Keep in sync with Xcode
+set(_obs_macos_minimum_xcode 16.0) # Keep in sync with SDK
+message(DEBUG "macOS SDK Path: ${CMAKE_OSX_SYSROOT}")
+string(REGEX MATCH ".+/MacOSX.platform/Developer/SDKs/MacOSX([0-9]+\\.[0-9])+\\.sdk$" _ ${CMAKE_OSX_SYSROOT})
+set(_obs_macos_current_sdk ${CMAKE_MATCH_1})
+message(DEBUG "macOS SDK version: ${_obs_macos_current_sdk}")
+if(_obs_macos_current_sdk VERSION_LESS _obs_macos_minimum_sdk)
+  message(
+    FATAL_ERROR
+    "Your macOS SDK version (${_obs_macos_current_sdk}) is too low. "
+    "The macOS ${_obs_macos_minimum_sdk} SDK (Xcode ${_obs_macos_minimum_xcode}) is required to build OBS."
+  )
 endif()
+unset(_obs_macos_current_sdk)
+unset(_obs_macos_minimum_sdk)
+unset(_obs_macos_minimum_xcode)
+
+# Enable dSYM generator for release builds
+string(APPEND CMAKE_C_FLAGS_RELEASE " -g")
+string(APPEND CMAKE_CXX_FLAGS_RELEASE " -g")
+string(APPEND CMAKE_OBJC_FLAGS_RELEASE " -g")
+string(APPEND CMAKE_OBJCXX_FLAGS_RELEASE " -g")
 
-add_compile_definitions($<$<CONFIG:DEBUG>:DEBUG> $<$<CONFIG:DEBUG>:_DEBUG> SIMDE_ENABLE_OPENMP)
+# Default ObjC compiler options used by Xcode:
+#
+# * -Wno-implicit-atomic-properties
+# * -Wno-objc-interface-ivars
+# * -Warc-repeated-use-of-weak
+# * -Wno-arc-maybe-repeated-use-of-weak
+# * -Wimplicit-retain-self
+# * -Wduplicate-method-match
+# * -Wshadow
+# * -Wfloat-conversion
+# * -Wobjc-literal-conversion
+# * -Wno-selector
+# * -Wno-strict-selector-match
+# * -Wundeclared-selector
+# * -Wdeprecated-implementations
+# * -Wprotocol
+# * -Werror=block-capture-autoreleasing
+# * -Wrange-loop-analysis
+
+# Default ObjC++ compiler options used by Xcode:
+#
+# * -Wno-non-virtual-dtor
+
+add_compile_definitions(
+  $<$<NOT:$<COMPILE_LANGUAGE:Swift>>:$<$<CONFIG:DEBUG>:DEBUG>>
+  $<$<NOT:$<COMPILE_LANGUAGE:Swift>>:$<$<CONFIG:DEBUG>:_DEBUG>>
+  $<$<NOT:$<COMPILE_LANGUAGE:Swift>>:SIMDE_ENABLE_OPENMP>
+)
+
+if(ENABLE_COMPILER_TRACE)
+  add_compile_options(
+    $<$<NOT:$<COMPILE_LANGUAGE:Swift>>:-ftime-trace>
+    "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -debug-time-expression-type-checking>"
+    "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -debug-time-function-bodies>"
+  )
+  add_link_options(LINKER:-print_statistics)
+endif()

+ 10 - 20
cmake/macos/defaults.cmake

@@ -4,37 +4,27 @@ include_guard(GLOBAL)
 
 # Set empty codesigning team if not specified as cache variable
 if(NOT CODESIGN_TEAM)
-  set(CODESIGN_TEAM
-      ""
-      CACHE STRING "OBS code signing team for macOS" FORCE)
+  set(CODESIGN_TEAM "" CACHE STRING "OBS code signing team for macOS" FORCE)
 
   # Set ad-hoc codesigning identity if not specified as cache variable
   if(NOT CODESIGN_IDENTITY)
-    set(CODESIGN_IDENTITY
-        "-"
-        CACHE STRING "OBS code signing identity for macOS" FORCE)
+    set(CODESIGN_IDENTITY "-" CACHE STRING "OBS code signing identity for macOS" FORCE)
   endif()
 endif()
 
-if(XCODE)
-  include(xcode)
-endif()
+include(xcode)
 
 include(buildspec)
 
-# Set default deployment target to 11.0 if not set and enable selection in GUI up to 13.0
-if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
-  set(CMAKE_OSX_DEPLOYMENT_TARGET
-      11.0
-      CACHE STRING "Minimum macOS version to target for deployment (at runtime). Newer APIs will be weak-linked." FORCE)
-endif()
-set_property(CACHE CMAKE_OSX_DEPLOYMENT_TARGET PROPERTY STRINGS 13.0 12.0 11.0)
-
 # Use Applications directory as default install destination
 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-  set(CMAKE_INSTALL_PREFIX
-      "$ENV{HOME}/Library/Application Support/obs-studio/plugins"
-      CACHE STRING "Directory to install OBS after building" FORCE)
+  set(
+    CMAKE_INSTALL_PREFIX
+    "$ENV{HOME}/Library/Application Support/obs-studio/plugins"
+    CACHE STRING
+    "Default plugin installation directory"
+    FORCE
+  )
 endif()
 
 # Enable find_package targets to become globally available targets

+ 36 - 29
cmake/macos/helpers.cmake

@@ -1,10 +1,5 @@
 # CMake macOS helper functions module
 
-# cmake-format: off
-# cmake-lint: disable=C0103
-# cmake-lint: disable=C0307
-# cmake-format: on
-
 include_guard(GLOBAL)
 
 include(helpers_common)
@@ -26,21 +21,25 @@ function(set_target_properties_plugin target)
   string(TIMESTAMP CURRENT_YEAR "%Y")
   set_target_properties(
     ${target}
-    PROPERTIES BUNDLE TRUE
-               BUNDLE_EXTENSION plugin
-               XCODE_ATTRIBUTE_PRODUCT_NAME ${target}
-               XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER ${MACOS_BUNDLEID}
-               XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION ${PLUGIN_BUILD_NUMBER}
-               XCODE_ATTRIBUTE_MARKETING_VERSION ${PLUGIN_VERSION}
-               XCODE_ATTRIBUTE_GENERATE_INFOPLIST_FILE YES
-               XCODE_ATTRIBUTE_INFOPLIST_FILE ""
-               XCODE_ATTRIBUTE_INFOPLIST_KEY_CFBundleDisplayName ${target}
-               XCODE_ATTRIBUTE_INFOPLIST_KEY_NSHumanReadableCopyright "(c) ${CURRENT_YEAR} ${PLUGIN_AUTHOR}"
-               XCODE_ATTRIBUTE_INSTALL_PATH "$(USER_LIBRARY_DIR)/Application Support/obs-studio/plugins")
+    PROPERTIES
+      BUNDLE TRUE
+      BUNDLE_EXTENSION plugin
+      XCODE_ATTRIBUTE_PRODUCT_NAME ${target}
+      XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER ${MACOS_BUNDLEID}
+      XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION ${PLUGIN_BUILD_NUMBER}
+      XCODE_ATTRIBUTE_MARKETING_VERSION ${PLUGIN_VERSION}
+      XCODE_ATTRIBUTE_GENERATE_INFOPLIST_FILE YES
+      XCODE_ATTRIBUTE_INFOPLIST_FILE ""
+      XCODE_ATTRIBUTE_INFOPLIST_KEY_CFBundleDisplayName ${target}
+      XCODE_ATTRIBUTE_INFOPLIST_KEY_NSHumanReadableCopyright "(c) ${CURRENT_YEAR} ${PLUGIN_AUTHOR}"
+      XCODE_ATTRIBUTE_INSTALL_PATH "$(USER_LIBRARY_DIR)/Application Support/obs-studio/plugins"
+  )
 
   if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/entitlements.plist")
-    set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
-                                               "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/entitlements.plist")
+    set_target_properties(
+      ${target}
+      PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/entitlements.plist"
+    )
   endif()
 
   if(TARGET plugin-support)
@@ -49,20 +48,24 @@ function(set_target_properties_plugin target)
 
   target_install_resources(${target})
 
+  add_custom_command(
+    TARGET ${target}
+    POST_BUILD
+    COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>"
+    COMMAND
+      "${CMAKE_COMMAND}" -E copy_directory "$<TARGET_BUNDLE_DIR:${target}>"
+      "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>/$<TARGET_BUNDLE_DIR_NAME:${target}>"
+    COMMENT "Copy ${target} to rundir"
+    VERBATIM
+  )
+
   get_target_property(target_sources ${target} SOURCES)
   set(target_ui_files ${target_sources})
   list(FILTER target_ui_files INCLUDE REGEX ".+\\.(ui|qrc)")
-  source_group(
-    TREE "${CMAKE_CURRENT_SOURCE_DIR}"
-    PREFIX "UI Files"
-    FILES ${target_ui_files})
+  source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "UI Files" FILES ${target_ui_files})
 
   install(TARGETS ${target} LIBRARY DESTINATION .)
-  install(
-    FILES "$<TARGET_BUNDLE_DIR:${target}>.dsym"
-    CONFIGURATIONS Release
-    DESTINATION .
-    OPTIONAL)
+  install(FILES "$<TARGET_BUNDLE_DIR:${target}>.dsym" CONFIGURATIONS Release DESTINATION . OPTIONAL)
 
   configure_file(cmake/macos/resources/distribution.in "${CMAKE_CURRENT_BINARY_DIR}/distribution" @ONLY)
   configure_file(cmake/macos/resources/create-package.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/create-package.cmake" @ONLY)
@@ -75,8 +78,12 @@ function(target_install_resources target)
   if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/data")
     file(GLOB_RECURSE data_files "${CMAKE_CURRENT_SOURCE_DIR}/data/*")
     foreach(data_file IN LISTS data_files)
-      cmake_path(RELATIVE_PATH data_file BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/" OUTPUT_VARIABLE
-                 relative_path)
+      cmake_path(
+        RELATIVE_PATH
+        data_file
+        BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
+        OUTPUT_VARIABLE relative_path
+      )
       cmake_path(GET relative_path PARENT_PATH relative_path)
       target_sources(${target} PRIVATE "${data_file}")
       set_property(SOURCE "${data_file}" PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${relative_path}")

+ 11 - 2
cmake/macos/resources/ccache-launcher-c.in

@@ -4,13 +4,22 @@ if [[ "$1" == "${CMAKE_C_COMPILER}" ]] ; then
     shift
 fi
 
+export CCACHE_DIR='${CMAKE_SOURCE_DIR}/.ccache'
+export CCACHE_MAXSIZE='1G'
 export CCACHE_CPP2=true
 export CCACHE_DEPEND=true
 export CCACHE_DIRECT=true
 export CCACHE_FILECLONE=true
 export CCACHE_INODECACHE=true
-export CCACHE_NOCOMPILERCHECK='content'
-export CCACHE_SLOPPINESS='include_file_mtime,include_file_ctime,clang_index_store,system_headers'
+export CCACHE_COMPILERCHECK='content'
+
+CCACHE_SLOPPINESS='file_stat_matches,include_file_mtime,include_file_ctime,system_headers'
+
+if [[ "${CMAKE_C_COMPILER_ID}" == "AppleClang" ]]; then
+    CCACHE_SLOPPINESS="${CCACHE_SLOPPINESS},modules,clang_index_store"
+fi
+export CCACHE_SLOPPINESS
+
 if [[ "${CI}" ]]; then
     export CCACHE_NOHASHDIR=true
 fi

+ 12 - 3
cmake/macos/resources/ccache-launcher-cxx.in

@@ -4,13 +4,22 @@ if [[ "$1" == "${CMAKE_CXX_COMPILER}" ]] ; then
     shift
 fi
 
+export CCACHE_DIR='${CMAKE_SOURCE_DIR}/.ccache'
+export CCACHE_MAXSIZE='1G'
 export CCACHE_CPP2=true
-export CCACHE_NODEPEND=true
+export CCACHE_DEPEND=true
 export CCACHE_DIRECT=true
 export CCACHE_FILECLONE=true
 export CCACHE_INODECACHE=true
-export CCACHE_NOCOMPILERCHECK='content'
-export CCACHE_SLOPPINESS='include_file_mtime,include_file_ctime,clang_index_store,system_headers'
+export CCACHE_COMPILERCHECK='content'
+
+CCACHE_SLOPPINESS='file_stat_matches,include_file_mtime,include_file_ctime,system_headers'
+
+if [[ "${CMAKE_C_COMPILER_ID}" == "AppleClang" ]]; then
+    CCACHE_SLOPPINESS="${CCACHE_SLOPPINESS},modules,clang_index_store"
+fi
+export CCACHE_SLOPPINESS
+
 if [[ "${CI}" ]]; then
     export CCACHE_NOHASHDIR=true
 fi

+ 5 - 5
cmake/macos/xcode.cmake

@@ -2,13 +2,16 @@
 
 include_guard(GLOBAL)
 
+set(CMAKE_XCODE_GENERATE_SCHEME TRUE)
+
 # Use a compiler wrapper to enable ccache in Xcode projects
 if(ENABLE_CCACHE AND CCACHE_PROGRAM)
   configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/resources/ccache-launcher-c.in" ccache-launcher-c)
   configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/resources/ccache-launcher-cxx.in" ccache-launcher-cxx)
 
-  execute_process(COMMAND chmod a+rx "${CMAKE_CURRENT_BINARY_DIR}/ccache-launcher-c"
-                          "${CMAKE_CURRENT_BINARY_DIR}/ccache-launcher-cxx")
+  execute_process(
+    COMMAND chmod a+rx "${CMAKE_CURRENT_BINARY_DIR}/ccache-launcher-c" "${CMAKE_CURRENT_BINARY_DIR}/ccache-launcher-cxx"
+  )
   set(CMAKE_XCODE_ATTRIBUTE_CC "${CMAKE_CURRENT_BINARY_DIR}/ccache-launcher-c")
   set(CMAKE_XCODE_ATTRIBUTE_CXX "${CMAKE_CURRENT_BINARY_DIR}/ccache-launcher-cxx")
   set(CMAKE_XCODE_ATTRIBUTE_LD "${CMAKE_C_COMPILER}")
@@ -81,9 +84,6 @@ set(CMAKE_XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN YES)
 # Strip unused code
 set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING YES)
 
-# Display mangled names in Debug configuration
-set(CMAKE_XCODE_ATTRIBUTE_LINKER_DISPLAYS_MANGLED_NAMES[variant=Debug] YES)
-
 # Build active architecture only in Debug configuration
 set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH[variant=Debug] YES)
 

+ 1 - 1
cmake/windows/buildspec.cmake

@@ -6,7 +6,7 @@ include(buildspec_common)
 
 # _check_dependencies_windows: Set up Windows slice for _check_dependencies
 function(_check_dependencies_windows)
-  set(arch ${CMAKE_GENERATOR_PLATFORM})
+  set(arch ${CMAKE_VS_PLATFORM_NAME})
   set(platform windows-${arch})
 
   set(dependencies_dir "${CMAKE_CURRENT_SOURCE_DIR}/.deps")

+ 39 - 29
cmake/windows/compilerconfig.cmake

@@ -4,19 +4,7 @@ include_guard(GLOBAL)
 
 include(compiler_common)
 
-# CMake 3.24 introduces a bug mistakenly interpreting MSVC as supporting the '-pthread' compiler flag
-if(CMAKE_VERSION VERSION_EQUAL 3.24.0)
-  set(THREADS_HAVE_PTHREAD_ARG FALSE)
-endif()
-
-# CMake 3.25 changed the way symbol generation is handled on Windows
-if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.25.0)
-  if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
-    set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT ProgramDatabase)
-  else()
-    set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
-  endif()
-endif()
+set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT ProgramDatabase)
 
 message(DEBUG "Current Windows API version: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
 if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM)
@@ -24,29 +12,51 @@ if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM)
 endif()
 
 if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS 10.0.20348)
-  message(FATAL_ERROR "OBS requires Windows 10 SDK version 10.0.20348.0 or more recent.\n"
-                      "Please download and install the most recent Windows platform SDK.")
+  message(
+    FATAL_ERROR
+    "OBS requires Windows 10 SDK version 10.0.20348.0 or more recent.\n"
+    "Please download and install the most recent Windows platform SDK."
+  )
+endif()
+
+set(_obs_msvc_c_options /MP /Zc:__cplusplus /Zc:preprocessor)
+set(_obs_msvc_cpp_options /MP /Zc:__cplusplus /Zc:preprocessor)
+
+if(CMAKE_CXX_STANDARD GREATER_EQUAL 20)
+  list(APPEND _obs_msvc_cpp_options /Zc:char8_t-)
 endif()
 
 add_compile_options(
   /W3
   /utf-8
-  "$<$<COMPILE_LANG_AND_ID:C,MSVC>:/MP>"
-  "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/MP>"
+  /Brepro
+  /permissive-
+  "$<$<COMPILE_LANG_AND_ID:C,MSVC>:${_obs_msvc_c_options}>"
+  "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:${_obs_msvc_cpp_options}>"
   "$<$<COMPILE_LANG_AND_ID:C,Clang>:${_obs_clang_c_options}>"
   "$<$<COMPILE_LANG_AND_ID:CXX,Clang>:${_obs_clang_cxx_options}>"
-  $<$<NOT:$<CONFIG:Debug>>:/Gy>)
-
-add_compile_definitions(UNICODE _UNICODE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS $<$<CONFIG:DEBUG>:DEBUG>
-                        $<$<CONFIG:DEBUG>:_DEBUG>)
-
-# cmake-format: off
-add_link_options($<$<NOT:$<CONFIG:Debug>>:/OPT:REF>
-                 $<$<NOT:$<CONFIG:Debug>>:/OPT:ICF>
-                 $<$<NOT:$<CONFIG:Debug>>:/INCREMENTAL:NO>
-                 /DEBUG
-                 /Brepro)
-# cmake-format: on
+  $<$<NOT:$<CONFIG:Debug>>:/Gy>
+  $<$<NOT:$<CONFIG:Debug>>:/GL>
+  $<$<NOT:$<CONFIG:Debug>>:/Oi>
+)
+
+add_compile_definitions(
+  UNICODE
+  _UNICODE
+  _CRT_SECURE_NO_WARNINGS
+  _CRT_NONSTDC_NO_WARNINGS
+  $<$<CONFIG:DEBUG>:DEBUG>
+  $<$<CONFIG:DEBUG>:_DEBUG>
+)
+
+add_link_options(
+  $<$<NOT:$<CONFIG:Debug>>:/OPT:REF>
+  $<$<NOT:$<CONFIG:Debug>>:/OPT:ICF>
+  $<$<NOT:$<CONFIG:Debug>>:/LTCG>
+  $<$<NOT:$<CONFIG:Debug>>:/INCREMENTAL:NO>
+  /DEBUG
+  /Brepro
+)
 
 if(CMAKE_COMPILE_WARNING_AS_ERROR)
   add_link_options(/WX)

+ 10 - 0
cmake/windows/defaults.cmake

@@ -6,3 +6,13 @@ include_guard(GLOBAL)
 set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL TRUE)
 
 include(buildspec)
+
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+  set(
+    CMAKE_INSTALL_PREFIX
+    "$ENV{APPDATA}/obs-studio/plugins"
+    CACHE STRING
+    "Default plugin installation directory"
+    FORCE
+  )
+endif()

+ 44 - 67
cmake/windows/helpers.cmake

@@ -1,9 +1,5 @@
 # CMake Windows helper functions module
 
-# cmake-format: off
-# cmake-lint: disable=C0103
-# cmake-format: on
-
 include_guard(GLOBAL)
 
 include(helpers_common)
@@ -26,53 +22,37 @@ function(set_target_properties_plugin target)
 
   set_target_properties(${target} PROPERTIES VERSION 0 SOVERSION ${PLUGIN_VERSION})
 
-  install(
-    TARGETS ${target}
-    RUNTIME DESTINATION bin/64bit
-    LIBRARY DESTINATION obs-plugins/64bit)
+  install(TARGETS ${target} RUNTIME DESTINATION "${target}/bin/64bit" LIBRARY DESTINATION "${target}/bin/64bit")
 
   install(
     FILES "$<TARGET_PDB_FILE:${target}>"
     CONFIGURATIONS RelWithDebInfo Debug Release
-    DESTINATION obs-plugins/64bit
-    OPTIONAL)
-
-  if(OBS_BUILD_DIR)
-    add_custom_command(
-      TARGET ${target}
-      POST_BUILD
-      COMMAND "${CMAKE_COMMAND}" -E make_directory "${OBS_BUILD_DIR}/obs-plugins/64bit"
-      COMMAND
-        "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:${target}>"
-        "$<$<CONFIG:Debug,RelWithDebInfo,Release>:$<TARGET_PDB_FILE:${target}>>" "${OBS_BUILD_DIR}/obs-plugins/64bit"
-      COMMENT "Copy ${target} to obs-studio directory ${OBS_BUILD_DIR}"
-      VERBATIM)
-  endif()
+    DESTINATION "${target}/bin/64bit"
+    OPTIONAL
+  )
 
   if(TARGET plugin-support)
     target_link_libraries(${target} PRIVATE plugin-support)
   endif()
 
+  add_custom_command(
+    TARGET ${target}
+    POST_BUILD
+    COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>"
+    COMMAND
+      "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:${target}>"
+      "$<$<CONFIG:Debug,RelWithDebInfo,Release>:$<TARGET_PDB_FILE:${target}>>"
+      "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>"
+    COMMENT "Copy ${target} to rundir"
+    VERBATIM
+  )
+
   target_install_resources(${target})
 
   get_target_property(target_sources ${target} SOURCES)
   set(target_ui_files ${target_sources})
   list(FILTER target_ui_files INCLUDE REGEX ".+\\.(ui|qrc)")
-  source_group(
-    TREE "${CMAKE_CURRENT_SOURCE_DIR}"
-    PREFIX "UI Files"
-    FILES ${target_ui_files})
-
-  set(valid_uuid FALSE)
-  check_uuid(${_windowsAppUUID} valid_uuid)
-  if(NOT valid_uuid)
-    message(FATAL_ERROR "Specified Windows package UUID is not a valid UUID value: ${_windowsAppUUID}")
-  else()
-    set(UUID_APP ${_windowsAppUUID})
-  endif()
-
-  configure_file(cmake/windows/resources/installer-Windows.iss.in
-                 "${CMAKE_CURRENT_BINARY_DIR}/installer-Windows.generated.iss")
+  source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" PREFIX "UI Files" FILES ${target_ui_files})
 
   configure_file(cmake/windows/resources/resource.rc.in "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc")
   target_sources(${CMAKE_PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.rc")
@@ -84,28 +64,29 @@ function(target_install_resources target)
   if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/data")
     file(GLOB_RECURSE data_files "${CMAKE_CURRENT_SOURCE_DIR}/data/*")
     foreach(data_file IN LISTS data_files)
-      cmake_path(RELATIVE_PATH data_file BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/" OUTPUT_VARIABLE
-                 relative_path)
+      cmake_path(
+        RELATIVE_PATH
+        data_file
+        BASE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
+        OUTPUT_VARIABLE relative_path
+      )
       cmake_path(GET relative_path PARENT_PATH relative_path)
       target_sources(${target} PRIVATE "${data_file}")
       source_group("Resources/${relative_path}" FILES "${data_file}")
     endforeach()
 
-    install(
-      DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/"
-      DESTINATION data/obs-plugins/${target}
-      USE_SOURCE_PERMISSIONS)
-
-    if(OBS_BUILD_DIR)
-      add_custom_command(
-        TARGET ${target}
-        POST_BUILD
-        COMMAND "${CMAKE_COMMAND}" -E make_directory "${OBS_BUILD_DIR}/data/obs-plugins/${target}"
-        COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/data"
-                "${OBS_BUILD_DIR}/data/obs-plugins/${target}"
-        COMMENT "Copy ${target} resources to data directory"
-        VERBATIM)
-    endif()
+    install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/data/" DESTINATION "${target}/data" USE_SOURCE_PERMISSIONS)
+
+    add_custom_command(
+      TARGET ${target}
+      POST_BUILD
+      COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>/${target}"
+      COMMAND
+        "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/data"
+        "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>/${target}"
+      COMMENT "Copy ${target} resources to rundir"
+      VERBATIM
+    )
   endif()
 endfunction()
 
@@ -113,19 +94,15 @@ endfunction()
 function(target_add_resource target resource)
   message(DEBUG "Add resource '${resource}' to target ${target} at destination '${target_destination}'...")
 
-  install(
-    FILES "${resource}"
-    DESTINATION data/obs-plugins/${target}
-    COMPONENT Runtime)
+  install(FILES "${resource}" DESTINATION "${target}/data" COMPONENT Runtime)
 
-  if(OBS_BUILD_DIR)
-    add_custom_command(
-      TARGET ${target}
-      POST_BUILD
-      COMMAND "${CMAKE_COMMAND}" -E make_directory "${OBS_BUILD_DIR}/data/obs-plugins/${target}"
-      COMMAND "${CMAKE_COMMAND}" -E copy "${resource}" "${OBS_BUILD_DIR}/data/obs-plugins/${target}"
-      COMMENT "Copy ${target} resource ${resource} to library directory"
-      VERBATIM)
-  endif()
+  add_custom_command(
+    TARGET ${target}
+    POST_BUILD
+    COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>/${target}"
+    COMMAND "${CMAKE_COMMAND}" -E copy "${resource}" "${CMAKE_CURRENT_BINARY_DIR}/rundir/$<CONFIG>/${target}"
+    COMMENT "Copy ${target} resource ${resource} to rundir"
+    VERBATIM
+  )
   source_group("Resources" FILES "${resource}")
 endfunction()

+ 0 - 64
cmake/windows/resources/installer-Windows.iss.in

@@ -1,64 +0,0 @@
-#define MyAppName "@CMAKE_PROJECT_NAME@"
-#define MyAppVersion "@CMAKE_PROJECT_VERSION@"
-#define MyAppPublisher "@PLUGIN_AUTHOR@"
-#define MyAppURL "@PLUGIN_WEBSITE@"
-
-[Setup]
-; NOTE: The value of AppId uniquely identifies this application.
-; Do not use the same AppId value in installers for other applications.
-; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
-AppId={{@UUID_APP@}
-AppName={#MyAppName}
-AppVersion={#MyAppVersion}
-AppPublisher={#MyAppPublisher}
-AppPublisherURL={#MyAppURL}
-AppSupportURL={#MyAppURL}
-AppUpdatesURL={#MyAppURL}
-DefaultDirName={code:GetDirName}
-DefaultGroupName={#MyAppName}
-OutputBaseFilename={#MyAppName}-{#MyAppVersion}-Windows-Installer
-Compression=lzma
-SolidCompression=yes
-DirExistsWarning=no
-
-[Languages]
-Name: "english"; MessagesFile: "compiler:Default.isl"
-
-[Files]
-Source: "..\release\Package\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
-Source: "..\LICENSE"; Flags: dontcopy
-; NOTE: Don't use "Flags: ignoreversion" on any shared system files
-
-[Icons]
-Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
-Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
-
-[Code]
-procedure InitializeWizard();
-var
-  GPLText: AnsiString;
-  Page: TOutputMsgMemoWizardPage;
-begin
-  ExtractTemporaryFile('LICENSE');
-  LoadStringFromFile(ExpandConstant('{tmp}\LICENSE'), GPLText);
-  Page := CreateOutputMsgMemoPage(wpWelcome,
-    'License Information', 'Please review the license terms before installing {#MyAppName}',
-    'Press Page Down to see the rest of the agreement. Once you are aware of your rights, click Next to continue.',
-    String(GPLText)
-  );
-end;
-
-// credit where it's due :
-// following function come from https://github.com/Xaymar/obs-studio_amf-encoder-plugin/blob/master/%23Resources/Installer.in.iss#L45
-function GetDirName(Value: string): string;
-var
-  InstallPath: string;
-begin
-  // initialize default path, which will be returned when the following registry
-  // key queries fail due to missing keys or for some different reason
-  Result := '{autopf}\obs-studio';
-  // query the first registry value; if this succeeds, return the obtained value
-  if RegQueryStringValue(HKLM32, 'SOFTWARE\OBS Studio', '', InstallPath) then
-    Result := InstallPath
-end;
-