diff options
author | Sam Lantinga <slouken@libsdl.org> | 2016-10-01 12:48:08 -0700 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2016-10-01 12:48:08 -0700 |
commit | 4d7308fdf44a5c83d170ea306a42aeea3a035145 (patch) | |
tree | b7a2cd6cbe6902aea854ab60c706f0c04d436851 /CMakeLists.txt | |
parent | 76840be1024865c714a7fe282fc13854e02d3e91 (diff) |
Fixed bug 3301 - IBus support on Linux with CMake
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).
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e413198ae3..ba2755ccb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) |