From: Shane Jaroch Date: Sat, 24 Jan 2026 06:14:41 +0000 (-0500) Subject: appimage target X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=e9fdb23d55e3da8845be3e8727c19cc319a10aa0;p=nutratech%2Fgui.git appimage target --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 07ea4d6..4398ff3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,3 +84,16 @@ install(FILES resources/nutrition_icon-no_bg.png DESTINATION ${CMAKE_INSTALL_DAT if(NUTRA_DB_FILE AND EXISTS "${NUTRA_DB_FILE}") install(FILES "${NUTRA_DB_FILE}" DESTINATION share/nutra RENAME usda.sqlite3) endif() + +# AppImage generation (requires linuxdeploy and linuxdeploy-plugin-qt in PATH) +find_program(LINUXDEPLOY linuxdeploy) + +if(LINUXDEPLOY) + add_custom_target(appimage + COMMAND ${CMAKE_COMMAND} --install . --prefix AppDir/usr + COMMAND ${LINUXDEPLOY} --appdir=AppDir --plugin=qt --output=appimage + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMENT "Generating AppImage..." + VERBATIM + ) +endif() diff --git a/Makefile b/Makefile index c7690f0..07dfbe7 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,12 @@ release: $(CMAKE) -S . -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=Release -DNUTRA_VERSION="$(VERSION)" $(CMAKE) --build $(BUILD_DIR) --config Release +.PHONY: appimage +appimage: + $(CMAKE) -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release + $(CMAKE) --build build -j"$(nproc)" + $(CMAKE) --build build --target appimage + .PHONY: clean clean: $(CMAKE) -E remove_directory $(BUILD_DIR) diff --git a/scripts/build_appimage.sh b/scripts/build_appimage.sh new file mode 100755 index 0000000..e6fa0cd --- /dev/null +++ b/scripts/build_appimage.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# Build AppImage from project root +# Assumes linuxdeploy and linuxdeploy-plugin-qt are in PATH +set -e + +cd "$(dirname "$0")/.." || exit 1 + +cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release +cmake --build build -j"$(nproc)" +cmake --build build --target appimage