1 # This file is part of LyX, the document processor.
2 # Licence details can be found in the file COPYING.
4 # Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
9 file(GLOB frontends_qt_sources ${TOP_SRC_DIR}/src/frontends/qt/${LYX_CPP_FILES})
10 if (LYX_USE_FILEDIALOG MATCHES "NATIVE")
11 set_property(SOURCE "${TOP_SRC_DIR}/src/frontends/qt/FileDialog.cpp" PROPERTY COMPILE_FLAGS -DUSE_NATIVE_FILEDIALOG=1)
13 file(GLOB moc_files ${TOP_SRC_DIR}/src/frontends/qt/${LYX_MOC_FILES})
15 list(REMOVE_ITEM frontends_qt_sources ${moc_files} .)
16 list(REMOVE_ITEM frontends_qt_sources ${TOP_SRC_DIR}/src/frontends/qt/liblyxqt4.cpp)
18 file(GLOB frontends_qt_headers ${TOP_SRC_DIR}/src/frontends/qt/${LYX_HPP_FILES})
19 file(GLOB frontend_qt_UI ${TOP_SRC_DIR}/src/frontends/qt/ui/*.ui)
21 lyx_add_msvc_pch(frontends_qt)
23 lyx_automoc(${frontends_qt_sources})
25 lyx_add_ui_files(frontends_qt_sources ui_files ${frontend_qt_UI})
27 add_definitions(-DQT_GENUINE_STR -DLYX_BUILD_QT_FRONTEND)
30 ${TOP_SRC_DIR}/src/frontends/qt
32 ${CMAKE_CURRENT_BINARY_DIR})
34 if (LYX_USE_QT MATCHES "QT6")
35 include_directories(${Qt6Gui_PRIVATE_INCLUDE_DIRS})
39 lyx_const_touched_files(_allinone frontends_qt_sources)
40 set(depends_moc_uic ${frontends_qt_headers} ${ui_files})
41 set_source_files_properties(_allinone_const.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}")
42 set_source_files_properties(_allinone_touched.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}")
43 add_library(frontend_qt ${library_type}
44 ${_allinone_files} ${frontends_qt_headers} ${ui_files} ${resource_files})
46 add_library(frontend_qt ${library_type} ${frontends_qt_sources} ${frontends_qt_headers} ${ui_files} ${resource_files})
48 set_target_properties(frontend_qt PROPERTIES FOLDER "applications/LyX" QT_NO_UNICODE_DEFINES TRUE)
51 qt_use_modules(frontend_qt Core Gui Widgets Concurrent Svg SvgWidgets)
52 elseif(Qt5Core_FOUND AND APPLE)
53 qt_use_modules(frontend_qt Core Gui Widgets Concurrent Svg MacExtras)
55 if (Qt5WinExtras_FOUND)
56 qt_use_modules(frontend_qt Core Gui Widgets Concurrent Svg WinExtras)
58 qt_use_modules(frontend_qt Core Gui Widgets Concurrent Svg)
61 target_link_libraries(frontend_qt
66 lyx_add_gcc_pch(frontend_qt)
69 target_link_libraries(frontend_qt gdi32)
72 project_source_group("${GROUP_CODE}" frontends_qt_sources frontends_qt_headers)
74 source_group("Uic files" FILES ${frontend_qt_UI})