Repository: christianhelle/sqlitequery
Pull request #78: Build Linux Packages
Author: login: christianhelle
Labels: name: build
description: CI / CD
Created: 2025-05-06T14:49:31Z | Merged: 2025-05-06T21:37:41Z

This pull request introduces significant changes to the build and packaging workflows for the `SQLiteQueryAnalyzer` project. The modifications transition the project from using `qmake` and `make` to a `CMake`-based workflow, add support for packaging using `CPack`, and enhance cross-platform build scripts. Below are the most important changes grouped by theme:

### Workflow and Build System Updates
* Updated `.github/workflows/linux.yml` to replace `qmake` and `make` with `CMake` commands for building, installing, and packaging. Added steps to generate multiple package formats (e.g., `.tar.gz`, `.deb`, `.rpm`) and publish artifacts. (`[.github/workflows/linux.ymlR27-R59](diffhunk://#diff-21364b2e6fae1f2875cee1ab3daefb0685403687eaf8bc32b5c6eacda351c9d3R27-R59)`)

### Packaging Configuration
* Added `CPack` configuration to `src/project/CMakeLists.txt`, including package metadata (e.g., name, description, vendor) and dependencies for Debian packages. (`[src/project/CMakeLists.txtR69-R78](diffhunk://#diff-d0b751957f9fb4c59680d6ce93db372b62d73a014e7986575db3ba0b1aff67ccR69-R78)`)
* Adjusted installation paths in `CMakeLists.txt` to ensure proper runtime and bundle destinations. (`[src/project/CMakeLists.txtL59-R60](diffhunk://#diff-d0b751957f9fb4c59680d6ce93db372b62d73a014e7986575db3ba0b1aff67ccL59-R60)`)

### Cross-Platform Build Script Enhancements
* Enhanced `src/project/build.ps1` to support packaging and installation on Linux and macOS. Introduced new flags (`-Package`, `-Install`) and added `CPack` commands for generating multiple package formats. (`[src/project/build.ps1L3-R46](diffhunk://#diff-3de23a5a48e2c382cd3171ccf8f406735f8588df45aeb0af436822b521fbf0ddL3-R46)`)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Added packaging support for multiple archive formats (7Z, ZIP, TBZ2, TGZ, TXZ, TZ) and Linux packages (DEB, RPM).
  - Introduced an install option in the build script for Linux, allowing direct installation and creation of a symlink for easier access.
  - Added post-install and pre-removal scripts to manage executable symlinks on Linux packages.

- **Improvements**
  - Switched the build system to use CMake for configuration, building, and packaging.
  - Enhanced build scripts for clearer separation and consistent handling of build, package, and install steps across platforms.
  - Updated workflow to upload packaged artifacts with version and platform-specific naming.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->


Diff:
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index 6e9a9a0..95dbbe3 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -24,6 +24,8 @@ jobs:
     - name: Update Version in code
       shell: pwsh
       run: |
+        $version = (Get-Content -Path src/project/CMakeLists.txt -Raw) -replace 'VERSION 1.0', 'VERSION "${{ env.VERSION }}"'
+        $version | Set-Content -Path src/project/CMakeLists.txt
         $version = (Get-Content -Path src/main.cpp -Raw) -replace '#define VERSION "1.0.0"', '#define VERSION "${{ env.VERSION }}"'
         $version | Set-Content -Path src/main.cpp
         cat src/main.cpp
@@ -31,9 +33,26 @@ jobs:
       uses: jurplel/install-qt-action@v4
       with:
         version: '6.9.0'
-    - name: QMake
-      run: qmake
+    - name: CMake
+      run: |
+        cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery .
+        cmake --build . --config Release --parallel 32
+        cmake --install . --config Release --prefix /tmp/sqlitequery
       working-directory: src/project
-    - name: Make
-      run: make -j 32
+    - name: Package
+      run: |
+        cpack -G 7Z
+        cpack -G ZIP
+        cpack -G TBZ2
+        cpack -G TGZ
+        cpack -G TXZ
+        cpack -G TZ
+        cpack -G DEB
+        cpack -G RPM
       working-directory: src/project
+    - name: Publish artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: SQLiteQueryAnalyzer_Linux_v${{ env.VERSION }}
+        path: |
+          src/project/SQLiteQueryAnalyzer-${{ env.VERSION }}-Linux.*
\ No newline at end of file
diff --git a/src/project/CMakeLists.txt b/src/project/CMakeLists.txt
index eeff4be..044a33a 100644
--- a/src/project/CMakeLists.txt
+++ b/src/project/CMakeLists.txt
@@ -7,7 +7,10 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
 set(app_icon_resource_windows "../resources/icon.rc")
 set(MACOSX_BUNDLE_ICON_FILE icon.icns)
 set(app_icon_macos "../resources/icon.icns")
-set_source_files_properties(${app_icon_macos} PROPERTIES MACOSX_PACKAGE_LOCATION "../resources")
+set_source_files_properties(${app_icon_macos}
+    PROPERTIES
+    MACOSX_PACKAGE_LOCATION
+    "../resources")
 
 find_package(QT NAMES Qt5 Qt6 REQUIRED COMPONENTS Core)
 find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Gui Sql)
@@ -50,14 +53,14 @@ target_link_libraries(SQLiteQueryAnalyzer PRIVATE
 )
 
 if ((QT_VERSION_MAJOR GREATER 4))
