Skip to content

Commit

Permalink
Fixed bug 3301 - IBus support on Linux with CMake
Browse files Browse the repository at this point in the history
joe.gsoc16

I recently looked into Unicode support in SDL2 and realized that
SDL_TEXTEDITING doesn't get triggered at all (Japanese IME).
According to others on IRC it works fine on Windows/Mac but not
for me on (arch)Linux.
When compiling SDL with autotools, IBus support is enabled by
default but not so with CMake.
I never used CMake before but got it working and also included
that pkg-config determines flags for dbus (FIXME in CMakeLists).
  • Loading branch information
slouken committed Oct 1, 2016
1 parent 765d8be commit bb24662
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
18 changes: 16 additions & 2 deletions CMakeLists.txt
Expand Up @@ -899,8 +899,22 @@ elseif(UNIX AND NOT APPLE)

check_include_file("libudev.h" HAVE_LIBUDEV_H)

# !!! FIXME: this needs pkg-config to find the include path, I think.
check_include_file("dbus/dbus.h" HAVE_DBUS_DBUS_H)
if(PKG_CONFIG_FOUND)
pkg_search_module(DBUS dbus-1 dbus)
if(DBUS_FOUND)
set(HAVE_DBUS_DBUS_H TRUE)
include_directories(${DBUS_INCLUDE_DIRS})
list(APPEND EXTRA_LIBS ${DBUS_LIBRARIES})
endif()

pkg_search_module(IBUS ibus-1.0 ibus)
if(IBUS_FOUND)
set(HAVE_IBUS_IBUS_H TRUE)
include_directories(${IBUS_INCLUDE_DIRS})
list(APPEND EXTRA_LIBS ${IBUS_LIBRARIES})
endif()
endif()

endif()

if(INPUT_TSLIB)
Expand Down
1 change: 1 addition & 0 deletions include/SDL_config.h.cmake
Expand Up @@ -81,6 +81,7 @@
#cmakedefine HAVE_PTHREAD_NP_H 1
#cmakedefine HAVE_LIBUDEV_H 1
#cmakedefine HAVE_DBUS_DBUS_H 1
#cmakedefine HAVE_IBUS_IBUS_H 1

/* C library functions */
#cmakedefine HAVE_MALLOC 1
Expand Down

0 comments on commit bb24662

Please sign in to comment.