From e10eb7c62c1e56e60e5cb69fe290d65ff50e6652 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= <simonisfrederic@gmail.com>
Date: Sat, 19 Nov 2022 16:21:49 +0100
Subject: [PATCH] Add relocatable CMake presets

---
 .gitignore        |  1 +
 CMakePresets.json | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 CMakePresets.json

diff --git a/.gitignore b/.gitignore
index 567609b..dc28c5a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 build/
+install/
diff --git a/CMakePresets.json b/CMakePresets.json
new file mode 100644
index 0000000..1f8c701
--- /dev/null
+++ b/CMakePresets.json
@@ -0,0 +1,46 @@
+{
+  "version": 3,
+  "cmakeMinimumRequired": {
+    "major": 3,
+    "minor": 21,
+    "patch": 0
+  },
+  "configurePresets": [
+    {
+      "name": "base",
+      "hidden": true,
+      "binaryDir": "${sourceDir}/build",
+      "installDir": "${sourceDir}/install",
+      "cacheVariables": {
+        "WANT_RELOCATABLE": "ON"
+      }
+    },
+    {
+      "name": "debug",
+      "displayName": "Relocatable debug configuration",
+      "inherits": "base",
+      "cacheVariables": {
+        "WANT_DEBUG": "ON"
+      }
+    },
+    {
+      "name": "release",
+      "displayName": "Relocatable release configuration",
+      "inherits": "base"
+    },
+    {
+      "name": "profiling",
+      "displayName": "Relocatable profiling configuration",
+      "inherits": "base",
+      "cacheVariables": {
+        "WANT_RELEASEWITHDEBUG": "ON"
+      }
+    }
+  ],
+  "buildPresets": [
+    {
+      "name": "default",
+      "configurePreset": "base"
+    }
+  ]
+}
-- 
2.38.1

