From 24d593624a41488416116057fc36e9962a548477 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Mon, 20 Dec 2021 11:43:26 +0100
Subject: [PATCH] Let releaseme know to skip po install

Since KF5I18n is optional AND dependent on HEAPTRACK_BUILD_GUI, we
have to call ki18n_install(po) conditionally on our own and in
addition tell releaseme not to touch CMakeLists.txt to do the same.

Otherwise releaseme adds the following code unconditionally at the
end of the file:

    find_package(KF5I18n CONFIG REQUIRED)
    ki18n_install(po)

ki18n_install checks for existence of po subdir and returns silently
if none found, so it is safe for git sources too.

* asturmlechner 2021-12-20: Modified for 1.3.0 release.

Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
 CMakeLists.txt             | 4 ++++
 src/analyze/CMakeLists.txt | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ccfc88..06c43cf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -169,7 +169,8 @@
 add_subdirectory(src)
 add_subdirectory(tests)
 
-feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
+# Let releaseme know about this:
+# SKIP_PO_INSTALL
+# (KF5I18n is optional in src/analyze/CMakeLists.txt...)
 
-find_package(KF5I18n CONFIG REQUIRED)
-ki18n_install(po)
+feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/src/analyze/CMakeLists.txt b/src/analyze/CMakeLists.txt
index 592f337..763c671 100644
--- a/src/analyze/CMakeLists.txt
+++ b/src/analyze/CMakeLists.txt
@@ -41,6 +41,9 @@ if(HEAPTRACK_BUILD_GUI)
             find_package(KF5 ${REQUIRED_IN_APPIMAGE} COMPONENTS CoreAddons I18n ItemModels ThreadWeaver ConfigWidgets KIO IconThemes)
             find_package(KChart ${REQUIRED_IN_APPIMAGE} "2.6.0")
             set_package_properties(KChart PROPERTIES TYPE RECOMMENDED PURPOSE "Required for the heaptrack_gui executable. Get it from the kdiagram module.")
+        if(KF5I18n_FOUND)
+            ki18n_install(../../po)
+        endif()
     endif()
 endif()
 
-- 
2.34.1
