From dc0a7fbd75f08952e48694b16d1c36be398dc278 Mon Sep 17 00:00:00 2001 From: Mikhail Zolotukhin Date: Sat, 12 Nov 2022 20:48:52 +0100 Subject: [PATCH 1/6] Use modern cmake and use FetchContent for msgpack Using fetch content cmake module is less verbose, than custom download and extract logic with setting of additional variables. CMake version 3.16 is in the Ubuntu 20.04 repository, so everyone should have at least it by now. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 7ddad2359..93d39bdec 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ src/gui/runtime/doc/tags third-party/msgpack* compile_commands.json !.github + +# Qt Creator project files +CMakeLists.txt.user From 8d2bc1f654a77708f6d7d112a920feb3f92af246 Mon Sep 17 00:00:00 2001 From: Mikhail Zolotukhin Date: Tue, 29 Nov 2022 21:52:50 +0100 Subject: [PATCH 2/6] Modernify syntax in shellwidget CMake --- src/gui/shellwidget/CMakeLists.txt | 49 +++++++++++++++++++----------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/src/gui/shellwidget/CMakeLists.txt b/src/gui/shellwidget/CMakeLists.txt index dcff6762f..0bba8d3a0 100644 --- a/src/gui/shellwidget/CMakeLists.txt +++ b/src/gui/shellwidget/CMakeLists.txt @@ -7,33 +7,46 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Qt set(CMAKE_AUTOMOC ON) -find_package(Qt5Widgets REQUIRED) + +find_package(Qt5 REQUIRED COMPONENTS Widgets) if(ENABLE_TESTS) - find_package(Qt5Test REQUIRED) + find_package(Qt5 REQUIRED COMPONENTS Test) endif() if (WIN32 AND USE_STATIC_QT) - add_definitions(-DUSE_STATIC_QT) + add_compile_definitions(-DUSE_STATIC_QT) endif () -set(SOURCES - cell.cpp - cursor.cpp - highlight.cpp - helpers.cpp - konsole_wcwidth.cpp - shellcontents.cpp - shellwidget.cpp) - -add_library(qshellwidget STATIC ${SOURCES}) -target_link_libraries(qshellwidget Qt5::Widgets) +add_library(qshellwidget STATIC) + +target_sources(qshellwidget + PRIVATE + cell.cpp + cell.h + cursor.cpp + cursor.h + helpers.cpp + helpers.h + highlight.cpp + highlight.h + konsole_wcwidth.cpp + konsole_wcwidth.h + shellcontents.cpp + shellcontents.h + shellwidget.cpp + shellwidget.h +) + +target_link_libraries(qshellwidget PUBLIC Qt5::Widgets) add_executable(example EXCLUDE_FROM_ALL example.cpp) -target_link_libraries(example qshellwidget ) +target_link_libraries(example PRIVATE qshellwidget) + add_executable(example2 EXCLUDE_FROM_ALL example2.cpp) -target_link_libraries(example2 qshellwidget ) +target_link_libraries(example2 PRIVATE qshellwidget) + add_executable(example3 EXCLUDE_FROM_ALL example3.cpp) -target_link_libraries(example3 qshellwidget ) +target_link_libraries(example3 PRIVATE qshellwidget) add_executable(fontinfo EXCLUDE_FROM_ALL fontinfo.cpp) -target_link_libraries(fontinfo Qt5::Widgets ) +target_link_libraries(fontinfo PRIVATE Qt5::Widgets) From 523c0ba6a1637c272204a2f781abf4cbd98e9cf1 Mon Sep 17 00:00:00 2001 From: Mikhail Zolotukhin Date: Tue, 29 Nov 2022 22:31:03 +0100 Subject: [PATCH 3/6] Modernify CMake in src, gui and root --- CMakeLists.txt | 26 ++++++------- src/CMakeLists.txt | 42 ++++++++++++--------- src/auto/CMakeLists.txt | 17 +++++++++ src/gui/CMakeLists.txt | 82 +++++++++++++++++++++++++++-------------- 4 files changed, 106 insertions(+), 61 deletions(-) create mode 100644 src/auto/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index a209b216e..2ebd98737 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,14 +129,9 @@ include(MacOSXPaths) # Qt set(CMAKE_AUTOMOC ON) -find_package(Qt5Core REQUIRED) -find_package(Qt5Network REQUIRED) -find_package(Qt5Svg REQUIRED) -find_package(Qt5Widgets REQUIRED) +set(CMAKE_AUTORCC ON) -if(Qt5Core_VERSION VERSION_LESS 5.8) - message(FATAL_ERROR "Minimum supported Qt5 version is 5.8!") -endif() +find_package(Qt5 5.8 REQUIRED COMPONENTS Core Network Svg Widgets) # msgpack option(USE_SYSTEM_MSGPACK "Use system msgpack libraries " OFF) @@ -147,7 +142,7 @@ else() endif() if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - add_definitions(-DQT_NO_DEBUG_OUTPUT) + add_compile_definitions(-DQT_NO_DEBUG_OUTPUT) endif() # Place targets in bin/ or lib/ for all build configurations @@ -163,7 +158,7 @@ endforeach() if(MSVC) # Allow use of deprecated function names in MSVC (read/write) - add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + add_compile_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) endif() add_subdirectory(src) @@ -171,7 +166,7 @@ add_subdirectory(doc) option(ENABLE_TESTS "Build tests" OFF) if(ENABLE_TESTS) - find_package(Qt5Test REQUIRED) + find_package(Qt5 REQUIRED COMPONENTS Test) enable_testing() add_subdirectory(test) add_subdirectory(src/gui/shellwidget/test) @@ -182,14 +177,15 @@ find_package(PythonInterp) if (PYTHONINTERP_FOUND) set(NVIM "nvim" CACHE STRING "Path to nvim executable") add_custom_target(bindings - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/bindings/generate_bindings.py ${NVIM} ${CMAKE_SOURCE_DIR}/src/auto - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/bindings/generate_bindings.py + ${NVIM} ${PROJECT_SOURCE_DIR}/src/auto + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMENT "Generating bindings" - ) + ) add_custom_target(bindings-preview - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/bindings/generate_bindings.py ${NVIM} - ) + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/bindings/generate_bindings.py ${NVIM} + ) endif() include(CPackOptions) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e5d961674..0b5856b2f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,27 +1,33 @@ - configure_file(version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) -set(NEOVIM_QT_SOURCES - auto/neovimapi0.cpp - auto/neovimapi1.cpp - auto/neovimapi2.cpp - auto/neovimapi3.cpp - auto/neovimapi4.cpp - auto/neovimapi5.cpp - auto/neovimapi6.cpp - function.cpp - msgpackiodevice.cpp - msgpackrequest.cpp - neovimconnector.cpp - neovimconnectorhelper.cpp - util.cpp) +add_library(neovim-qt STATIC) + +target_sources(neovim-qt + PRIVATE + function.cpp + function.h + msgpackiodevice.cpp + msgpackiodevice.h + msgpackrequest.cpp + msgpackrequest.h + neovimconnector.cpp + neovimconnector.h + neovimconnectorhelper.cpp + neovimconnectorhelper.h + util.cpp + util.h +) if(WIN32) - list(APPEND NEOVIM_QT_SOURCES stdinreader.cpp) + target_sources(neovim-qt + PRIVATE + stdinreader.cpp + stdinreader.h + ) endif() -add_library(neovim-qt STATIC ${NEOVIM_QT_SOURCES}) -target_link_libraries(neovim-qt Qt5::Network msgpackc-static) +target_link_libraries(neovim-qt PUBLIC Qt5::Network msgpackc-static) +add_subdirectory(auto) add_subdirectory(gui) diff --git a/src/auto/CMakeLists.txt b/src/auto/CMakeLists.txt new file mode 100644 index 000000000..b65e783d0 --- /dev/null +++ b/src/auto/CMakeLists.txt @@ -0,0 +1,17 @@ +target_sources(neovim-qt + PRIVATE + neovimapi0.cpp + neovimapi0.h + neovimapi1.cpp + neovimapi1.h + neovimapi2.cpp + neovimapi2.h + neovimapi3.cpp + neovimapi3.h + neovimapi4.cpp + neovimapi4.h + neovimapi5.cpp + neovimapi5.h + neovimapi6.cpp + neovimapi6.h +) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 17915df40..c0b21bdf6 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -1,44 +1,31 @@ set(QTLIBS Qt5::Network Qt5::Svg Qt5::Widgets) include_directories(.. shellwidget) -qt5_add_resources(NEOVIM_RCC_SOURCES data.qrc) + if(WIN32) - set(SRCS_PLATFORM - arguments_qwindowgeometry.cpp - input_win32.cpp - printinfo_msgbox.cpp - ) if (USE_STATIC_QT) add_definitions(-DUSE_STATIC_QT) link_directories(${CMAKE_PREFIX_PATH}/share/qt5/plugins/platforms) - set(QTLIBS ${QTLIBS} Qt5PlatformCompositorSupport qwindows) + list(APPEND QTLIBS Qt5PlatformCompositorSupport qwindows) endif() set(RES_FILE "data.rc") enable_language(RC) elseif(APPLE) - set(SRCS_PLATFORM - arguments_qwindowgeometry.cpp - input_mac.cpp - printinfo_stdout.cpp - ) set(ICON_PATH ${PROJECT_SOURCE_DIR}/third-party/neovim.icns) set_source_files_properties(${ICON_PATH} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") set(MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in) -else() - set(SRCS_PLATFORM - arguments_geometry.cpp - input_unix.cpp - printinfo_stdout.cpp - ) endif() add_subdirectory(shellwidget) include(GNUInstallDirs) -set(RUNTIME_PATH ) +set(RUNTIME_PATH) + +add_library(neovim-qt-gui STATIC) -add_library(neovim-qt-gui +target_sources(neovim-qt-gui + PRIVATE app.cpp contextmenu.cpp errorwidget.cpp @@ -51,8 +38,39 @@ add_library(neovim-qt-gui tabline.cpp treeview.cpp ${SRCS_PLATFORM} - ${NEOVIM_RCC_SOURCES}) -target_link_libraries(neovim-qt-gui ${QTLIBS} qshellwidget neovim-qt) + data.qrc +) + +if(WIN32) + target_sources(neovim-qt-gui + PRIVATE + arguments_qwindowgeometry.cpp + input_win32.cpp + printinfo_msgbox.cpp + ) +elseif(APPLE) + target_sources(neovim-qt-gui + PRIVATE + arguments_qwindowgeometry.cpp + input_mac.cpp + printinfo_stdout.cpp + ) +else() + target_sources(neovim-qt-gui + PRIVATE + arguments_geometry.cpp + input_unix.cpp + printinfo_stdout.cpp + ) +endif() + + +target_link_libraries(neovim-qt-gui + PUBLIC + ${QTLIBS} + qshellwidget + neovim-qt +) if(APPLE) set_property(SOURCE app.cpp PROPERTY COMPILE_DEFINITIONS @@ -62,12 +80,18 @@ else() NVIM_QT_RELATIVE_RUNTIME_PATH="../share/nvim-qt/runtime") endif() -add_executable(nvim-qt WIN32 MACOSX_BUNDLE main.cpp - ${NEOVIM_RCC_SOURCES} + +add_executable(nvim-qt WIN32 MACOSX_BUNDLE) + +target_sources(nvim-qt + PRIVATE + main.cpp + data.qrc ${RES_FILE} - ${ICON_PATH}) + ${ICON_PATH} +) -target_link_libraries(nvim-qt ${QTLIBS} neovim-qt-gui) +target_link_libraries(nvim-qt PRIVATE neovim-qt-gui) if(APPLE) add_custom_command(TARGET nvim-qt COMMAND ${CMAKE_COMMAND} -E copy_directory @@ -112,8 +136,10 @@ endif() if(WIN32 AND NOT CMAKE_CROSSCOMPILING AND NOT DEFINED USE_STATIC_QT) include(WinDeployQt) WinDeployQt(TARGET nvim-qt COMPILER_RUNTIME INCLUDE_MODULES ${QTLIBS} EXCLUDE_MODULES webkit webkit2) - install(DIRECTORY ${PROJECT_BINARY_DIR}/windeployqt/ - DESTINATION ${CMAKE_INSTALL_BINDIR}) + install( + DIRECTORY ${PROJECT_BINARY_DIR}/windeployqt/ + DESTINATION ${CMAKE_INSTALL_BINDIR} + ) endif() # Generate help tags From 52a5a5bce25866a2a49027d3b5f958c9ac72a80b Mon Sep 17 00:00:00 2001 From: Mikhail Zolotukhin Date: Tue, 29 Nov 2022 22:34:19 +0100 Subject: [PATCH 4/6] Modernify CMake in tests --- test/CMakeLists.txt | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4175cb020..dcf5c7b23 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories(${CMAKE_SOURCE_DIR}/src) add_definitions(-DCMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\") add_definitions(-DNVIM_QT_BINARY=\"$\") if (WIN32 AND USE_STATIC_QT) - add_definitions(-DUSE_STATIC_QT) + add_compile_definitions(-DUSE_STATIC_QT) endif () add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) @@ -33,9 +33,8 @@ function(add_xtest SOURCE_NAME) endfunction() function(add_xtest_gui SOURCE_NAME) - qt5_add_resources(RCC_SOURCES data.qrc) add_executable(${SOURCE_NAME} - ${RCC_SOURCES} + data.qrc ${SOURCE_NAME}.cpp ${SOURCES_COMMON} ${SOURCES_COMMON_GUI} @@ -67,25 +66,25 @@ add_xtest_gui(tst_qsettings # Platform Specific Input Tests add_xtest(tst_input_mac - ${CMAKE_SOURCE_DIR}/src/gui/input.cpp - ${CMAKE_SOURCE_DIR}/src/gui/input_mac.cpp) + ${PROJECT_SOURCE_DIR}/src/gui/input.cpp + ${PROJECT_SOURCE_DIR}/src/gui/input_mac.cpp) add_xtest(tst_input_unix - ${CMAKE_SOURCE_DIR}/src/gui/input.cpp - ${CMAKE_SOURCE_DIR}/src/gui/input_unix.cpp) + ${PROJECT_SOURCE_DIR}/src/gui/input.cpp + ${PROJECT_SOURCE_DIR}/src/gui/input_unix.cpp) add_xtest(tst_input_win32 - ${CMAKE_SOURCE_DIR}/src/gui/input.cpp - ${CMAKE_SOURCE_DIR}/src/gui/input_win32.cpp) + ${PROJECT_SOURCE_DIR}/src/gui/input.cpp + ${PROJECT_SOURCE_DIR}/src/gui/input_win32.cpp) # Platform Agnostic Input Tests add_shared_test(tst_input_common_mac tst_input_common.cpp - ${CMAKE_SOURCE_DIR}/src/gui/input.cpp - ${CMAKE_SOURCE_DIR}/src/gui/input_mac.cpp) + ${PROJECT_SOURCE_DIR}/src/gui/input.cpp + ${PROJECT_SOURCE_DIR}/src/gui/input_mac.cpp) add_shared_test(tst_input_common_unix tst_input_common.cpp - ${CMAKE_SOURCE_DIR}/src/gui/input.cpp - ${CMAKE_SOURCE_DIR}/src/gui/input_unix.cpp) + ${PROJECT_SOURCE_DIR}/src/gui/input.cpp + ${PROJECT_SOURCE_DIR}/src/gui/input_unix.cpp) add_shared_test(tst_input_common_win32 tst_input_common.cpp - ${CMAKE_SOURCE_DIR}/src/gui/input.cpp - ${CMAKE_SOURCE_DIR}/src/gui/input_win32.cpp) + ${PROJECT_SOURCE_DIR}/src/gui/input.cpp + ${PROJECT_SOURCE_DIR}/src/gui/input_win32.cpp) From f683e39de462e89054bc48bfd6c17db70728ccdc Mon Sep 17 00:00:00 2001 From: Mikhail Zolotukhin Date: Sun, 4 Dec 2022 12:51:39 +0100 Subject: [PATCH 5/6] Remove CMakeLists.user from gitignore --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index 93d39bdec..7ddad2359 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,3 @@ src/gui/runtime/doc/tags third-party/msgpack* compile_commands.json !.github - -# Qt Creator project files -CMakeLists.txt.user From 7f3d6e8396f39a3e0b55e56aef795335a93352a7 Mon Sep 17 00:00:00 2001 From: Mikhail Zolotukhin Date: Sun, 4 Dec 2022 13:03:55 +0100 Subject: [PATCH 6/6] Fix formatting --- CMakeLists.txt | 20 +++---- src/CMakeLists.txt | 36 ++++++------ src/auto/CMakeLists.txt | 30 +++++----- src/gui/CMakeLists.txt | 89 +++++++++++++++--------------- src/gui/shellwidget/CMakeLists.txt | 34 ++++++------ test/CMakeLists.txt | 28 +++++----- 6 files changed, 117 insertions(+), 120 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ebd98737..509ccb24a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,7 +142,7 @@ else() endif() if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") - add_compile_definitions(-DQT_NO_DEBUG_OUTPUT) + add_compile_definitions(-DQT_NO_DEBUG_OUTPUT) endif() # Place targets in bin/ or lib/ for all build configurations @@ -157,8 +157,8 @@ foreach(CFGNAME ${CMAKE_CONFIGURATION_TYPES}) endforeach() if(MSVC) - # Allow use of deprecated function names in MSVC (read/write) - add_compile_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) + # Allow use of deprecated function names in MSVC (read/write) + add_compile_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) endif() add_subdirectory(src) @@ -166,7 +166,7 @@ add_subdirectory(doc) option(ENABLE_TESTS "Build tests" OFF) if(ENABLE_TESTS) - find_package(Qt5 REQUIRED COMPONENTS Test) + find_package(Qt5 REQUIRED COMPONENTS Test) enable_testing() add_subdirectory(test) add_subdirectory(src/gui/shellwidget/test) @@ -177,15 +177,15 @@ find_package(PythonInterp) if (PYTHONINTERP_FOUND) set(NVIM "nvim" CACHE STRING "Path to nvim executable") add_custom_target(bindings - COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/bindings/generate_bindings.py - ${NVIM} ${PROJECT_SOURCE_DIR}/src/auto - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/bindings/generate_bindings.py + ${NVIM} ${PROJECT_SOURCE_DIR}/src/auto + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMENT "Generating bindings" - ) + ) add_custom_target(bindings-preview - COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/bindings/generate_bindings.py ${NVIM} - ) + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/bindings/generate_bindings.py ${NVIM} + ) endif() include(CPackOptions) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0b5856b2f..71bfcd091 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,27 +4,27 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_library(neovim-qt STATIC) target_sources(neovim-qt - PRIVATE - function.cpp - function.h - msgpackiodevice.cpp - msgpackiodevice.h - msgpackrequest.cpp - msgpackrequest.h - neovimconnector.cpp - neovimconnector.h - neovimconnectorhelper.cpp - neovimconnectorhelper.h - util.cpp - util.h + PRIVATE + function.cpp + function.h + msgpackiodevice.cpp + msgpackiodevice.h + msgpackrequest.cpp + msgpackrequest.h + neovimconnector.cpp + neovimconnector.h + neovimconnectorhelper.cpp + neovimconnectorhelper.h + util.cpp + util.h ) if(WIN32) - target_sources(neovim-qt - PRIVATE - stdinreader.cpp - stdinreader.h - ) + target_sources(neovim-qt + PRIVATE + stdinreader.cpp + stdinreader.h + ) endif() target_link_libraries(neovim-qt PUBLIC Qt5::Network msgpackc-static) diff --git a/src/auto/CMakeLists.txt b/src/auto/CMakeLists.txt index b65e783d0..bd95f4103 100644 --- a/src/auto/CMakeLists.txt +++ b/src/auto/CMakeLists.txt @@ -1,17 +1,17 @@ target_sources(neovim-qt - PRIVATE - neovimapi0.cpp - neovimapi0.h - neovimapi1.cpp - neovimapi1.h - neovimapi2.cpp - neovimapi2.h - neovimapi3.cpp - neovimapi3.h - neovimapi4.cpp - neovimapi4.h - neovimapi5.cpp - neovimapi5.h - neovimapi6.cpp - neovimapi6.h + PRIVATE + neovimapi0.cpp + neovimapi0.h + neovimapi1.cpp + neovimapi1.h + neovimapi2.cpp + neovimapi2.h + neovimapi3.cpp + neovimapi3.h + neovimapi4.cpp + neovimapi4.h + neovimapi5.cpp + neovimapi5.h + neovimapi6.cpp + neovimapi6.h ) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index c0b21bdf6..8f7e59fec 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -6,7 +6,7 @@ if(WIN32) if (USE_STATIC_QT) add_definitions(-DUSE_STATIC_QT) link_directories(${CMAKE_PREFIX_PATH}/share/qt5/plugins/platforms) - list(APPEND QTLIBS Qt5PlatformCompositorSupport qwindows) + list(APPEND QTLIBS Qt5PlatformCompositorSupport qwindows) endif() set(RES_FILE "data.rc") enable_language(RC) @@ -25,51 +25,51 @@ set(RUNTIME_PATH) add_library(neovim-qt-gui STATIC) target_sources(neovim-qt-gui - PRIVATE - app.cpp - contextmenu.cpp - errorwidget.cpp - input.cpp - mainwindow.cpp - popupmenu.cpp - popupmenumodel.cpp - scrollbar.cpp - shell.cpp - tabline.cpp - treeview.cpp - ${SRCS_PLATFORM} - data.qrc + PRIVATE + app.cpp + contextmenu.cpp + errorwidget.cpp + input.cpp + mainwindow.cpp + popupmenu.cpp + popupmenumodel.cpp + scrollbar.cpp + shell.cpp + tabline.cpp + treeview.cpp + ${SRCS_PLATFORM} + data.qrc ) if(WIN32) - target_sources(neovim-qt-gui - PRIVATE - arguments_qwindowgeometry.cpp - input_win32.cpp - printinfo_msgbox.cpp - ) + target_sources(neovim-qt-gui + PRIVATE + arguments_qwindowgeometry.cpp + input_win32.cpp + printinfo_msgbox.cpp + ) elseif(APPLE) - target_sources(neovim-qt-gui - PRIVATE - arguments_qwindowgeometry.cpp - input_mac.cpp - printinfo_stdout.cpp - ) + target_sources(neovim-qt-gui + PRIVATE + arguments_qwindowgeometry.cpp + input_mac.cpp + printinfo_stdout.cpp + ) else() - target_sources(neovim-qt-gui - PRIVATE - arguments_geometry.cpp - input_unix.cpp - printinfo_stdout.cpp - ) + target_sources(neovim-qt-gui + PRIVATE + arguments_geometry.cpp + input_unix.cpp + printinfo_stdout.cpp + ) endif() target_link_libraries(neovim-qt-gui - PUBLIC - ${QTLIBS} - qshellwidget - neovim-qt + PUBLIC + ${QTLIBS} + qshellwidget + neovim-qt ) if(APPLE) @@ -84,11 +84,11 @@ endif() add_executable(nvim-qt WIN32 MACOSX_BUNDLE) target_sources(nvim-qt - PRIVATE - main.cpp - data.qrc - ${RES_FILE} - ${ICON_PATH} + PRIVATE + main.cpp + data.qrc + ${RES_FILE} + ${ICON_PATH} ) target_link_libraries(nvim-qt PRIVATE neovim-qt-gui) @@ -136,10 +136,7 @@ endif() if(WIN32 AND NOT CMAKE_CROSSCOMPILING AND NOT DEFINED USE_STATIC_QT) include(WinDeployQt) WinDeployQt(TARGET nvim-qt COMPILER_RUNTIME INCLUDE_MODULES ${QTLIBS} EXCLUDE_MODULES webkit webkit2) - install( - DIRECTORY ${PROJECT_BINARY_DIR}/windeployqt/ - DESTINATION ${CMAKE_INSTALL_BINDIR} - ) + install(DIRECTORY ${PROJECT_BINARY_DIR}/windeployqt/ DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() # Generate help tags diff --git a/src/gui/shellwidget/CMakeLists.txt b/src/gui/shellwidget/CMakeLists.txt index 0bba8d3a0..7a0b00325 100644 --- a/src/gui/shellwidget/CMakeLists.txt +++ b/src/gui/shellwidget/CMakeLists.txt @@ -10,31 +10,31 @@ set(CMAKE_AUTOMOC ON) find_package(Qt5 REQUIRED COMPONENTS Widgets) if(ENABLE_TESTS) - find_package(Qt5 REQUIRED COMPONENTS Test) + find_package(Qt5 REQUIRED COMPONENTS Test) endif() if (WIN32 AND USE_STATIC_QT) - add_compile_definitions(-DUSE_STATIC_QT) + add_compile_definitions(-DUSE_STATIC_QT) endif () add_library(qshellwidget STATIC) target_sources(qshellwidget - PRIVATE - cell.cpp - cell.h - cursor.cpp - cursor.h - helpers.cpp - helpers.h - highlight.cpp - highlight.h - konsole_wcwidth.cpp - konsole_wcwidth.h - shellcontents.cpp - shellcontents.h - shellwidget.cpp - shellwidget.h + PRIVATE + cell.cpp + cell.h + cursor.cpp + cursor.h + helpers.cpp + helpers.h + highlight.cpp + highlight.h + konsole_wcwidth.cpp + konsole_wcwidth.h + shellcontents.cpp + shellcontents.h + shellwidget.cpp + shellwidget.h ) target_link_libraries(qshellwidget PUBLIC Qt5::Widgets) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index dcf5c7b23..a3dab3151 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -4,7 +4,7 @@ include_directories(${CMAKE_SOURCE_DIR}/src) add_definitions(-DCMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\") add_definitions(-DNVIM_QT_BINARY=\"$\") if (WIN32 AND USE_STATIC_QT) - add_compile_definitions(-DUSE_STATIC_QT) + add_compile_definitions(-DUSE_STATIC_QT) endif () add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) @@ -34,7 +34,7 @@ endfunction() function(add_xtest_gui SOURCE_NAME) add_executable(${SOURCE_NAME} - data.qrc + data.qrc ${SOURCE_NAME}.cpp ${SOURCES_COMMON} ${SOURCES_COMMON_GUI} @@ -66,25 +66,25 @@ add_xtest_gui(tst_qsettings # Platform Specific Input Tests add_xtest(tst_input_mac - ${PROJECT_SOURCE_DIR}/src/gui/input.cpp - ${PROJECT_SOURCE_DIR}/src/gui/input_mac.cpp) + ${PROJECT_SOURCE_DIR}/src/gui/input.cpp + ${PROJECT_SOURCE_DIR}/src/gui/input_mac.cpp) add_xtest(tst_input_unix - ${PROJECT_SOURCE_DIR}/src/gui/input.cpp - ${PROJECT_SOURCE_DIR}/src/gui/input_unix.cpp) + ${PROJECT_SOURCE_DIR}/src/gui/input.cpp + ${PROJECT_SOURCE_DIR}/src/gui/input_unix.cpp) add_xtest(tst_input_win32 - ${PROJECT_SOURCE_DIR}/src/gui/input.cpp - ${PROJECT_SOURCE_DIR}/src/gui/input_win32.cpp) + ${PROJECT_SOURCE_DIR}/src/gui/input.cpp + ${PROJECT_SOURCE_DIR}/src/gui/input_win32.cpp) # Platform Agnostic Input Tests add_shared_test(tst_input_common_mac tst_input_common.cpp - ${PROJECT_SOURCE_DIR}/src/gui/input.cpp - ${PROJECT_SOURCE_DIR}/src/gui/input_mac.cpp) + ${PROJECT_SOURCE_DIR}/src/gui/input.cpp + ${PROJECT_SOURCE_DIR}/src/gui/input_mac.cpp) add_shared_test(tst_input_common_unix tst_input_common.cpp - ${PROJECT_SOURCE_DIR}/src/gui/input.cpp - ${PROJECT_SOURCE_DIR}/src/gui/input_unix.cpp) + ${PROJECT_SOURCE_DIR}/src/gui/input.cpp + ${PROJECT_SOURCE_DIR}/src/gui/input_unix.cpp) add_shared_test(tst_input_common_win32 tst_input_common.cpp - ${PROJECT_SOURCE_DIR}/src/gui/input.cpp - ${PROJECT_SOURCE_DIR}/src/gui/input_win32.cpp) + ${PROJECT_SOURCE_DIR}/src/gui/input.cpp + ${PROJECT_SOURCE_DIR}/src/gui/input_win32.cpp)