How to fix cmake < 3.5 compatibility error

Yep, that worked. Here’s the diff:

--- PKGBUILD-old	2025-04-26 11:03:28.387316931 -0600
+++ PKGBUILD-new	2025-04-26 11:02:53.905928978 -0600
@@ -6,9 +6,9 @@
 pkgdesc="OBS Plugin to allow inclusion of PDF documents in scenes"
 arch=('x86_64' 'i686')
 url="https://github.com/nleseul/${pkgname}"
-license=('Unlincense')
+license=('Unlicense')
 depends=('obs-studio' 'ghostscript')
-makedepends=('make')
+makedepends=('cmake')
 source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
 sha256sums=('ef06d36d1ce42515f89cd56180aa38f4aaad612f28feb5d8e90cbe4d6bfba078')
 
@@ -19,19 +19,20 @@
 }
 
 build() {
-    cd "$pkgname-$pkgver"
-    mkdir -p build
-    cd build
-    cmake .. \
-        -DOBSSourcePath=/usr/include/obs/ \
-        -DOBSLibraryPath=/usr/lib/obs-plugins/ \
-        -DCMAKE_INSTALL_PREFIX='/usr'
-    make
+    export CFLAGS+=" -Wno-incompatible-pointer-types"
+    export CXXFLAGS+=" -Wno-incompatible-pointer-types"
+    cmake -B build -S "$pkgname-$pkgver" \
+        -DCMAKE_BUILD_TYPE='None' \
+        -DCMAKE_INSTALL_PREFIX='/usr' \
+        -DOBSSourcePath='/usr/include/obs/' \
+        -DOBSLibraryPath='/usr/lib/obs-plugins/' \
+        -DCMAKE_POLICY_VERSION_MINIMUM='3.5' \
+        -Wno-dev
+    cmake --build build
 }
 
 package() {
-    cd "$pkgname-$pkgver/build"
-    make DESTDIR="$pkgdir/" install
+    DESTDIR="$pkgdir" cmake --install build
 }
 
 # vim:set ts=4 sw=4 et:
3 Likes