diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1994d2a..5eed9e2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@
cmake_minimum_required (VERSION 3.9.5)
-project (pineapple-pictures)
+project(pineapple-pictures VERSION 0.8.1) # don't forget to update NEWS file and AppStream metadata.
include (GNUInstallDirs)
include (FeatureSummary)
@@ -179,6 +179,7 @@ macro (ppic_set_version_via_describe _describe_long)
endmacro ()
# Version setup
+target_compile_definitions(${EXE_NAME} PRIVATE PPIC_VERSION_STRING="${CMAKE_PROJECT_VERSION}")
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
find_package(Git)
set_package_properties(Git PROPERTIES TYPE OPTIONAL PURPOSE "Determine exact build version.")
diff --git a/app/aboutdialog.cpp b/app/aboutdialog.cpp
index 154f360..a7e345f 100644
--- a/app/aboutdialog.cpp
+++ b/app/aboutdialog.cpp
@@ -50,9 +50,13 @@ AboutDialog::AboutDialog(QWidget *parent)
const QStringList aboutStr {
QStringLiteral("
"),
qApp->applicationDisplayName(),
+ (QStringLiteral("
") + tr("Version: %1").arg(
#ifdef GIT_DESCRIBE_VERSION_STRING
- (QStringLiteral("
") + tr("Version: %1").arg(GIT_DESCRIBE_VERSION_STRING)),
+ GIT_DESCRIBE_VERSION_STRING
+#else
+ qApp->applicationVersion()
#endif // GIT_DESCRIBE_VERSION_STRING
+ )),
QStringLiteral("
"),
tr("Copyright (c) %1 %2", "%1 is year, %2 is the name of copyright holder(s)")
.arg(QStringLiteral("2024"), QStringLiteral("@BLumia")),
diff --git a/app/main.cpp b/app/main.cpp
index 05c03b2..569520c 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -39,6 +39,7 @@ int main(int argc, char *argv[])
}
a.setApplicationName("Pineapple Pictures");
a.setApplicationDisplayName(QCoreApplication::translate("main", "Pineapple Pictures"));
+ a.setApplicationVersion(PPIC_VERSION_STRING);
// commandline options
QCommandLineOption supportedImageFormats(QStringLiteral("supported-image-formats"), QCoreApplication::translate("main", "List supported image format suffixes, and quit program."));