194 lines
7.6 KiB
Diff
194 lines
7.6 KiB
Diff
|
From 1dee2a155641f265fc7302cfdf25b56c0de82a1a Mon Sep 17 00:00:00 2001
|
||
|
From: Mike FABIAN <mfabian@redhat.com>
|
||
|
Date: Mon, 7 Feb 2022 20:53:30 +0100
|
||
|
Subject: [PATCH] Make build outside of the source tree possible
|
||
|
|
||
|
Resolves: https://github.com/mike-fabian/ibus-table-chinese/issues/3
|
||
|
---
|
||
|
CMakeLists.txt | 2 +-
|
||
|
tables/CMakeLists.txt | 4 ++--
|
||
|
tables/array/CMakeLists.txt | 6 +++---
|
||
|
tables/cangjie/CMakeLists.txt | 6 +++++-
|
||
|
tables/cantonese/CMakeLists.txt | 6 +++++-
|
||
|
tables/easy/CMakeLists.txt | 2 +-
|
||
|
tables/erbi/CMakeLists.txt | 4 +++-
|
||
|
tables/quick/CMakeLists.txt | 5 ++++-
|
||
|
tables/scj/CMakeLists.txt | 2 +-
|
||
|
tables/stroke5/CMakeLists.txt | 2 +-
|
||
|
tables/wu/CMakeLists.txt | 2 +-
|
||
|
tables/wubi-haifeng/CMakeLists.txt | 7 +++++--
|
||
|
tables/wubi-jidian/CMakeLists.txt | 3 +--
|
||
|
tables/yong/CMakeLists.txt | 2 +-
|
||
|
14 files changed, 34 insertions(+), 19 deletions(-)
|
||
|
|
||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||
|
index 9113fba..d881c05 100644
|
||
|
--- a/CMakeLists.txt
|
||
|
+++ b/CMakeLists.txt
|
||
|
@@ -1,4 +1,4 @@
|
||
|
-cmake_minimum_required(VERSION 2.6.2)
|
||
|
+cmake_minimum_required(VERSION 3.0.0)
|
||
|
|
||
|
# Default CMAKE_INSTALL_PREFIX should be set before PROJECT()
|
||
|
SET(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Install dir prefix")
|
||
|
diff --git a/tables/CMakeLists.txt b/tables/CMakeLists.txt
|
||
|
index 6a5c8c1..a9f6ddc 100644
|
||
|
--- a/tables/CMakeLists.txt
|
||
|
+++ b/tables/CMakeLists.txt
|
||
|
@@ -76,7 +76,7 @@ ENDMACRO(MAKE_TABLE_SOURCE_TXT outputFile)
|
||
|
ADD_CUSTOM_TARGET(convert_all ALL)
|
||
|
|
||
|
MACRO(CONVERT_DB targetName)
|
||
|
- SET(_tableList "")
|
||
|
+ # SET(_tableList "")
|
||
|
SET(_dependDb "")
|
||
|
SET(_dependIcon "")
|
||
|
FOREACH(_tabFile ${ARGN})
|
||
|
@@ -87,7 +87,7 @@ MACRO(CONVERT_DB targetName)
|
||
|
DEPENDS ${_tabFile}
|
||
|
COMMENT "Building ${_tabName} table"
|
||
|
)
|
||
|
- LIST(APPEND _dependDb "${_dbF}")
|
||
|
+ LIST(APPEND _dependDb "${CMAKE_CURRENT_BINARY_DIR}/${_dbF}")
|
||
|
IF(EXISTS "${CMAKE_SOURCE_DIR}/icons/${_tabName}.png")
|
||
|
LIST(APPEND _dependIcon "${CMAKE_SOURCE_DIR}/icons/${_tabName}.png")
|
||
|
ELSEIF(EXISTS "${CMAKE_SOURCE_DIR}/icons/${_tabName}.svg")
|
||
|
diff --git a/tables/array/CMakeLists.txt b/tables/array/CMakeLists.txt
|
||
|
index 7f9015d..88b06ac 100644
|
||
|
--- a/tables/array/CMakeLists.txt
|
||
|
+++ b/tables/array/CMakeLists.txt
|
||
|
@@ -16,7 +16,7 @@ SET(ARRAY30_BASE_HEAD "${ARRAY30_BASE}.head")
|
||
|
|
||
|
CONFIGURE_FILE(${ARRAY30_HEAD_IN} ${ARRAY30_BASE_HEAD} @ONLY)
|
||
|
|
||
|
-CONVERT_ENCODING(${ARRAY30_BASE_UTF8} UTF16 array30_27489.txt)
|
||
|
+CONVERT_ENCODING(${CMAKE_CURRENT_BINARY_DIR}/array30.utf8 UTF16 ${CMAKE_SOURCE_DIR}/tables/array/array30_27489.txt)
|
||
|
GENERATE_FREQ(${ARRAY30_BASE_FREQ}
|
||
|
${ARRAY30_BASE_UTF8}
|
||
|
)
|
||
|
@@ -41,10 +41,10 @@ SET(ARRAY30_BIG_HEAD "${ARRAY30_BIG}.head")
|
||
|
CONFIGURE_FILE(${ARRAY30_HEAD_IN} ${ARRAY30_BIG_HEAD} @ONLY)
|
||
|
|
||
|
SET(ARRAY30_EXT_B_UTF8 ${CMAKE_CURRENT_BINARY_DIR}/array30_ExtB.utf8)
|
||
|
-CONVERT_ENCODING(${CMAKE_CURRENT_BINARY_DIR}/array30_ExtB.utf8 UTF16 array30_ExtB.txt)
|
||
|
+CONVERT_ENCODING(${CMAKE_CURRENT_BINARY_DIR}/array30_ExtB.utf8 UTF16 ${CMAKE_SOURCE_DIR}/tables/array/array30_ExtB.txt)
|
||
|
|
||
|
SET(ARRAY30_EXT_CD_UTF8 ${CMAKE_CURRENT_BINARY_DIR}/array30_ExtCD.utf8)
|
||
|
-CONVERT_ENCODING(${CMAKE_CURRENT_BINARY_DIR}/array30_ExtCD.utf8 UTF16 array30_ExtCD_V2012A.txt)
|
||
|
+CONVERT_ENCODING(${CMAKE_CURRENT_BINARY_DIR}/array30_ExtCD.utf8 UTF16 ${CMAKE_SOURCE_DIR}/tables/array/array30_ExtCD_V2012A.txt)
|
||
|
|
||
|
ADD_CUSTOM_COMMAND(OUTPUT ${ARRAY30_BIG_UTF8}
|
||
|
COMMAND cat ${ARRAY30_BASE_UTF8}
|
||
|
diff --git a/tables/cangjie/CMakeLists.txt b/tables/cangjie/CMakeLists.txt
|
||
|
index 92c54d0..29fcd29 100644
|
||
|
--- a/tables/cangjie/CMakeLists.txt
|
||
|
+++ b/tables/cangjie/CMakeLists.txt
|
||
|
@@ -1,2 +1,6 @@
|
||
|
-CONVERT_DB(cangjie "cangjie3.txt" "cangjie5.txt" "cangjie-big.txt")
|
||
|
+CONVERT_DB(cangjie
|
||
|
+ "${CMAKE_SOURCE_DIR}/tables/cangjie/cangjie3.txt"
|
||
|
+ "${CMAKE_SOURCE_DIR}/tables/cangjie/cangjie5.txt"
|
||
|
+ "${CMAKE_SOURCE_DIR}/tables/cangjie/cangjie-big.txt")
|
||
|
+
|
||
|
|
||
|
diff --git a/tables/cantonese/CMakeLists.txt b/tables/cantonese/CMakeLists.txt
|
||
|
index 7e7d04e..1e9a033 100644
|
||
|
--- a/tables/cantonese/CMakeLists.txt
|
||
|
+++ b/tables/cantonese/CMakeLists.txt
|
||
|
@@ -1,2 +1,6 @@
|
||
|
-CONVERT_DB(cantonese "cantonese.txt" "cantonhk.txt" "cantonyale.txt" "jyutping.txt")
|
||
|
+CONVERT_DB(cantonese
|
||
|
+ "${CMAKE_SOURCE_DIR}/tables/cantonese/cantonese.txt"
|
||
|
+ "${CMAKE_SOURCE_DIR}/tables/cantonese/cantonhk.txt"
|
||
|
+ "${CMAKE_SOURCE_DIR}/tables/cantonese/cantonyale.txt"
|
||
|
+ "${CMAKE_SOURCE_DIR}/tables/cantonese/jyutping.txt")
|
||
|
|
||
|
diff --git a/tables/easy/CMakeLists.txt b/tables/easy/CMakeLists.txt
|
||
|
index fb5baa5..1fbd4b0 100644
|
||
|
--- a/tables/easy/CMakeLists.txt
|
||
|
+++ b/tables/easy/CMakeLists.txt
|
||
|
@@ -1,2 +1,2 @@
|
||
|
-CONVERT_DB(easy "easy-big.txt")
|
||
|
+CONVERT_DB(easy "${CMAKE_SOURCE_DIR}/tables/easy/easy-big.txt")
|
||
|
|
||
|
diff --git a/tables/erbi/CMakeLists.txt b/tables/erbi/CMakeLists.txt
|
||
|
index d265b89..5e0ec60 100644
|
||
|
--- a/tables/erbi/CMakeLists.txt
|
||
|
+++ b/tables/erbi/CMakeLists.txt
|
||
|
@@ -1,2 +1,4 @@
|
||
|
-CONVERT_DB(erbi "erbi.txt" "erbi-qs.txt")
|
||
|
+CONVERT_DB(erbi
|
||
|
+ "${CMAKE_SOURCE_DIR}/tables/erbi/erbi.txt"
|
||
|
+ "${CMAKE_SOURCE_DIR}/tables/erbi/erbi-qs.txt")
|
||
|
|
||
|
diff --git a/tables/quick/CMakeLists.txt b/tables/quick/CMakeLists.txt
|
||
|
index 7cee315..b7f03f1 100644
|
||
|
--- a/tables/quick/CMakeLists.txt
|
||
|
+++ b/tables/quick/CMakeLists.txt
|
||
|
@@ -1,2 +1,5 @@
|
||
|
-CONVERT_DB(quick "quick3.txt" "quick5.txt" "quick-classic.txt")
|
||
|
+CONVERT_DB(quick
|
||
|
+ "${CMAKE_SOURCE_DIR}/tables/quick/quick3.txt"
|
||
|
+ "${CMAKE_SOURCE_DIR}/tables/quick/quick5.txt"
|
||
|
+ "${CMAKE_SOURCE_DIR}/tables/quick/quick-classic.txt")
|
||
|
|
||
|
diff --git a/tables/scj/CMakeLists.txt b/tables/scj/CMakeLists.txt
|
||
|
index 4decc9e..12186af 100644
|
||
|
--- a/tables/scj/CMakeLists.txt
|
||
|
+++ b/tables/scj/CMakeLists.txt
|
||
|
@@ -1,2 +1,2 @@
|
||
|
-CONVERT_DB(scj "scj6.txt")
|
||
|
+CONVERT_DB(scj "${CMAKE_SOURCE_DIR}/tables/scj/scj6.txt")
|
||
|
|
||
|
diff --git a/tables/stroke5/CMakeLists.txt b/tables/stroke5/CMakeLists.txt
|
||
|
index 72d01e2..6aaffa4 100644
|
||
|
--- a/tables/stroke5/CMakeLists.txt
|
||
|
+++ b/tables/stroke5/CMakeLists.txt
|
||
|
@@ -1,2 +1,2 @@
|
||
|
-CONVERT_DB(stroke5 "stroke5.txt")
|
||
|
+CONVERT_DB(stroke5 "${CMAKE_SOURCE_DIR}/tables/stroke5/stroke5.txt")
|
||
|
|
||
|
diff --git a/tables/wu/CMakeLists.txt b/tables/wu/CMakeLists.txt
|
||
|
index dea90c0..2e33292 100644
|
||
|
--- a/tables/wu/CMakeLists.txt
|
||
|
+++ b/tables/wu/CMakeLists.txt
|
||
|
@@ -1,2 +1,2 @@
|
||
|
-CONVERT_DB(wu "wu.txt")
|
||
|
+CONVERT_DB(wu "${CMAKE_SOURCE_DIR}/tables/wu/wu.txt")
|
||
|
|
||
|
diff --git a/tables/wubi-haifeng/CMakeLists.txt b/tables/wubi-haifeng/CMakeLists.txt
|
||
|
index 25c8206..4cdca8c 100644
|
||
|
--- a/tables/wubi-haifeng/CMakeLists.txt
|
||
|
+++ b/tables/wubi-haifeng/CMakeLists.txt
|
||
|
@@ -5,6 +5,9 @@
|
||
|
# COMMENT "Building wubi-haifeng86.UTF-8"
|
||
|
# )
|
||
|
|
||
|
-MAKE_TABLE_SOURCE_TXT(wubi-haifeng86.txt wubi-haifeng86.head wubi-haifeng86.UTF-8 wubi-haifeng86.tail)
|
||
|
-CONVERT_DB(wubi-haifeng "wubi-haifeng86.txt")
|
||
|
+MAKE_TABLE_SOURCE_TXT(${CMAKE_CURRENT_BINARY_DIR}/wubi-haifeng86.txt
|
||
|
+ ${CMAKE_SOURCE_DIR}/tables/wubi-haifeng/wubi-haifeng86.head
|
||
|
+ ${CMAKE_SOURCE_DIR}/tables/wubi-haifeng/wubi-haifeng86.UTF-8
|
||
|
+ ${CMAKE_SOURCE_DIR}/tables/wubi-haifeng/wubi-haifeng86.tail)
|
||
|
+CONVERT_DB(wubi-haifeng "${CMAKE_CURRENT_BINARY_DIR}/wubi-haifeng86.txt")
|
||
|
|
||
|
diff --git a/tables/wubi-jidian/CMakeLists.txt b/tables/wubi-jidian/CMakeLists.txt
|
||
|
index 93ac9c0..ea0aa1b 100644
|
||
|
--- a/tables/wubi-jidian/CMakeLists.txt
|
||
|
+++ b/tables/wubi-jidian/CMakeLists.txt
|
||
|
@@ -1,2 +1 @@
|
||
|
-CONVERT_DB(wubi-jidian "wubi-jidian86.txt")
|
||
|
-
|
||
|
+CONVERT_DB(wubi-jidian "${CMAKE_SOURCE_DIR}/tables/wubi-jidian/wubi-jidian86.txt")
|
||
|
diff --git a/tables/yong/CMakeLists.txt b/tables/yong/CMakeLists.txt
|
||
|
index e3ddb03..f6749a1 100644
|
||
|
--- a/tables/yong/CMakeLists.txt
|
||
|
+++ b/tables/yong/CMakeLists.txt
|
||
|
@@ -1,2 +1,2 @@
|
||
|
-CONVERT_DB(yong "yong.txt")
|
||
|
+CONVERT_DB(yong "${CMAKE_SOURCE_DIR}/tables/yong/yong.txt")
|
||
|
|
||
|
--
|
||
|
2.34.1
|
||
|
|