]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/CMakeLists.txt
Use <cstdint> instead of <boost/cstdint.hpp>
[lyx.git] / src / frontends / qt4 / CMakeLists.txt
index c71873be86e7a4d15251800d0904d8f0123c9222..ff61e48c66ef0c86ae55e2efad60d0e988319eab 100644 (file)
@@ -4,33 +4,42 @@
 # Copyright (c) 2006-2011 Peter Kümmel, <syntheticpp@gmx.net>
 #
 
-project(frontend_qt4)
+project(frontend_qt)
 
-file(GLOB frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/${LYX_CPP_FILES})
+file(GLOB frontends_qt_sources ${TOP_SRC_DIR}/src/frontends/qt4/${LYX_CPP_FILES})
+if (LYX_USE_FILEDIALOG MATCHES "NATIVE")
+  set_property(SOURCE "${TOP_SRC_DIR}/src/frontends/qt4/FileDialog.cpp" PROPERTY COMPILE_FLAGS -DUSE_NATIVE_FILEDIALOG=1)
+endif()
 file(GLOB moc_files ${TOP_SRC_DIR}/src/frontends/qt4/${LYX_MOC_FILES})
 
-list(REMOVE_ITEM frontends_qt4_sources ${moc_files} .)
-list(REMOVE_ITEM frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/liblyxqt4.cpp)
-list(REMOVE_ITEM frontends_qt4_sources ${TOP_SRC_DIR}/src/frontends/qt4/Resources.cpp)
+list(REMOVE_ITEM frontends_qt_sources ${moc_files} .)
+list(REMOVE_ITEM frontends_qt_sources ${TOP_SRC_DIR}/src/frontends/qt4/liblyxqt4.cpp)
+list(REMOVE_ITEM frontends_qt_sources ${TOP_SRC_DIR}/src/frontends/qt4/Resources.cpp)
 
-file(GLOB frontends_qt4_headers ${TOP_SRC_DIR}/src/frontends/qt4/${LYX_HPP_FILES})
-file(GLOB frontend_qt4_UI ${TOP_SRC_DIR}/src/frontends/qt4/ui/*.ui)
+file(GLOB frontends_qt_headers ${TOP_SRC_DIR}/src/frontends/qt4/${LYX_HPP_FILES})
+file(GLOB frontend_qt_UI ${TOP_SRC_DIR}/src/frontends/qt4/ui/*.ui)
 
 lyx_add_msvc_pch(frontends_qt4)
 
-lyx_automoc(${frontends_qt4_sources})
+lyx_automoc(${frontends_qt_sources})
 
-lyx_add_ui_files(frontends_qt4_sources ui_files ${frontend_qt4_UI})
+lyx_add_ui_files(frontends_qt_sources ui_files ${frontend_qt_UI})
 
-file(GLOB_RECURSE frontend_qt4_images_png      ${TOP_SRC_DIR}/lib/images/*.png)
-file(GLOB_RECURSE frontend_qt4_images_gif      ${TOP_SRC_DIR}/lib/images/*.gif)
 set(resource_name ${CMAKE_CURRENT_BINARY_DIR}/Resources.qrc)
-set(frontend_qt4_images ${frontend_qt4_images_png} ${frontend_qt4_images_gif})
-lyx_qt_resources_file(${resource_name} "${TOP_SRC_DIR}/lib/" frontend_qt4_images)
-qt4_add_resources(resource_files ${resource_name})
 
+add_custom_command(
+       OUTPUT  ${resource_name}
+       COMMAND ${CMAKE_COMMAND}
+               -DIMAGES_DIR=${TOP_SRC_DIR}/lib/images
+               -DRESOURCE_NAME=${resource_name}
+               -DMAPPED_DIR=${TOP_SRC_DIR}/lib/
+                -DSUFFIX=${LYX_INSTALL_SUFFIX}
+               -P ${TOP_SCRIPT_PATH}/LyXCreateImagesResource.cmake
+       )
+
+qt_add_resources(resource_files ${resource_name})
 
-add_definitions(-DQT_GENUINE_STR -DLYX_BUILD_QT4_FRONTEND)
+add_definitions(-DQT_GENUINE_STR -DLYX_BUILD_QT_FRONTEND)
 
 include_directories(
        ${TOP_SRC_DIR}/src/frontends/qt4
@@ -38,29 +47,38 @@ include_directories(
        ${CMAKE_CURRENT_BINARY_DIR})
 
 if(LYX_MERGE_FILES)
-       lyx_const_touched_files(_allinone frontends_qt4_sources)
-       set(depends_moc_uic ${frontends_qt4_headers} ${ui_files})
+       lyx_const_touched_files(_allinone frontends_qt_sources)
+       set(depends_moc_uic ${frontends_qt_headers} ${ui_files})
        set_source_files_properties(_allinone_const.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}")
        set_source_files_properties(_allinone_touched.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}")
-       add_library(frontend_qt4 ${library_type}
-               ${_allinone_files} ${frontends_qt4_headers} ${ui_files} ${resource_files})
+       add_library(frontend_qt ${library_type}
+               ${_allinone_files} ${frontends_qt_headers} ${ui_files} ${resource_files})
 else()
-       add_library(frontend_qt4 ${library_type} ${frontends_qt4_sources} ${frontends_qt4_headers} ${ui_files} ${resource_files})
+       add_library(frontend_qt ${library_type} ${frontends_qt_sources} ${frontends_qt_headers} ${ui_files} ${resource_files})
 endif()
+set_target_properties(frontend_qt PROPERTIES FOLDER "applications/LyX")
 
-
-target_link_libraries(frontend_qt4
+if(Qt5Core_FOUND AND APPLE)
+       qt_use_modules(frontend_qt Core Gui Widgets Concurrent Svg MacExtras)
+else()
+       if (Qt5WinExtras_FOUND)
+           qt_use_modules(frontend_qt Core Gui Widgets Concurrent Svg WinExtras)
+       else()
+           qt_use_modules(frontend_qt Core Gui Widgets Concurrent Svg)
+       endif()
+endif()
+target_link_libraries(frontend_qt
        frontends
        ${QT_QTCORE_LIBRARY}
        ${QT_QTGUI_LIBRARY})
 
-lyx_add_gcc_pch(frontend_qt4)
+lyx_add_gcc_pch(frontend_qt)
 
 if(WIN32)
-       target_link_libraries(frontend_qt4 Gdi32)
+       target_link_libraries(frontend_qt gdi32)
 endif()
 
-project_source_group("${GROUP_CODE}" frontends_qt4_sources frontends_qt4_headers)
+project_source_group("${GROUP_CODE}" frontends_qt_sources frontends_qt_headers)
 
-source_group("Uic files" FILES ${frontend_qt4_UI})
+source_group("Uic files" FILES ${frontend_qt_UI})