-    target_link_libraries(SQLiteQueryAnalyzer PRIVATE
+  target_link_libraries(SQLiteQueryAnalyzer PRIVATE
             Qt::Widgets
     )
 endif ()
 
 install(TARGETS SQLiteQueryAnalyzer
-        BUNDLE DESTINATION ..
-        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/build
+        BUNDLE DESTINATION .
+        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
 )
 
 qt_generate_deploy_app_script(
@@ -66,3 +69,16 @@ qt_generate_deploy_app_script(
         NO_UNSUPPORTED_PLATFORM_ERROR
 )
 install(SCRIPT ${deploy_script})
+
+set(CPACK_PACKAGE_NAME SQLiteQueryAnalyzer)
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SQLite Query Analyzer")
+set(CPACK_PACKAGE_VENDOR "Christian Resma Helle")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
+set(CPACK_VERBATIM_VARIABLES ON)
+set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/sqlitequery")
+set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Christian Resma Helle <crhelle@proton.me>")
+set(CPACK_DEBIAN_PACKAGE_DEPENDS libxcb-xinerama0)
+set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst" PARENT_SCOPE)
+set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/prerm" PARENT_SCOPE)
+include(CPack)
+
diff --git a/src/project/build.ps1 b/src/project/build.ps1
index f1e6355..498ad0a 100644
--- a/src/project/build.ps1
+++ b/src/project/build.ps1
@@ -1,22 +1,47 @@
 param (
     [switch]
-    $package = $false
+    $Package = $false,
+
+    [switch]
+    $Install = $false
 )
 
 if ($IsWindows) {
     cmake . -DCMAKE_PREFIX_PATH=C:/Qt/6.9.0/msvc2022_64 -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS="/Zc:__cplusplus /permissive-" -B build
     cmake --build build --config Release --parallel 32
-    if ($package) {
+    if ($Package) {
         C:\Qt\6.9.0\msvc2022_64\bin\windeployqt.exe .\build\Release\SQLiteQueryAnalyzer.exe
         ../../deps/innosetup/ISCC.exe setup.iss
     }
 } 
 
-if ($IsLinux -or $IsMacOS) {
-    cmake -B build
+if ($IsLinux) {
+    cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery
     cmake --build build --config Release --parallel 32
+
+    if ($Package) {
+        cpack -G 7Z --config ./build/CPackConfig.cmake
+        cpack -G ZIP --config ./build/CPackConfig.cmake
+        cpack -G TBZ2 --config ./build/CPackConfig.cmake
+        cpack -G TGZ --config ./build/CPackConfig.cmake
+        cpack -G TXZ --config ./build/CPackConfig.cmake
+        cpack -G TZ --config ./build/CPackConfig.cmake
+        cpack -G DEB --config ./build/CPackConfig.cmake
+        cpack -G RPM --config ./build/CPackConfig.cmake
+    }
+
+    if ($Install) {
+        cmake --install build
+        mkdir -p ~/.local/bin
+        ln -s /tmp/sqlitequery/bin/SQLiteQueryAnalyzer ~/.local/bin/sqlitequery
+    }
 }
 
-if ($IsMacOS -And $package) {
-    macdeployqt build/SQLiteQueryAnalyzer.app -dmg -appstore-compliant
+if ($IsMacOS -And $Package) {
+    
+    cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery
+    cmake --build build --config Release --parallel 32
+    if ($Package) {
+        macdeployqt build/SQLiteQueryAnalyzer.app -dmg -appstore-compliant
+    }
 }
diff --git a/src/project/postinst b/src/project/postinst
new file mode 100755
index 0000000..218c44b
--- /dev/null
+++ b/src/project/postinst
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+ln -s /opt/sqlitequery/bin/SQLiteQueryAnalyzer /usr/bin/sqlitequery
diff --git a/src/project/prerm b/src/project/prerm
new file mode 100755
index 0000000..ab8d06a
--- /dev/null
+++ b/src/project/prerm
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+rm /usr/bin/sqlitequery


Reviews:
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

This pull request updates the Linux build workflow for the SQLiteQueryAnalyzer project by transitioning to a CMake-based build system, integrating CPack for packaging, and enhancing cross-platform build scripts.  
- Replaces QMake/Make with CMake commands and steps to generate multi-format packages.  
- Updates package metadata and installation paths in CMakeLists.txt.  
- Enhances the PowerShell build script to support Linux and macOS installation and packaging.

<details>
<summary>Files not reviewed (2)</summary>

* **src/project/CMakeLists.txt**: Language not supported
* **src/project/build.ps1**: Language not supported
</details>



state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-06T14:50:13Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 1**

<details>
<summary>🧹 Nitpick comments (3)</summary><blockquote>

<details>
<summary>src/project/CMakeLists.txt (1)</summary><blockquote>

`70-78`: **Good CPack configuration setup**

The CPack configuration is well-structured with all necessary metadata for proper package generation. The Debian dependencies (libc6, libstdc++6, libgcc-s1) are appropriate standard system libraries.


Consider also adding RPM package dependencies with CPACK_RPM_PACKAGE_DEPENDS for more comprehensive cross-platform packaging support.

</blockquote></details>
<details>
<summary>.github/workflows/linux.yml (1)</summary><blockquote>

`53-58`: **Missing newline at end of file**

The artifact publication looks good, but there's a missing newline character at the end of the file.

Add a newline character at the end of the file to comply with YAML best practices.

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 YAMLlint (1.35.1)</summary>

[error] 58-58: no new line character at the end of file

(new-line-at-end-of-file)

</details>

</details>

</blockquote></details>
<details>
<summary>src/project/build.ps1 (1)</summary><blockquote>

`39-46`: **Redundant conditional check for macOS packaging**

The macOS build section has a redundant conditional check for $Package.

Line 43's `if ($Package)` check is redundant since the entire block at line 39 already checks `if ($IsMacOS -And $Package)`. You can remove the nested condition and keep the macdeployqt command.

```diff
-if ($IsMacOS -And $Package) {
+if ($IsMacOS) {
     
     cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery
     cmake --build build --config Release --parallel 32
-    if ($Package) {
+    if ($Package) {
         macdeployqt build/SQLiteQueryAnalyzer.app -dmg -appstore-compliant
     }
 }
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 0d04d17945d4c01c653092843c2b710746570343 and f5e8b1c91ba3994055f7e060755b799c8d8d0473.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `.github/workflows/linux.yml` (1 hunks)
* `src/project/CMakeLists.txt` (2 hunks)
* `src/project/build.ps1` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 YAMLlint (1.35.1)</summary>

<details>
<summary>.github/workflows/linux.yml</summary>

[error] 58-58: no new line character at the end of file

(new-line-at-end-of-file)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (5)</summary><blockquote>

<details>
<summary>src/project/CMakeLists.txt (1)</summary>

`59-60`: **Well-structured installation path changes**

The updates to installation paths are appropriate. Using the current directory for BUNDLE and ${CMAKE_INSTALL_BINDIR} for RUNTIME follows CMake best practices and provides better consistency with standard installation locations.

</details>
<details>
<summary>.github/workflows/linux.yml (3)</summary>

`27-28`: **Consistent version management**

Good approach to update the version in CMakeLists.txt, which aligns with the migration to CMake build system.

---

`36-41`: **Well-structured CMake build process**

The transition from qmake/make to CMake is well-implemented with appropriate configuration for Release builds and installation paths.

---

`42-52`: **Comprehensive package format support**

Excellent addition of multiple package formats using CPack, which will improve distribution options for different Linux environments.

</details>
<details>
<summary>src/project/build.ps1 (1)</summary>

`1-7`: **Improved parameter structure**

The parameter structure is now more consistent and provides separate control for packaging and installation operations.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-06T15:02:09Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 1**

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>.github/workflows/linux.yml (1)</summary><blockquote>

`53-58`: **Missing newline at end of file**

While the artifact publishing looks good, the file is missing a newline at the end, which some tools flag as an issue.

```diff
          src/project/SQLiteQueryAnalyzer-${{ env.VERSION }}-Linux.*
+
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 YAMLlint (1.35.1)</summary>

[error] 58-58: no new line character at the end of file

(new-line-at-end-of-file)

</details>

</details>

</blockquote></details>
<details>
<summary>src/project/build.ps1 (1)</summary><blockquote>

`39-45`: **Redundant package condition check in macOS section**

The macOS section checks `$Package` twice - once in the outer if statement and again in the nested if. This is redundant and could be simplified.

```diff
-if ($IsMacOS -And $Package) {
+if ($IsMacOS) {
     
     cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery
     cmake --build build --config Release --parallel 32
     if ($Package) {
         macdeployqt build/SQLiteQueryAnalyzer.app -dmg -appstore-compliant
     }
}
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 0d04d17945d4c01c653092843c2b710746570343 and f5e8b1c91ba3994055f7e060755b799c8d8d0473.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `.github/workflows/linux.yml` (1 hunks)
* `src/project/CMakeLists.txt` (2 hunks)
* `src/project/build.ps1` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 YAMLlint (1.35.1)</summary>

<details>
<summary>.github/workflows/linux.yml</summary>

[error] 58-58: no new line character at the end of file

(new-line-at-end-of-file)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (7)</summary><blockquote>

<details>
<summary>src/project/CMakeLists.txt (2)</summary>

`59-60`: **Updated installation destinations improve deployment consistency**

The updated BUNDLE and RUNTIME destinations properly align with CMake best practices. Setting BUNDLE DESTINATION to "." ensures the application bundle is installed in the expected location, while updating RUNTIME DESTINATION to ${CMAKE_INSTALL_BINDIR} follows standard system directory conventions.

---

`70-78`: <details>
<summary>✅ Verification successful</summary>

**Well-structured CPack configuration for multi-format packaging**

The CPack configuration is comprehensive and properly sets up metadata for various package formats. The installation prefix in `/opt` is appropriate for standalone applications, and the Debian package dependencies cover the essential runtime libraries.


One suggestion to consider - verify that the installation prefix is consistent across all your build scripts and documentation.

---

🏁 Script executed:

```shell
#!/bin/bash
# Check for consistency of installation paths across build files
grep -r "CMAKE_INSTALL_PREFIX\|CPACK_PACKAGING_INSTALL_PREFIX" .github/workflows/ src/project/
```

Length of output: 505

---



</details>

**Installation prefix consistency verified**

The CI workflows and PowerShell build scripts use CMAKE_INSTALL_PREFIX=/tmp/sqlitequery to stage files, while CPACK_PACKAGING_INSTALL_PREFIX is deliberately set to /opt/sqlitequery in CMakeLists.txt for the final package install location. These values serve different purposes (staging vs. target installation) and are intentionally distinct—no changes required.

</details>
<details>
<summary>.github/workflows/linux.yml (3)</summary>

`27-28`: **Effective version string replacement strategy**

The PowerShell commands correctly update the version string in CMakeLists.txt, ensuring consistent versioning across the project.

---

`36-41`: **Build process successfully modernized to use CMake**

The transition from qmake/make to CMake with explicit build type and installation prefix is a significant improvement. The parallel build flag will accelerate CI builds on multicore systems.

---

`42-52`: **Comprehensive packaging strategy with multiple formats**

The CPack commands generate an impressive variety of package formats (archives and Linux-specific packages), providing excellent distribution flexibility.

</details>
<details>
<summary>src/project/build.ps1 (2)</summary>

`3-6`: **Parameter naming improved and installation option added**

Capitalizing `$Package` follows PowerShell conventions, and adding the `$Install` switch provides useful flexibility for users.

---

`18-31`: **Comprehensive Linux build and packaging configuration**

The updated Linux build section properly configures CMake with release mode and generates multiple package formats consistent with the GitHub workflow.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-06T15:07:23Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 1**

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>src/project/CMakeLists.txt (2)</summary><blockquote>

`10-13`: **Multi-line formatting for macOS resource is acceptable but consider consistency.**  
The refactored `set_source_files_properties` call remains functionally identical. For readability, ensure that similar blocks elsewhere follow this indentation and quoting style (e.g., no unnecessary quotes around paths unless required).

---

`56-58`: **Unify indentation for `target_link_libraries`.**  
The extra indentation here differs from the earlier Qt::Core/Gui/Sql block. For consistency, align the lists in all `target_link_libraries` calls:

```diff
-if ((QT_VERSION_MAJOR GREATER 4))
-  target_link_libraries(SQLiteQueryAnalyzer PRIVATE
-            Qt::Widgets
-  )
-endif ()
+if (QT_VERSION_MAJOR GREATER 4)
+  target_link_libraries(SQLiteQueryAnalyzer PRIVATE Qt::Widgets)
+endif()
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between f5e8b1c91ba3994055f7e060755b799c8d8d0473 and f3e06d4ca3c50659d36bdc8d04857f15389bfed6.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `src/project/CMakeLists.txt` (3 hunks)
* `src/project/postinst` (1 hunks)
* `src/project/prerm` (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (2)</summary>

* src/project/prerm
* src/project/postinst

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (2)</summary>

* GitHub Check: macos-intel / template
* GitHub Check: build

</details>

<details>
<summary>🔇 Additional comments (1)</summary><blockquote>

<details>
<summary>src/project/CMakeLists.txt (1)</summary>

`62-63`: **Verify install destinations for all platforms.**  
Installing `BUNDLE DESTINATION .` is intended for macOS bundles, while `RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}` targets executables on other systems. Confirm in CI and package tests that:
1. On macOS, the `.app` ends up at `<prefix>/SQLiteQueryAnalyzer.app`.  
2. On Linux/Windows, the binary installs to `<prefix>/bin` (as per `CMAKE_INSTALL_BINDIR`).

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-06T20:28:03Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>♻️ Duplicate comments (2)</summary><blockquote>

<details>
<summary>src/project/build.ps1 (2)</summary><blockquote>

`33-36`: _⚠️ Potential issue_

**Linux installation symlink is reversed.**

The symbolic link command has the source and target reversed. It should create a symlink from the system directory to the installed binary, not the other way around.


```diff
if ($Install) {
    cmake --install build
-    ln -s ~/.local/bin/sqlitequery /tmp/sqlitequery/bin/SQLiteQueryAnalyzer
+    mkdir -p ~/.local/bin
+    ln -s /tmp/sqlitequery/bin/SQLiteQueryAnalyzer ~/.local/bin/sqlitequery
}
```

Additionally, you should create the `~/.local/bin` directory if it doesn't exist, as it's not guaranteed to be present on all Linux distributions.

---

`33-36`: _🛠️ Refactor suggestion_

**Consider a more reliable installation location than /tmp**

Using `/tmp` for installation is problematic as this directory is cleared on system reboot on most Linux distributions, leading to lost installations.


Consider using a more persistent location aligned with the XDG specification:

```diff
if ($Install) {
-   cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery
+   cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$env:HOME/.local"
    cmake --build build --config Release --parallel 32
    cmake --install build
-   ln -s ~/.local/bin/sqlitequery /tmp/sqlitequery/bin/SQLiteQueryAnalyzer
}
```

This installs directly to a user-specific location that persists across reboots and follows the XDG specification, eliminating the need for manual symlink creation.

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (3)</summary><blockquote>

<details>
<summary>.github/workflows/linux.yml (2)</summary><blockquote>

`36-40`: **The CMake configuration looks good, but there's a redundant prefix setting.**

The `--prefix` flag in the install command is redundant since you've already set the install prefix during configuration. Both are using the same value, so it's not causing issues, but one of them is unnecessary.


```diff
  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery .
  cmake --build . --config Release --parallel 32
- cmake --install . --config Release --prefix /tmp/sqlitequery
+ cmake --install . --config Release
```

---

`53-58`: **Artifact publishing looks good, but missing newline at end of file.**

The artifact naming is correct, and the path pattern will capture all generated package formats.


Add a newline at the end of the file to satisfy YAML linting requirements:

```diff
  path: |
    src/project/SQLiteQueryAnalyzer-${{ env.VERSION }}-Linux.*
+
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 YAMLlint (1.35.1)</summary>

[error] 58-58: no new line character at the end of file

(new-line-at-end-of-file)

</details>

</details>

</blockquote></details>
<details>
<summary>src/project/build.ps1 (1)</summary><blockquote>

`39-46`: **macOS build block has a redundant condition.**

The condition on line 39 already checks for `$IsMacOS -And $Package`, making the inner `if ($Package)` check redundant.


```diff
-if ($IsMacOS -And $Package) {
+if ($IsMacOS) {
    
    cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery
    cmake --build build --config Release --parallel 32
    if ($Package) {
        macdeployqt build/SQLiteQueryAnalyzer.app -dmg -appstore-compliant
    }
}
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between f3e06d4ca3c50659d36bdc8d04857f15389bfed6 and 29605d815aa58c45d7a094ba075bffa1f8260ed2.

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `.github/workflows/linux.yml` (1 hunks)
* `src/project/CMakeLists.txt` (3 hunks)
* `src/project/build.ps1` (1 hunks)
* `src/project/postinst` (1 hunks)
* `src/project/prerm` (1 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (3)</summary>

* src/project/prerm
* src/project/postinst
* src/project/CMakeLists.txt

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 YAMLlint (1.35.1)</summary>

<details>
<summary>.github/workflows/linux.yml</summary>

[error] 58-58: no new line character at the end of file

(new-line-at-end-of-file)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (5)</summary><blockquote>

<details>
<summary>.github/workflows/linux.yml (2)</summary>

`27-28`: **Version string update in CMakeLists.txt looks good.**

The script now updates the version in the CMakeLists.txt file to maintain consistency with the version defined in the environment variables, which is an important part of the transition to CMake-based builds.

---

`42-52`: **Comprehensive packaging approach with CPack.**

Using CPack to generate multiple package formats provides excellent flexibility for users. The inclusion of both archive formats (7Z, ZIP, TBZ2, etc.) and Linux package formats (DEB, RPM) is a good approach for distribution.

</details>
<details>
<summary>src/project/build.ps1 (3)</summary>

`2-7`: **Parameter declaration improvements are good.**

The script now properly declares parameters using PowerShell conventions, with the `$Package` parameter renamed (capitalized) and a new `$Install` parameter added to support installation operations.

---

`12-12`: **Variable name has been properly capitalized.**

The conditional now uses the capitalized `$Package` parameter name, consistent with the parameter declaration.

---

`18-31`: **Linux build and package steps look good.**

The Linux-specific build section now properly uses CMake with appropriate build type and installation paths. The packaging options with CPack are comprehensive and align with the workflow configuration.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-06T20:58:43Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>♻️ Duplicate comments (1)</summary><blockquote>

<details>
<summary>src/project/build.ps1 (1)</summary><blockquote>

`33-37`: _⚠️ Potential issue_

**Ensure reliable install location on Linux**

The installation to `/tmp/sqlitequery` is problematic as this is an ephemeral directory that will be cleared on system reboot, leading to the application being unavailable after restart.


Consider using a persistent location following the FHS or XDG specifications:

```diff
- cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery
+ cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$env:HOME/.local"

  if ($Install) {
      cmake --install build
-     mkdir -p ~/.local/bin
-     ln -s /tmp/sqlitequery/bin/SQLiteQueryAnalyzer ~/.local/bin/sqlitequery
  }
```

Using `$env:HOME/.local` as the install prefix follows the XDG Base Directory Specification and eliminates the need for manual symlinking.

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>src/project/build.ps1 (2)</summary><blockquote>

`40-46`: **Simplify macOS conditional logic**

The `$Package` condition is checked twice unnecessarily.


```diff
- if ($IsMacOS -And $Package) {
+ if ($IsMacOS) {
    
    cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery
    cmake --build build --config Release --parallel 32
    if ($Package) {
        macdeployqt build/SQLiteQueryAnalyzer.app -dmg -appstore-compliant
    }
}
```

---

`40-47`: **Consider adding install support for macOS**

The script supports installation on Linux but not on macOS. For consistency across platforms, consider adding similar install functionality for macOS.


```diff
if ($IsMacOS) {
    cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery
    cmake --build build --config Release --parallel 32
    if ($Package) {
        macdeployqt build/SQLiteQueryAnalyzer.app -dmg -appstore-compliant
    }
+   if ($Install) {
+       cmake --install build
+       mkdir -p /usr/local/bin
+       ln -s /tmp/sqlitequery/bin/SQLiteQueryAnalyzer /usr/local/bin/sqlitequery
+   }
}
```

Note that this would also benefit from using a persistent installation path rather than `/tmp/sqlitequery`.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 29605d815aa58c45d7a094ba075bffa1f8260ed2 and 0d9347907d624b778cd3186b4fbca4d76aa0c8dd.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `src/project/build.ps1` (1 hunks)

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (3)</summary>

* GitHub Check: build / template
* GitHub Check: macos-intel / template
* GitHub Check: build

</details>

<details>
<summary>🔇 Additional comments (4)</summary><blockquote>

<details>
<summary>src/project/build.ps1 (4)</summary>

`3-6`: **Good parameter naming improvements**

The capitalization of `$Package` parameter follows PowerShell naming conventions better, and the addition of the `$Install` switch is a good separation of build, package, and install concerns.

---

`12-12`: **LGTM - Parameter name updated for consistency**

Updated to use the renamed parameter with capital P.

---

`18-20`: **Improved explicit CMake configuration**

The separate Linux block with explicit `CMAKE_BUILD_TYPE` and installation prefix is clearer than before.

---

`22-31`: **Comprehensive packaging options for Linux**

This is a great addition using CPack to support multiple packaging formats, aligning with the new CPack configuration in CMakeLists.txt.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-06T21:02:24Z

Review comments:
diff_hunk: @@ -24,16 +24,36 @@ jobs:
     - name: Update Version in code
       shell: pwsh
       run: |
+        $version = (Get-Content -Path src/project/CMakeLists.txt -Raw) -replace 'VERSION 1.0', 'VERSION "${{ env.VERSION }}"'
+        $version | Set-Content -Path src/project/CMakeLists.txt
         $version = (Get-Content -Path src/main.cpp -Raw) -replace '#define VERSION "1.0.0"', '#define VERSION "${{ env.VERSION }}"'
         $version | Set-Content -Path src/main.cpp
         cat src/main.cpp
     - name: Install Qt
       uses: jurplel/install-qt-action@v4
       with:
         version: '6.9.0'
-    - name: QMake
-      run: qmake
+    - name: CMake
+      run: |
+        cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery .
+        cmake --build . --config Release --parallel 32
+        cmake --install . --config Release --prefix /tmp/sqlitequery
       working-directory: src/project
-    - name: Make
-      run: make -j 32
+    - name: Package
+      run: |
+        tar -czf SQLiteQueryAnalyzer.tar.gz -C /tmp/sqlitequery .
+        cpack -G 7Z
+        cpack -G ZIP
+        cpack -G TBZ2
+        cpack -G TGZ
+        cpack -G TXZ
+        cpack -G TZ
+        cpack -G DEB
+        cpack -G RPM
       working-directory: src/project
+    - name: Publish artifacts
+      uses: actions/upload-artifact@v4
+      with:
+        name: SQLiteQuerAnalyzer_Linux_v${{ env.VERSION }}
path: .github/workflows/linux.yml
user: login: Copilot
body: There appears to be a typo in the artifact name. Consider renaming 'SQLiteQuerAnalyzer' to 'SQLiteQueryAnalyzer' to maintain consistency.
```suggestion
        name: SQLiteQueryAnalyzer_Linux_v${{ env.VERSION }}
```
created_at: 2025-05-06T14:50:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -24,16 +24,36 @@ jobs:
     - name: Update Version in code
       shell: pwsh
       run: |
+        $version = (Get-Content -Path src/project/CMakeLists.txt -Raw) -replace 'VERSION 1.0', 'VERSION "${{ env.VERSION }}"'
+        $version | Set-Content -Path src/project/CMakeLists.txt
         $version = (Get-Content -Path src/main.cpp -Raw) -replace '#define VERSION "1.0.0"', '#define VERSION "${{ env.VERSION }}"'
         $version | Set-Content -Path src/main.cpp
         cat src/main.cpp
     - name: Install Qt
       uses: jurplel/install-qt-action@v4
       with:
         version: '6.9.0'
-    - name: QMake
-      run: qmake
+    - name: CMake
+      run: |
+        cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery .
+        cmake --build . --config Release --parallel 32
+        cmake --install . --config Release --prefix /tmp/sqlitequery
       working-directory: src/project
-    - name: Make
-      run: make -j 32
+    - name: Package
+      run: |
+        tar -czf SQLiteQueryAnalyzer.tar.gz -C /tmp/sqlitequery .
path: .github/workflows/linux.yml
user: login: Copilot
body: [nitpick] Since multiple package formats are generated using CPack later in the workflow, consider unifying the packaging approach by either relying solely on CPack or clearly documenting the need for a separate manual tar creation.
```suggestion
        cpack -G TGZ
```
created_at: 2025-05-06T14:50:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,22 +1,46 @@
 param (
     [switch]
-    $package = $false
+    $Package = $false,
+
+    [switch]
+    $Install = $false
 )
 
 if ($IsWindows) {
     cmake . -DCMAKE_PREFIX_PATH=C:/Qt/6.9.0/msvc2022_64 -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS="/Zc:__cplusplus /permissive-" -B build
     cmake --build build --config Release --parallel 32
-    if ($package) {
+    if ($Package) {
         C:\Qt\6.9.0\msvc2022_64\bin\windeployqt.exe .\build\Release\SQLiteQueryAnalyzer.exe
         ../../deps/innosetup/ISCC.exe setup.iss
     }
 } 
 
-if ($IsLinux -or $IsMacOS) {
-    cmake -B build
+if ($IsLinux) {
+    cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery
     cmake --build build --config Release --parallel 32
+
+    if ($Package) {
+        cpack -G 7Z --config ./build/CPackConfig.cmake
+        cpack -G ZIP --config ./build/CPackConfig.cmake
+        cpack -G TBZ2 --config ./build/CPackConfig.cmake
+        cpack -G TGZ --config ./build/CPackConfig.cmake
+        cpack -G TXZ --config ./build/CPackConfig.cmake
+        cpack -G TZ --config ./build/CPackConfig.cmake
+        cpack -G DEB --config ./build/CPackConfig.cmake
+        cpack -G RPM --config ./build/CPackConfig.cmake
+    }
+
+    if ($Install) {
+        cmake --install build
+        ln -s ~/.local/bin/sqlitequery /tmp/sqlitequery/bin/SQLiteQueryAnalyzer
+    }
 }
path: src/project/build.ps1
user: login: coderabbitai[bot]
body: _💡 Verification agent_

<details>
<summary>🧩 Analysis chain</summary>

**Comprehensive Linux build and package configuration**

The Linux build process now properly utilizes CMake with appropriate build type and installation paths. The packaging options are comprehensive and aligned with the CPack configuration in CMakeLists.txt.


---

🏁 Script executed:

```shell
#!/bin/bash
# Verify the symbolic link target path
echo "Checking if ~/.local/bin is a standard location for this Linux distribution..."
if [ -d ~/.local/bin ]; then
  echo "~/.local/bin exists"
else
  echo "~/.local/bin doesn't exist on this system"
fi

# Check if there are any standard Linux packaging guidelines that recommend against /tmp for installation
echo "Checking if /tmp is an appropriate location for installation..."
echo "Note: /tmp is typically cleared on reboot and may not be appropriate for permanent installation"
```

Length of output: 639

---



</details>

**Ensure reliable install location and symlink setup on Linux**

The current Linux install uses `/tmp/sqlitequery` (an ephemeral path) and creates a symlink in `~/.local/bin`, which often doesn’t exist by default. This can cause silent failures or lost installs after a reboot.

Suggested fixes:

- Create the user‐local bin directory before linking:
  ```powershell
  if ($Install) {
      cmake --install build
      # Ensure ~/.local/bin exists
      $localBin = "$env:HOME/.local/bin"
      if (-not (Test-Path $localBin)) {
          New-Item -ItemType Directory -Path $localBin -Force | Out-Null
      }
      # Link the installed binary into the user’s PATH
      ln -sf /tmp/sqlitequery/bin/SQLiteQueryAnalyzer "$localBin/sqlitequery"
  }
  ```
- Alternatively, use a persistent install prefix and drop the manual symlink:
  ```powershell
  cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$env:HOME/.local"
  cmake --install build
  ```
  This aligns with the XDG spec and avoids `/tmp` entirely.

<!-- This is an auto-generated comment by CodeRabbit -->

✅ Addressed in commit 0d93479
created_at: 2025-05-06T15:02:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,22 +1,46 @@
 param (
     [switch]
-    $package = $false
+    $Package = $false,
+
+    [switch]
+    $Install = $false
 )
 
 if ($IsWindows) {
     cmake . -DCMAKE_PREFIX_PATH=C:/Qt/6.9.0/msvc2022_64 -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS="/Zc:__cplusplus /permissive-" -B build
     cmake --build build --config Release --parallel 32
-    if ($package) {
+    if ($Package) {
         C:\Qt\6.9.0\msvc2022_64\bin\windeployqt.exe .\build\Release\SQLiteQueryAnalyzer.exe
         ../../deps/innosetup/ISCC.exe setup.iss
     }
 } 
 
-if ($IsLinux -or $IsMacOS) {
-    cmake -B build
+if ($IsLinux) {
+    cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/sqlitequery
     cmake --build build --config Release --parallel 32
+
+    if ($Package) {
+        cpack -G 7Z --config ./build/CPackConfig.cmake
+        cpack -G ZIP --config ./build/CPackConfig.cmake
+        cpack -G TBZ2 --config ./build/CPackConfig.cmake
+        cpack -G TGZ --config ./build/CPackConfig.cmake
+        cpack -G TXZ --config ./build/CPackConfig.cmake
+        cpack -G TZ --config ./build/CPackConfig.cmake
+        cpack -G DEB --config ./build/CPackConfig.cmake
+        cpack -G RPM --config ./build/CPackConfig.cmake
+    }
+
+    if ($Install) {
+        cmake --install build
+        ln -s ~/.local/bin/sqlitequery /tmp/sqlitequery/bin/SQLiteQueryAnalyzer
+    }
path: src/project/build.ps1
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Linux installation symlink appears reversed**

The symlink creation appears to be reversed. It's currently linking from a user directory to a temporary directory, which will break after system reboot.

```diff
- ln -s ~/.local/bin/sqlitequery /tmp/sqlitequery/bin/SQLiteQueryAnalyzer
+ mkdir -p ~/.local/bin
+ ln -s /tmp/sqlitequery/bin/SQLiteQueryAnalyzer ~/.local/bin/sqlitequery
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
    if ($Install) {
        cmake --install build
        mkdir -p ~/.local/bin
        ln -s /tmp/sqlitequery/bin/SQLiteQueryAnalyzer ~/.local/bin/sqlitequery
    }
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-06T15:07:23Z
author_association: CONTRIBUTOR
diff_hunk: @@ -66,3 +69,16 @@ qt_generate_deploy_app_script(
         NO_UNSUPPORTED_PLATFORM_ERROR
 )
 install(SCRIPT ${deploy_script})
+
+set(CPACK_PACKAGE_NAME SQLiteQueryAnalyzer)
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SQLite Query Analyzer")
+set(CPACK_PACKAGE_VENDOR "Christian Resma Helle")
+set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
+set(CPACK_VERBATIM_VARIABLES ON)
+set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/sqlitequery")
+set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Christian Resma Helle <crhelle@proton.me>")
+set(CPACK_DEBIAN_PACKAGE_DEPENDS libxcb-xinerama0)
+set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst" PARENT_SCOPE)
+set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/prerm" PARENT_SCOPE)
+include(CPack)
path: src/project/CMakeLists.txt
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Fix Debian control script inclusion to avoid overriding.**  
Currently, two separate `set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA … PARENT_SCOPE)` calls will overwrite each other, causing only `prerm` to be installed. Combine them into a single list and drop `PARENT_SCOPE` (unnecessary at top-level):

```diff
-set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst" PARENT_SCOPE)
-set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/prerm" PARENT_SCOPE)
+set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
+    "${CMAKE_CURRENT_SOURCE_DIR}/postinst"
+    "${CMAKE_CURRENT_SOURCE_DIR}/prerm"
+)
```

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-06T20:28:02Z
author_association: CONTRIBUTOR

PR comments:
user: login: coderabbitai[bot]
created_at: 2025-05-06T14:49:38Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough

The changes transition the Linux build and packaging process from QMake/Make to CMake/CPack, update the GitHub workflow to automate version string replacement and artifact uploads, and enhance the PowerShell build script with explicit build, package, and install steps for multiple platforms. CPack packaging metadata, Debian control scripts, and install destinations are also refined in the CMake configuration.

## Changes

| File(s)                                         | Change Summary                                                                                                                                                                                                                                    |
|------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| .github/workflows/linux.yml                     | Switched build system from QMake/Make to CMake; added version string update in `CMakeLists.txt`; configured packaging with CPack for multiple archive and Linux package formats; added artifact upload step with version and platform naming.      |
| src/project/CMakeLists.txt                      | Modified install destinations for bundle/runtime; added CPack configuration for package metadata, install prefix, Debian maintainer and dependencies; referenced Debian package control scripts (`postinst`, `prerm`); enabled packaging support. |
| src/project/build.ps1                           | Added `[switch] $Install` parameter; renamed `$package` to `$Package`; refined build/packaging logic for Windows, Linux, and macOS; added explicit install step and symlink creation on Linux; improved parameter consistency and platform separation. |
| src/project/postinst                            | Added post-install script creating symlink `/usr/bin/sqlitequery` pointing to `/opt/sqlitequery/bin/SQLiteQueryAnalyzer`.                                                                                                                        |
| src/project/prerm                               | Added pre-removal script removing `/usr/bin/sqlitequery` symlink during package uninstall or upgrade.                                                                                                                                             |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant GitHub Actions
    participant Build Script
    participant CMake
    participant CPack
    participant Artifact Store

    GitHub Actions->>Build Script: Trigger Linux workflow
    Build Script->>CMake: Configure & build (Release, install prefix)
    Build Script->>CMake: Install to prefix (if requested)
    Build Script->>CPack: Package in multiple archive and Linux package formats (if requested)
    Build Script->>Artifact Store: Upload packaged artifacts with version/platform naming
```

## Possibly related PRs

- christianhelle/sqlitequery#77: Modifies GitHub Actions workflows to update the version string in `CMakeLists.txt` and improve build steps, focusing on Windows workflow and version update improvements, related by version update automation in workflows.

## Poem

> 🐇  
> Hopped from QMake to CMake’s den,  
> Packed with CPack, again and again.  
> Artifacts bundled, zipped, and neat,  
> Linux, Windows, all complete!  
> With scripts refined and steps anew,  
> This bunny builds for every crew.  
> 🗃️✨

<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNxU3bABsvkCiQBHbGlcABpIcVwvOkgAIgAhbHgvegAZeAxsAA9rNAYAazRSRFjIOUhsREpGWAokcUxYEh8SSAAKW0gzAHYADgBKcIzcCkVsBmlIZjQhfD5sblpqSYIIprKklPQMem48wqIMokgAdzn8gDMvfBPkfAu11oADAGUARXSaN+CXAEEMNBeWQAL0oTx4oxEYg0MHW+RI8gYsEwxRQGAk+C8UgiVAwiHU8HwGCOjw2yXoiFkiBozEgF1GtKeAWm8PBmHoTxZJHBqzQkCeAGEALJoVlgARoKr0M4US7XE7hNC0WgkhzcbhzXB0uY8fZFEkSeB8wVWfZPRU7FDMXj4Q0YY4MUaIRBgbheagXOa0gSbCmO+DcXCIDRGF7cUTwC7wBiAoHhXDrADi6gAEtgBJBfmJCXjTucrjdtXx0pkcm0nhpDgn0wB6GVym6IGteDLZDS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raBZregqrugLhdoqqPFehGqBALg6ABrFqQqvFGqhqqrpqbq0A0AqregGBd0vrug0BMEOqJRhqqrHr6JdoLhegvEhq6AvFXrlrMFaBGqPE5rGrhraABqvFd0xq+gGBDrdpehjrd0LgBAYxd1aBugBrfrMFTr6ByqsrTwcq8q/UCrIoEZaA/V3YMqgA=== -->

<!-- internal state end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=christianhelle/sqlitequery&utm_content=78):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: CONTRIBUTOR
user: login: sonarqubecloud[bot]
created_at: 2025-05-06T21:00:42Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=christianhelle_sqlitequery&pullRequest=78) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=christianhelle_sqlitequery&pullRequest=78&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=christianhelle_sqlitequery&pullRequest=78&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=christianhelle_sqlitequery&pullRequest=78&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=christianhelle_sqlitequery&pullRequest=78&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=christianhelle_sqlitequery&pullRequest=78&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=christianhelle_sqlitequery&pullRequest=78)


author_association: NONE