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()
$(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)
--- /dev/null
+#!/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