From 59ac7ce66066736db6781abe0378a753fad15127 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Mon, 11 Jul 2016 19:08:11 +0200 Subject: [PATCH] Cmake build: Add needed libraries if using QT5_Extras Commit cb0c881 does this already for automake. --- development/cmake/ConfigureChecks.cmake | 1 + src/CMakeLists.txt | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/development/cmake/ConfigureChecks.cmake b/development/cmake/ConfigureChecks.cmake index c9c7b74b87..146330a56a 100644 --- a/development/cmake/ConfigureChecks.cmake +++ b/development/cmake/ConfigureChecks.cmake @@ -241,6 +241,7 @@ if(LYX_USE_QT MATCHES "QT5") " QT_HAS_X11_EXTRAS) set(HAVE_QT5_X11_EXTRAS ${QT_HAS_X11_EXTRAS}) + set(LYX_QT5_X11_EXTRAS_LIBRARY ${_x11extra_link_libraries}) endif() if (Qt5WinExtras_FOUND) get_target_property(_winextra_prop Qt5::WinExtras IMPORTED_CONFIGURATIONS) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0a131c99ed..ffcb34debd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -134,6 +134,14 @@ target_link_libraries(${_lyx} qt_use_modules(${_lyx} Core Gui) +if(QT_HAS_X11_EXTRAS) + find_library(XCB_LIBRARY NAMES xcb) + if (XCB_LIBRARY MATCHES "NOTFOUND") + message(FATAL_ERROR "Need xcb library to use with QT5_X11_EXTRAS") + endif() + target_link_libraries(${_lyx} ${LYX_QT5_X11_EXTRAS_LIBRARY} ${XCB_LIBRARY}) +endif() + lyx_target_link_libraries(${_lyx} HUNSPELL ASPELL ENCHANT Magic) if(APPLE)