setup-sdl: Cannot use cmake --install --prefix for SDL2's sdl2.pc

From 7b724670646739baca9b39ae33eadd8719640444 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Tue, 4 Jul 2023 18:05:55 +0200
Subject: [PATCH] Cannot use cmake --install --prefix for SDL2's sdl2.pc

---
 packed/index.js | 8 ++++----
 src/main.ts     | 3 +--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/packed/index.js b/packed/index.js
index c2f03cc..2ea0a91 100644
--- a/packed/index.js
+++ b/packed/index.js
@@ -410,14 +410,16 @@ function cmake_configure_build(args) {
         return __generator(this, function (_a) {
             switch (_a.label) {
                 case 0:
-                    configure_args = __spreadArray([
+                    configure_args = __spreadArray(__spreadArray([
                         "cmake",
                         "-S",
                         args.source_dir,
                         "-B",
                         args.build_dir,
                         '-DSDL_VENDOR_INFO="libsdl-org/setup-sdl"'
-                    ], args.cmake_configure_args, true);
+                    ], args.cmake_configure_args, true), [
+                        "-DCMAKE_INSTALL_PREFIX=".concat(args.package_dir),
+                    ], false);
                     if (core.isDebug()) {
                         configure_args.push("--trace-expand");
                     }
@@ -435,8 +437,6 @@ function cmake_configure_build(args) {
                         "cmake",
                         "--install",
                         args.build_dir,
-                        "--prefix",
-                        args.package_dir,
                         "--config",
                         args.build_type,
                     ];
diff --git a/src/main.ts b/src/main.ts
index bed1ae8..bdc0eff 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -157,6 +157,7 @@ async function cmake_configure_build(args: {
     args.build_dir,
     '-DSDL_VENDOR_INFO="libsdl-org/setup-sdl"',
     ...args.cmake_configure_args,
+    `-DCMAKE_INSTALL_PREFIX=${args.package_dir}`,
   ];
   if (core.isDebug()) {
     configure_args.push("--trace-expand");
@@ -177,8 +178,6 @@ async function cmake_configure_build(args: {
     "cmake",
     "--install",
     args.build_dir,
-    "--prefix",
-    args.package_dir,
     "--config",
     args.build_type,
   ];