void-packages/srcpkgs/fcitx5/patches/cross-config-template.patch

46 lines
2.2 KiB
Diff

Index: fcitx5-5.0.6/src/lib/fcitx-utils/Fcitx5ModuleTemplate.cmake.in
===================================================================
--- fcitx5-5.0.6.orig/src/lib/fcitx-utils/Fcitx5ModuleTemplate.cmake.in
+++ fcitx5-5.0.6/src/lib/fcitx-utils/Fcitx5ModuleTemplate.cmake.in
@@ -2,6 +2,16 @@ if (TARGET Fcitx5::Module::@FEM_EXPORTNA
return()
endif()
+# Compute the installation prefix relative to this file.
+get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+if(_IMPORT_PREFIX STREQUAL "/")
+ set(_IMPORT_PREFIX "")
+endif()
+
add_library(@FEM_TARGET@-interface INTERFACE)
add_library(Fcitx5::Module::@FEM_EXPORTNAME@ ALIAS @FEM_TARGET@-interface)
-set_target_properties(@FEM_TARGET@-interface PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "@_MODULE_HEADER_DIR@")
+set_target_properties(@FEM_TARGET@-interface PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/../@_MODULE_HEADER_DIR@")
Index: fcitx5-5.0.6/src/lib/fcitx-utils/Fcitx5UtilsConfig.cmake.in
===================================================================
--- fcitx5-5.0.6.orig/src/lib/fcitx-utils/Fcitx5UtilsConfig.cmake.in
+++ fcitx5-5.0.6/src/lib/fcitx-utils/Fcitx5UtilsConfig.cmake.in
@@ -3,8 +3,17 @@
include("${CMAKE_CURRENT_LIST_DIR}/Fcitx5UtilsTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/Fcitx5Macros.cmake")
+# Compute the installation prefix relative to this file.
+get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+if(_IMPORT_PREFIX STREQUAL "/")
+ set(_IMPORT_PREFIX "")
+endif()
+
set(FCITX_SYS_INSTALL_PREFIX "@FCITX_INSTALL_PREFIX@")
-set(FCITX_INSTALL_CMAKECONFIG_DIR "@FCITX_INSTALL_CMAKECONFIG_DIR@")
+set(FCITX_INSTALL_CMAKECONFIG_DIR "${_IMPORT_PREFIX}/../@FCITX_INSTALL_CMAKECONFIG_DIR@")
set(_default_FCITX_INSTALL_USE_FCITX_SYS_PATHS Off)
if (NOT DEFINED FCITX_INSTALL_USE_FCITX_SYS_PATHS)