fcitx-unikey-0.2.0-cmake-qt-option.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. From f0f0d7c1ee5d83f33ceacaf78f4b7845ec2819de Mon Sep 17 00:00:00 2001
  2. From: Weng Xuetian <wengxt@gmail.com>
  3. Date: Sat, 26 Jan 2013 14:45:29 -0500
  4. Subject: [PATCH] [unikey] option for qt, detect qt 4.8
  5. ---
  6. CMakeLists.txt | 7 ++++++-
  7. macro-editor/CMakeLists.txt | 4 ++--
  8. 2 files changed, 8 insertions(+), 3 deletions(-)
  9. diff --git a/CMakeLists.txt b/CMakeLists.txt
  10. index cef1625..5ccf21c 100644
  11. --- a/CMakeLists.txt
  12. +++ b/CMakeLists.txt
  13. @@ -4,6 +4,8 @@ project(fcitx-unikey)
  14. set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
  15. +option(ENABLE_QT "Enable Qt based macro editor" On)
  16. +
  17. # uninstall target
  18. configure_file(
  19. "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
  20. @@ -21,9 +23,12 @@ set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_MODULE_LINKER_FLAGS}")
  21. find_package(Fcitx 4.2.7 REQUIRED)
  22. find_package(Libiconv REQUIRED)
  23. find_package(Gettext REQUIRED)
  24. -find_package(Qt4)
  25. +
  26. +if (ENABLE_QT)
  27. +find_package(Qt4 4.8)
  28. pkg_check_modules(FCITX_QT "fcitx-qt>=4.2.7")
  29. +endif (ENABLE_QT)
  30. configure_file(config.h.in config.h)
  31. diff --git a/macro-editor/CMakeLists.txt b/macro-editor/CMakeLists.txt
  32. index fbb2482..145ee0b 100644
  33. --- a/macro-editor/CMakeLists.txt
  34. +++ b/macro-editor/CMakeLists.txt
  35. @@ -16,9 +16,9 @@ fcitx_translate_add_sources(
  36. ${MACRO_EDITOR_SRCS}
  37. ${MACRO_EDITOR_HDRS})
  38. -if (NOT QT_FOUND OR NOT FCITX_QT_FOUND)
  39. +if (NOT QT_FOUND OR NOT FCITX_QT_FOUND OR NOT ENABLE_QT)
  40. return()
  41. -endif (NOT QT_FOUND OR NOT FCITX_QT_FOUND)
  42. +endif (NOT QT_FOUND OR NOT FCITX_QT_FOUND OR NOT ENABLE_QT)
  43. include_directories(
  44. ${FCITX_QT_INCLUDE_DIRS}
  45. --
  46. 1.7.10