Browse Source

Add support for FCITX (an alternative IME to ibus).

Yao Wei Tjong 姚伟忠 9 years ago
parent
commit
2fb158d089
2 changed files with 15 additions and 12 deletions
  1. 3 0
      Docs/GettingStarted.dox
  2. 12 12
      Source/ThirdParty/SDL/CMakeLists.txt

+ 3 - 0
Docs/GettingStarted.dox

@@ -29,6 +29,9 @@ Although all required third-party libraries are included as source code, there a
     - libfusionsound-dev (Debian-based only, not available on Ubuntu) for FusionSound. Disabled by default even when installed, use SDL_OPT_FUSIONSOUND build option to enable.
     - libpulse-dev (Debian-based) or pulseaudio-libs-devel (RedHat-based) for PulseAudio.
     - libroar-dev (Debian-based only) for RoarAudio (SNDIO).
+  + %Input method editor (optional). One or both of these can be installed at the same time to enable the IME support in the game engine. When both frameworks are installed on user's host system, the application uses XMODIFIFIERS environment variable to determine which one is active.
+    - libibus-1.0-dev (Debian-based) or ibus-devel (RedHat-based) for Intelligent Input Bus (ibus).
+    - fcitx-libs-dev (Debian-based) or fcitx-devel (RedHat-based) for Flexible Input Method Framework (fcitx).
   + Miscellaneous (optional).
     - libdbus-1-dev (Debian-based) or dbus-devel (Redhat-based) for system-wide messaging (e.g. inhibiting screen-saver).
     - libreadline6-dev (Debian-based) or readline-devel (Redhat-based) for easy editing of command lines in interactive standalone host tools, e.g. isql and lua interpreter.

+ 12 - 12
Source/ThirdParty/SDL/CMakeLists.txt

@@ -976,19 +976,13 @@ elseif(UNIX)    # Urho3D - at this point both UNIX and UNIX_SYS should be equiva
       set(SDL_INPUT_LINUXKD 1)
     endif()
 
-    # Urho3D - bug fix - when cross-compiling the headers are rooted, either use "--sysroot" compiler flag or use CMAKE_REQUIRED_INCLUDES (e.g. on RPI) to cater for it
-    set (CMAKE_REQUIRED_INCLUDES_UDEV_SAVED ${CMAKE_REQUIRED_INCLUDES})
-    if (CMAKE_CROSSCOMPILING AND NOT "${CMAKE_C_FLAGS} ${CMAKE_REQUIRED_FLAGS}" MATCHES --sysroot)
-      find_path (UDEV_H_INCLUDE_DIRS libudev.h)
-      if (UDEV_H_INCLUDE_DIRS)
-        list (APPEND CMAKE_REQUIRED_INCLUDES ${UDEV_H_INCLUDE_DIRS} ${SYS_TYPES_H_INCLUDE_DIRS})
-      endif ()
-    endif ()
-    check_include_file("libudev.h" HAVE_LIBUDEV_H)
-    if (HAVE_LIBUDEV_H AND UDEV_H_INCLUDE_DIRS)
+    # Urho3D - bug fix - use find_path() to detect udev's header file instead of check_include_file() because the latter requires the path to header file to be known which is not the case when cross-compiling
+    find_path (UDEV_H_INCLUDE_DIRS libudev.h)
+    if (UDEV_H_INCLUDE_DIRS)
+      set (HAVE_LIBUDEV_H TRUE)
       include_directories (${UDEV_H_INCLUDE_DIRS})
     endif ()
-    set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_UDEV_SAVED})
+
     # Urho3D - bug fix - dbus/dbus.h is installed under path suffix 'dbus-1.0', so the following find_path() is needed even when not cross-compiling
     find_path (DBUS_H_INCLUDE_DIRS NAMES dbus/dbus.h PATH_SUFFIXES dbus-1.0)
     # Cater for both multilib and multiarch, native and cross-compiling build
@@ -1003,6 +997,7 @@ elseif(UNIX)    # Urho3D - at this point both UNIX and UNIX_SYS should be equiva
       include_directories (${DBUS_H_INCLUDE_DIRS} ${DBUS_ARCH_DEPS_H_INCLUDE_DIRS})
       list(APPEND EXTRA_LIBS dbus-1)
     endif ()
+
     # Urho3D - bug fix - ibus.h is installed under path suffix 'ibus-1.0', so the following find_path() is needed even when not cross-compiling
     find_path (IBUS_H_INCLUDE_DIRS NAMES ibus.h PATH_SUFFIXES ibus-1.0)
     find_path (GLIB_H_INCLUDE_DIRS NAMES glib.h PATH_SUFFIXES glib-2.0)
@@ -1018,7 +1013,12 @@ elseif(UNIX)    # Urho3D - at this point both UNIX and UNIX_SYS should be equiva
       list(APPEND EXTRA_LIBS ibus-1.0)
     endif ()
 
-    # Urho3D - TODO - add fcitx support
+    # Urho3D - bug fix - use find_path() to detect fcitx's header file so it works for both native and cross-compiling builds
+    find_path (FCITX_H_INCLUDE_DIRS fcitx/frontend.h)
+    if (FCITX_H_INCLUDE_DIRS)
+      set (HAVE_FCITX_FRONTEND_H TRUE)
+      include_directories (${FCITX_H_INCLUDE_DIRS})
+    endif ()
 
     # Urho3D - bug fix - moved below logic from generic Unix block to Linux-specific block
     if(SDL_POWER)