View Issue Details

IDProjectCategoryView StatusLast Update
0016862ScribusBuild Systempublic2022-11-19 15:39
Reporterfsimonis Assigned To 
PrioritylowSeveritytrivialReproducibilityN/A
Status newResolutionopen 
Product Version1.7.0.svn 
Summary0016862: CMake presets for relocatabel develop builds
DescriptionHi there,
Every time I pick up tinkering with scribus, I first need to figure out how to set up the build system, so that the resulting binary can actually find icons etc.

This patch provides CMake presets, which simplify all of the above.
This feature was added in CMake 3.19, but I used 3.21 as it adds support for install directories.

Assumptions are:
- Out-of-source build in the build/ directory
- Relocatable build by default
- install in the install/ directory

To use the feature:

List presets: cmake --list-presets
Select a preset: cmake --preset debug
Build: cmake --build build/
Install: cmake --install build/
Run: ./install/bin/scribus

I also added a build preset to build whatever is in build/
cmake --build --preset default
For parallel builds use the Ninja generator, pass -j $(nproc) to cmake --build, or set the env CMAKE_BUILD_PARALLEL_LEVEL to the amount of cores.
TagsNo tags attached.
PatchYes

Activities

fsimonis

2022-11-19 15:39

reporter  

0001-Add-relocatable-CMake-presets.patch (1,677 bytes)   
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

Issue History

Date Modified Username Field Change
2022-11-19 15:39 fsimonis New Issue
2022-11-19 15:39 fsimonis File Added: 0001-Add-relocatable-CMake-presets.patch