Files
meta-kde/recipes-support/libpinyin/0001-Optionally-install-utilities.patch
2024-10-05 10:39:59 +02:00

100 lines
2.4 KiB
Diff

From f8e9f005451628552d0a93f7131aa80152ad80b8 Mon Sep 17 00:00:00 2001
From: Andreas Cord-Landwehr <cordlandwehr@kde.org>
Date: Sun, 3 Jan 2021 17:42:04 +0100
Subject: [PATCH 1/3] Optionally install utilities
This option is needed for cross-compiling the library, where the
utilities have to be built for the host architecture and the library
for the target architecture, while utilizing the utilities.
Upstream-Status: Pending
---
CMakeLists.txt | 4 ++++
utils/storage/CMakeLists.txt | 24 ++++++++++++++++++++++++
utils/training/CMakeLists.txt | 8 ++++++++
3 files changed, 36 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f62a9f..e291186 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,6 +65,10 @@ check_type_size(size_t SIZE_OF_SIZE_T)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(GLIB2 REQUIRED)
+# Options
+
+option(INSTALL_UTILS "Build QtMultimedia sound backend" OFF)
+
# DBM: BerkeleyDB
find_package(BerkeleyDB)
if (DB_FOUND)
diff --git a/utils/storage/CMakeLists.txt b/utils/storage/CMakeLists.txt
index 648f430..3a17a9c 100644
--- a/utils/storage/CMakeLists.txt
+++ b/utils/storage/CMakeLists.txt
@@ -7,6 +7,14 @@ target_link_libraries(
gen_binary_files
pinyin
)
+if(INSTALL_UTILS)
+ install(
+ TARGETS
+ gen_binary_files
+ RUNTIME DESTINATION
+ ${DIR_BIN}
+ )
+endif()
add_executable(
import_interpolation
@@ -17,6 +25,14 @@ target_link_libraries(
import_interpolation
pinyin
)
+if(INSTALL_UTILS)
+ install(
+ TARGETS
+ import_interpolation
+ RUNTIME DESTINATION
+ ${DIR_BIN}
+ )
+endif()
add_executable(
export_interpolation
@@ -27,3 +43,11 @@ target_link_libraries(
export_interpolation
pinyin
)
+if(INSTALL_UTILS)
+ install(
+ TARGETS
+ export_interpolation
+ RUNTIME DESTINATION
+ ${DIR_BIN}
+ )
+endif()
diff --git a/utils/training/CMakeLists.txt b/utils/training/CMakeLists.txt
index 27620fb..7372dcc 100644
--- a/utils/training/CMakeLists.txt
+++ b/utils/training/CMakeLists.txt
@@ -22,6 +22,14 @@ add_executable(
gen_unigram
gen_unigram.cpp
)
+if(INSTALL_UTILS)
+ install(
+ TARGETS
+ gen_unigram
+ RUNTIME DESTINATION
+ ${DIR_BIN}
+ )
+endif()
target_link_libraries(
gen_unigram
--
2.34.1