File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Fcitx5AndroidInstallDirs.cmake")
30
30
# LIBDATADIR is not a standard CMake install dir, defined in fcitx5/CMakeLists.txt#L169
31
31
set (CMAKE_INSTALL_LIBDATADIR "/usr/lib" )
32
32
33
+ # hook add_custom_command before configuring fcitx5
34
+ include ("${CMAKE_CURRENT_SOURCE_DIR} /cmake/HookAddCustomCommand.cmake" )
35
+
33
36
option (ENABLE_TEST "" OFF )
34
37
option (ENABLE_COVERAGE "" OFF )
35
38
option (ENABLE_ENCHANT "" OFF )
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ find_package(Gettext REQUIRED)
19
19
set (FCITX_INSTALL_CMAKECONFIG_DIR "${FCITX5_DEVEL_FILES} " )
20
20
21
21
# mimic fcitx5/src/lib/fcitx-utils/Fcitx5UtilsConfig.cmake.in
22
+ include ("${CMAKE_CURRENT_LIST_DIR} /HookAddCustomCommand.cmake" ) # hook before macros
22
23
include ("${FCITX_INSTALL_CMAKECONFIG_DIR} /Fcitx5Utils/Fcitx5Macros.cmake" )
23
24
include ("${CMAKE_CURRENT_LIST_DIR} /Fcitx5AndroidInstallDirs.cmake" )
24
25
Original file line number Diff line number Diff line change
1
+ find_package (Gettext )
2
+
3
+ # Do as I say, not as I do
4
+ # https://crascit.com/2018/09/14/do-not-redefine-cmake-commands/
5
+ if (NOT COMMAND _add_custom_command )
6
+ function (add_custom_command )
7
+ cmake_parse_arguments (arg "" "" "COMMAND" ${ARGN} )
8
+ list (GET arg_COMMAND 0 cmd_0 )
9
+ # find calls in fcitx5_install_translation
10
+ if (cmd_0 STREQUAL GETTEXT_MSGFMT_EXECUTABLE AND NOT "-d" IN_LIST arg_COMMAND )
11
+ # ARGV is a list like: "COMMAND;/path/to/msgfmt;-o;mo_file;po_file"
12
+ # insert arguments after GETTEXT_MSGFMT_EXECUTABLE
13
+ list (FIND ARGV "${GETTEXT_MSGFMT_EXECUTABLE} " idx )
14
+ math (EXPR idx "${idx} + 1" )
15
+ list (INSERT ARGV ${idx} "--no-hash" "--endianness=little" )
16
+ endif ()
17
+ _add_custom_command (${ARGV} )
18
+ endfunction ()
19
+ endif ()
You can’t perform that action at this time.
0 commit comments