Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -64,12 +64,15 @@ endif () # config.h -check_function_exists (ctermid HAVE_CTERMID) -configure_file (config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) +configure_file(config.h.cmake config.h) # let our config.h be found first in any case include_directories (BEFORE ${CMAKE_CURRENT_BINARY_DIR}) +# Allow adding Qt resource files with `add_executable` or `target_sources` instead of +# `qt5_add_resources`. See https://cmake.org/cmake/help/v3.0/manual/cmake-qt.7.html#autorcc. +set(CMAKE_AUTORCC ON) + # kwrite ecm_optional_add_subdirectory (kwrite) Index: addons/CMakeLists.txt =================================================================== --- addons/CMakeLists.txt +++ addons/CMakeLists.txt @@ -1,5 +1,15 @@ -# detect additional frameworks -find_package(KF5 "${KF5_DEP_VERSION}" OPTIONAL_COMPONENTS Wallet Plasma Service ItemModels ThreadWeaver NewStuff IconThemes GuiAddons) +find_package( + KF5 ${KF5_DEP_VERSION} + OPTIONAL_COMPONENTS + GuiAddons + IconThemes + ItemModels + NewStuff + Plasma + Service + Wallet + ThreadWeaver +) set_package_properties(KF5Wallet PROPERTIES PURPOSE "Required to build the katesql addon") set_package_properties(KF5Plasma PROPERTIES PURPOSE "Required to build the sessionapplet addon") @@ -8,85 +18,45 @@ set_package_properties(KF5ThreadWeaver PROPERTIES PURPOSE "Required to build the project addon") set_package_properties(KF5NewStuff PROPERTIES PURPOSE "Required to build the snippets and project addons") -# document switcher -ecm_optional_add_subdirectory (filetree) - -# search in open documents and files -ecm_optional_add_subdirectory (search) - -# ALT+Tab like tab switcher -ecm_optional_add_subdirectory (tabswitcher) - -# ctags -ecm_optional_add_subdirectory (kate-ctags) - -# backtrace -ecm_optional_add_subdirectory (backtracebrowser) - -# file browser -ecm_optional_add_subdirectory (filebrowser) - -# xml completion -ecm_optional_add_subdirectory (xmltools) - -# XML Validation plugin -ecm_optional_add_subdirectory (xmlcheck) - -# open header matching to current file -ecm_optional_add_subdirectory (openheader) - -# debugger plugin, needs windows love, guarded until ported to win32 -if (NOT WIN32) - ecm_optional_add_subdirectory (gdbplugin) -endif () - -# list symbols and functions in a file -ecm_optional_add_subdirectory (symbolviewer) - -# replicode integration -ecm_optional_add_subdirectory (replicode) - -# pipe text through some external command -ecm_optional_add_subdirectory (textfilter) - -# Rust complection plugin -ecm_optional_add_subdirectory (rustcompletion) - -# D completion plugin -ecm_optional_add_subdirectory (lumen) - -# LSP client plugin -ecm_optional_add_subdirectory (lspclient) - -# build plugin -ecm_optional_add_subdirectory (katebuild-plugin) - -# close document except this one (or similar) -ecm_optional_add_subdirectory (close-except-like) +ecm_optional_add_subdirectory(filetree) # document switcher +ecm_optional_add_subdirectory(search) # Search in open documents and files. +ecm_optional_add_subdirectory(tabswitcher) # ALT+Tab like tab switcher +ecm_optional_add_subdirectory(kate-ctags) # ctags +ecm_optional_add_subdirectory(backtracebrowser) # backtrace +ecm_optional_add_subdirectory(filebrowser) # file browser +ecm_optional_add_subdirectory(xmltools) # XML completion +ecm_optional_add_subdirectory(xmlcheck) # XML Validation plugin +ecm_optional_add_subdirectory(openheader) # Open header matching to current file. +ecm_optional_add_subdirectory(symbolviewer) # List symbols and functions in a file. +ecm_optional_add_subdirectory(replicode) # replicode integration +ecm_optional_add_subdirectory(textfilter) # Pipe text through some external command. +ecm_optional_add_subdirectory(rustcompletion) # Rust complection plugin +ecm_optional_add_subdirectory(lumen) # D completion plugin +ecm_optional_add_subdirectory(lspclient) # Language Server Protocol (LSP) client plugin. +ecm_optional_add_subdirectory(katebuild-plugin) # build plugin +ecm_optional_add_subdirectory(close-except-like) # Close document except this one (or similar). +ecm_optional_add_subdirectory (preview) # Live preview of sources in target format. + +if(NOT WIN32) + ecm_optional_add_subdirectory(gdbplugin) # Debugger plugin. Hasn't been ported to Windows yet. +endif() -if(KF5Wallet_FOUND) - # kate sql - ecm_optional_add_subdirectory (katesql) +if(KF5Wallet_FOUND) + ecm_optional_add_subdirectory(katesql) # kate sql endif() if(KF5NewStuff_FOUND) - # snippets - ecm_optional_add_subdirectory (snippets) + ecm_optional_add_subdirectory (snippets) # snippets endif() -# live preview of sources in target format -ecm_optional_add_subdirectory (preview) - -# terminal tool view if(KF5Service_FOUND AND NOT WIN32) - ecm_optional_add_subdirectory (konsole) + ecm_optional_add_subdirectory (konsole) # terminal tool view endif() -if(KF5ItemModels_FOUND AND KF5ThreadWeaver_FOUND AND KF5NewStuff_FOUND) - # small & smart project manager - ecm_optional_add_subdirectory (project) +if(KF5ItemModels_FOUND AND KF5ThreadWeaver_FOUND AND KF5NewStuff_FOUND) + ecm_optional_add_subdirectory (project) # Small & smart project manager. endif() -if (KF5Plasma_FOUND AND KF5Service_FOUND) - ecm_optional_add_subdirectory (sessionapplet) +if(KF5Plasma_FOUND AND KF5Service_FOUND) + ecm_optional_add_subdirectory (sessionapplet) endif() Index: addons/backtracebrowser/CMakeLists.txt =================================================================== --- addons/backtracebrowser/CMakeLists.txt +++ addons/backtracebrowser/CMakeLists.txt @@ -1,34 +1,30 @@ -########### next target ############### -add_definitions(-DTRANSLATION_DOMAIN=\"katebacktracebrowserplugin\") - -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) - set(katebacktracebrowserplugin_PART_SRCS - katebacktracebrowser.cpp - btparser.cpp - btfileindexer.cpp - btdatabase.cpp + katebacktracebrowser.cpp + btparser.cpp + btfileindexer.cpp + btdatabase.cpp ) set(katebacktracebrowserplugin_PART_UI - btbrowserwidget.ui - btconfigwidget.ui + btbrowserwidget.ui + btconfigwidget.ui ) -ki18n_wrap_ui(katebacktracebrowserplugin_PART_SRCS ${katebacktracebrowserplugin_PART_UI} ) -add_library(katebacktracebrowserplugin MODULE ${katebacktracebrowserplugin_PART_SRCS}) -# we compile in the .desktop file -kcoreaddons_desktop_to_json (katebacktracebrowserplugin katebacktracebrowserplugin.desktop) +ki18n_wrap_ui(katebacktracebrowserplugin_PART_SRCS ${katebacktracebrowserplugin_PART_UI}) + +add_library(katebacktracebrowserplugin MODULE ${katebacktracebrowserplugin_PART_SRCS}) +target_compile_definitions(katebacktracebrowserplugin PRIVATE TRANSLATION_DOMAIN="katebacktracebrowserplugin") -target_link_libraries(katebacktracebrowserplugin +target_link_libraries( + katebacktracebrowserplugin + PRIVATE KF5::TextEditor KF5::I18n ) -########### install files ############### -install( TARGETS katebacktracebrowserplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor ) +kcoreaddons_desktop_to_json(katebacktracebrowserplugin katebacktracebrowserplugin.desktop) +install(TARGETS katebacktracebrowserplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) -############# unit tests ################ -if (BUILD_TESTING) - add_subdirectory(autotests) +if(BUILD_TESTING) + add_subdirectory(autotests) endif() Index: addons/backtracebrowser/autotests/CMakeLists.txt =================================================================== --- addons/backtracebrowser/autotests/CMakeLists.txt +++ addons/backtracebrowser/autotests/CMakeLists.txt @@ -1,12 +1,19 @@ include(ECMMarkAsTest) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR}/.. +add_executable(btbrowser_test "") +target_include_directories(btbrowser_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..) + +target_link_libraries( + btbrowser_test + PRIVATE + kdeinit_kate + Qt5::Test +) + +target_sources(btbrowser_test PRIVATE + btbrowsertest.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../btparser.cpp ) -# Plugin Kate Backtrace Browser -set(BtBrowserSrc btbrowsertest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../btparser.cpp) -add_executable(btbrowser_test ${BtBrowserSrc}) add_test(NAME plugin-btbrowser_test COMMAND btbrowser_test) -target_link_libraries(btbrowser_test kdeinit_kate Qt5::Test) ecm_mark_as_test(btbrowser_test) Index: addons/close-except-like/CMakeLists.txt =================================================================== --- addons/close-except-like/CMakeLists.txt +++ addons/close-except-like/CMakeLists.txt @@ -1,37 +1,24 @@ -project(katecloseexceptplugin) -add_definitions(-DTRANSLATION_DOMAIN=\"katecloseexceptplugin\") -set(VERSION_MAJOR 0) -set(VERSION_MINOR 3) -set(VERSION_PATCH 5) -set(VERSION_STRING ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) - -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) - set(KATE_CLOSE_EXCEPT_PLUGIN_SOURCES - close_confirm_dialog.cpp - close_except_plugin.cpp - ) - -set(KATE_CLOSE_EXCEPT_PLUGIN_UI - close_confirm_dialog.ui + close_confirm_dialog.cpp + close_except_plugin.cpp + plugin.qrc ) -ki18n_wrap_ui(KATE_CLOSE_EXCEPT_PLUGIN_SOURCES ${KATE_CLOSE_EXCEPT_PLUGIN_UI}) -# resource for ui file and stuff -qt5_add_resources(KATE_CLOSE_EXCEPT_PLUGIN_SOURCES plugin.qrc) +set(KATE_CLOSE_EXCEPT_PLUGIN_UI close_confirm_dialog.ui) + +ki18n_wrap_ui(KATE_CLOSE_EXCEPT_PLUGIN_SOURCES ${KATE_CLOSE_EXCEPT_PLUGIN_UI}) add_library(katecloseexceptplugin MODULE ${KATE_CLOSE_EXCEPT_PLUGIN_SOURCES}) +target_compile_definitions(katecloseexceptplugin PRIVATE TRANSLATION_DOMAIN="katecloseexceptplugin") + +target_link_libraries( + katecloseexceptplugin + PRIVATE + KF5::TextEditor + KF5::Parts + KF5::I18n + KF5::IconThemes +) -# we compile in the .desktop file kcoreaddons_desktop_to_json(katecloseexceptplugin katecloseexceptplugin.desktop) - -target_link_libraries(katecloseexceptplugin - KF5::TextEditor - KF5::Parts - KF5::I18n - KF5::IconThemes - ) - -configure_file(config.h.in config.h) - install(TARGETS katecloseexceptplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/close-except-like/close_except_plugin.cpp =================================================================== --- addons/close-except-like/close_except_plugin.cpp +++ addons/close-except-like/close_except_plugin.cpp @@ -23,7 +23,6 @@ */ // Project specific includes -#include "config.h" #include "close_except_plugin.h" #include "close_confirm_dialog.h" @@ -42,18 +41,6 @@ #include K_PLUGIN_FACTORY_WITH_JSON(CloseExceptPluginFactory, "katecloseexceptplugin.json", registerPlugin();) -/*K_EXPORT_PLUGIN( - CloseExceptPluginFactory( - KAboutData( - "katecloseexceptplugin" - , "katecloseexceptplugin" - , ki18n("Close Except/Like Plugin") - , PLUGIN_VERSION - , ki18n("Close all documents started from specified path") - , KAboutData::License_LGPL_V3 - ) - ) - )*/ namespace kate { //BEGIN CloseExceptPlugin Index: addons/close-except-like/config.h.in =================================================================== --- addons/close-except-like/config.h.in +++ /dev/null @@ -1,31 +0,0 @@ -/** - * \file - * - * \brief Class \c kate::config (interface) - * - * Copyright (C) 2012 Alex Turbov - * - * \date Thu Mar 8 08:19:57 MSK 2012 -- Initial design - * - * \attention DO NOT EDIT THIS FILE! IT WAS GENERATED BY CMAKE. - */ -/* - * KateCloseExceptPlugin is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * KateCloseExceptPlugin is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#ifndef __SRC__CONFIG_H__ -# define __SRC__CONFIG_H__ -# define PLUGIN_VERSION "@VERSION_STRING@" -#endif // __SRC__CONFIG_H__ -// kate: hl c++; Index: addons/filebrowser/CMakeLists.txt =================================================================== --- addons/filebrowser/CMakeLists.txt +++ addons/filebrowser/CMakeLists.txt @@ -1,20 +1,22 @@ -project(katefilebrowserplugin) -add_definitions(-DTRANSLATION_DOMAIN=\"katefilebrowserplugin\") - -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) - set(katefilebrowserplugin_PART_SRCS - katefilebrowserplugin.cpp - katefilebrowserconfig.cpp - katefilebrowser.cpp - katebookmarkhandler.cpp + katefilebrowserplugin.cpp + katefilebrowserconfig.cpp + katefilebrowser.cpp + katebookmarkhandler.cpp ) add_library(katefilebrowserplugin MODULE ${katefilebrowserplugin_PART_SRCS}) +target_compile_definitions(katefilebrowserplugin PRIVATE TRANSLATION_DOMAIN="katefilebrowserplugin") -# we compile in the .desktop file -kcoreaddons_desktop_to_json (katefilebrowserplugin katefilebrowserplugin.desktop) - -target_link_libraries(katefilebrowserplugin KF5::TextEditor KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets KF5::I18n) +target_link_libraries( + katefilebrowserplugin + PRIVATE + KF5::TextEditor + KF5::KIOCore + KF5::KIOFileWidgets + KF5::KIOWidgets + KF5::I18n +) -install(TARGETS katefilebrowserplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor ) +kcoreaddons_desktop_to_json(katefilebrowserplugin katefilebrowserplugin.desktop) +install(TARGETS katefilebrowserplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/filetree/CMakeLists.txt =================================================================== --- addons/filetree/CMakeLists.txt +++ addons/filetree/CMakeLists.txt @@ -1,32 +1,42 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"katefiletree\") -project(katefiletreeplugin) - -set(katefiletree_PART_SRCS katefiletree.cpp katefiletreemodel.cpp katefiletreeproxymodel.cpp ) -set(katefiletreeplugin_PART_SRCS katefiletreeplugin.cpp katefiletreeconfigpage.cpp katefiletreepluginsettings.cpp ) +add_library(katefiletree STATIC "") +set_target_properties(katefiletree PROPERTIES POSITION_INDEPENDENT_CODE TRUE) -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) +# PUBLIC so that katefiletreeplugin inherits these usage requirements. +target_compile_definitions(katefiletree PUBLIC TRANSLATION_DOMAIN="katefiletree") -add_library (katefiletree STATIC ${katefiletree_PART_SRCS}) -set_target_properties(katefiletree PROPERTIES POSITION_INDEPENDENT_CODE TRUE) -target_link_libraries(katefiletree -PUBLIC - KF5::TextEditor - KF5::I18n - KF5::GuiAddons - KF5::IconThemes +target_link_libraries( + katefiletree + PUBLIC + KF5::TextEditor + KF5::I18n + KF5::GuiAddons + KF5::IconThemes ) -# resource for ui file and stuff -qt5_add_resources(katefiletreeplugin_PART_SRCS plugin.qrc) +target_sources( + katefiletree + PRIVATE + katefiletree.cpp + katefiletreemodel.cpp + katefiletreeproxymodel.cpp + plugin.qrc +) -add_library (katefiletreeplugin MODULE ${katefiletreeplugin_PART_SRCS}) -target_link_libraries(katefiletreeplugin katefiletree) +add_library(katefiletreeplugin MODULE "") +target_link_libraries(katefiletreeplugin PRIVATE katefiletree) -install(TARGETS katefiletreeplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor ) +target_sources( + katefiletreeplugin + PRIVATE + katefiletreeplugin.cpp + katefiletreeconfigpage.cpp + katefiletreepluginsettings.cpp + plugin.qrc +) -kcoreaddons_desktop_to_json (katefiletreeplugin katefiletreeplugin.desktop) +kcoreaddons_desktop_to_json(katefiletreeplugin katefiletreeplugin.desktop) +install(TARGETS katefiletreeplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) -############# unit tests ################ -if (BUILD_TESTING) - add_subdirectory(autotests) +if(BUILD_TESTING) + add_subdirectory(autotests) endif() Index: addons/filetree/autotests/CMakeLists.txt =================================================================== --- addons/filetree/autotests/CMakeLists.txt +++ addons/filetree/autotests/CMakeLists.txt @@ -1,15 +1,20 @@ - include(ECMMarkAsTest) -macro(filetree_executable_tests) - foreach(_testname ${ARGN}) - add_executable(${_testname} ${_testname}.cpp document_dummy.cpp) - add_test(NAME kateapp-${_testname} COMMAND ${_testname}) - target_link_libraries(${_testname} katefiletree Qt5::Test) - ecm_mark_as_test(${_testname}) - endforeach(_testname) -endmacro(filetree_executable_tests) - -filetree_executable_tests( - filetree_model_test +add_executable(filetree_model_test "") + +target_link_libraries( + filetree_model_test + PRIVATE + katefiletree + Qt5::Test ) + +target_sources( + filetree_model_test + PRIVATE + filetree_model_test.cpp + document_dummy.cpp +) + +add_test(NAME kateapp-filetree_model_test COMMAND filetree_model_test) +ecm_mark_as_test(filetree_model_test) Index: addons/gdbplugin/CMakeLists.txt =================================================================== --- addons/gdbplugin/CMakeLists.txt +++ addons/gdbplugin/CMakeLists.txt @@ -1,23 +1,25 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"kategdbplugin\") -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - set(kategdbplugin_PART_SRCS - plugin_kategdb.cpp - debugview.cpp - configview.cpp - ioview.cpp - localsview.cpp - advanced_settings.cpp + plugin_kategdb.cpp + debugview.cpp + configview.cpp + ioview.cpp + localsview.cpp + advanced_settings.cpp + plugin.qrc ) ki18n_wrap_ui(kategdbplugin_PART_SRCS advanced_settings.ui) -# resource for ui file and stuff -qt5_add_resources(kategdbplugin_PART_SRCS plugin.qrc) - add_library(kategdbplugin MODULE ${kategdbplugin_PART_SRCS}) -kcoreaddons_desktop_to_json (kategdbplugin kategdbplugin.desktop) +target_compile_definitions(kategdbplugin PRIVATE TRANSLATION_DOMAIN="kategdbplugin") -target_link_libraries(kategdbplugin KF5::TextEditor KF5::I18n KF5::IconThemes) +target_link_libraries( + kategdbplugin + PRIVATE + KF5::TextEditor + KF5::I18n + KF5::IconThemes +) +kcoreaddons_desktop_to_json(kategdbplugin kategdbplugin.desktop) install(TARGETS kategdbplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/kate-ctags/CMakeLists.txt =================================================================== --- addons/kate-ctags/CMakeLists.txt +++ addons/kate-ctags/CMakeLists.txt @@ -1,32 +1,33 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"kate-ctags-plugin\") - include(ECMQtDeclareLoggingCategory) -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) - set(ctagsplugin_SRC - readtags.c - tags.cpp - ctagskinds.cpp - kate_ctags_view.cpp - kate_ctags_plugin.cpp + readtags.c + tags.cpp + ctagskinds.cpp + kate_ctags_view.cpp + kate_ctags_plugin.cpp + plugin.qrc ) -ecm_qt_declare_logging_category(ctagsplugin_SRC - HEADER kate_ctags_debug.h - IDENTIFIER KTECTAGS - CATEGORY_NAME "katectagsplugin" +ecm_qt_declare_logging_category( + ctagsplugin_SRC + HEADER kate_ctags_debug.h + IDENTIFIER KTECTAGS + CATEGORY_NAME "katectagsplugin" ) ki18n_wrap_ui(ctagsplugin_SRC kate_ctags.ui CTagsGlobalConfig.ui) -# resource for ui file and stuff -qt5_add_resources(ctagsplugin_SRC plugin.qrc) - add_library(katectagsplugin MODULE ${ctagsplugin_SRC}) +target_compile_definitions(katectagsplugin PRIVATE TRANSLATION_DOMAIN="kate-ctags-plugin") + +target_link_libraries( + katectagsplugin + PRIVATE + KF5::TextEditor + KF5::I18n + KF5::IconThemes +) -kcoreaddons_desktop_to_json (katectagsplugin katectagsplugin.desktop) - -target_link_libraries(katectagsplugin KF5::TextEditor KF5::I18n KF5::IconThemes) - -install(TARGETS katectagsplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor ) +kcoreaddons_desktop_to_json(katectagsplugin katectagsplugin.desktop) +install(TARGETS katectagsplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/katebuild-plugin/CMakeLists.txt =================================================================== --- addons/katebuild-plugin/CMakeLists.txt +++ addons/katebuild-plugin/CMakeLists.txt @@ -1,22 +1,25 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"katebuild-plugin\") - set(katebuild_SRCS - plugin_katebuild.cpp - targets.cpp - TargetHtmlDelegate.cpp - TargetModel.cpp - UrlInserter.cpp - SelectTargetView.cpp + plugin_katebuild.cpp + targets.cpp + TargetHtmlDelegate.cpp + TargetModel.cpp + UrlInserter.cpp + SelectTargetView.cpp + plugin.qrc ) ki18n_wrap_ui(katebuild_SRCS build.ui SelectTargetUi.ui) -# resource for ui file and stuff -qt5_add_resources(katebuild_SRCS plugin.qrc) - add_library(katebuildplugin MODULE ${katebuild_SRCS}) -kcoreaddons_desktop_to_json (katebuildplugin katebuildplugin.desktop) -target_link_libraries(katebuildplugin KF5::TextEditor KF5::I18n KF5::IconThemes) +target_compile_definitions(katebuildplugin PRIVATE TRANSLATION_DOMAIN="katebuild-plugin") -install(TARGETS katebuildplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) +target_link_libraries( + katebuildplugin + PRIVATE + KF5::TextEditor + KF5::I18n + KF5::IconThemes +) +kcoreaddons_desktop_to_json (katebuildplugin katebuildplugin.desktop) +install(TARGETS katebuildplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/katesql/CMakeLists.txt =================================================================== --- addons/katesql/CMakeLists.txt +++ addons/katesql/CMakeLists.txt @@ -1,8 +1,3 @@ -project(katesqlplugin) - -add_definitions(-DTRANSLATION_DOMAIN=\"katesql\") -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) - set(katesql_SRCS katesqlplugin.cpp katesqlview.cpp @@ -20,18 +15,23 @@ exportwizard.cpp outputstylewidget.cpp outputwidget.cpp + plugin.qrc ) -# resource for ui file and stuff -qt5_add_resources(katesql_SRCS plugin.qrc) - -add_library (katesqlplugin MODULE ${katesql_SRCS}) +add_library(katesqlplugin MODULE ${katesql_SRCS}) +target_compile_definitions(katesqlplugin PRIVATE TRANSLATION_DOMAIN="katesql") -kcoreaddons_desktop_to_json (katesqlplugin katesql.desktop) - -target_link_libraries(katesqlplugin +target_link_libraries( + katesqlplugin + PRIVATE + Qt5::Sql KF5::TextEditor - KF5::Parts KF5::I18n KF5::Wallet - Qt5::Sql KF5::ItemViews KF5::IconThemes) + KF5::Parts + KF5::I18n + KF5::Wallet + KF5::ItemViews + KF5::IconThemes +) +kcoreaddons_desktop_to_json(katesqlplugin katesql.desktop) install(TARGETS katesqlplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor ) Index: addons/konsole/CMakeLists.txt =================================================================== --- addons/konsole/CMakeLists.txt +++ addons/konsole/CMakeLists.txt @@ -1,18 +1,9 @@ -project(katekonsoleplugin) -add_definitions(-DTRANSLATION_DOMAIN=\"katekonsoleplugin\") +add_library(katekonsoleplugin MODULE "") +target_compile_definitions(katekonsoleplugin PRIVATE TRANSLATION_DOMAIN="katekonsoleplugin") -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) - -set(katekonsoleplugin_PART_SRCS kateconsole.cpp ) - -# resource for ui file and stuff -qt5_add_resources(katekonsoleplugin_PART_SRCS plugin.qrc) - -add_library (katekonsoleplugin MODULE ${katekonsoleplugin_PART_SRCS}) - -kcoreaddons_desktop_to_json (katekonsoleplugin katekonsoleplugin.desktop) - -target_link_libraries(katekonsoleplugin +target_link_libraries( + katekonsoleplugin + PRIVATE KF5::TextEditor KF5::Parts KF5::IconThemes @@ -20,4 +11,12 @@ KF5::Service ) -install(TARGETS katekonsoleplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor ) +target_sources( + katekonsoleplugin + PRIVATE + kateconsole.cpp + plugin.qrc +) + +kcoreaddons_desktop_to_json(katekonsoleplugin katekonsoleplugin.desktop) +install(TARGETS katekonsoleplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/lspclient/CMakeLists.txt =================================================================== --- addons/lspclient/CMakeLists.txt +++ addons/lspclient/CMakeLists.txt @@ -1,9 +1,5 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) - include(ECMQtDeclareLoggingCategory) -add_definitions(-DTRANSLATION_DOMAIN=\"lspclient\") - set(lspclientplugin_SRCS lspclientcompletion.cpp lspclientconfigpage.cpp @@ -13,30 +9,31 @@ lspclientserver.cpp lspclientservermanager.cpp lspclientsymbolview.cpp + plugin.qrc ) -ecm_qt_declare_logging_category(lspclientplugin_debug_SRCS - HEADER lspclient_debug.h - IDENTIFIER LSPCLIENT - CATEGORY_NAME "katelspclientplugin" +ecm_qt_declare_logging_category( + lspclientplugin_debug_SRCS + HEADER lspclient_debug.h + IDENTIFIER LSPCLIENT + CATEGORY_NAME "katelspclientplugin" ) -# resource for ui file and stuff -qt5_add_resources(lspclientplugin_SRCS plugin.qrc) add_library(lspclientplugin MODULE ${lspclientplugin_SRCS} ${lspclientplugin_debug_SRCS}) - -kcoreaddons_desktop_to_json(lspclientplugin lspclientplugin.desktop) - -target_link_libraries(lspclientplugin - KF5::TextEditor - KF5::XmlGui - KF5::ItemViews - KF5::ItemModels +target_compile_definitions(lspclientplugin PRIVATE TRANSLATION_DOMAIN="lspclient") + +target_link_libraries( + lspclientplugin + PRIVATE + KF5::TextEditor + KF5::XmlGui + KF5::ItemViews + KF5::ItemModels ) +kcoreaddons_desktop_to_json(lspclientplugin lspclientplugin.desktop) install(TARGETS lspclientplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) -############# unit tests ################ -if (BUILD_TESTING) - add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) endif() Index: addons/lspclient/tests/CMakeLists.txt =================================================================== --- addons/lspclient/tests/CMakeLists.txt +++ addons/lspclient/tests/CMakeLists.txt @@ -1,3 +1,17 @@ -add_executable(lsptestapp lsptestapp.cpp ../lspclientserver.cpp - ${lspclientplugin_debug_SRCS}) -target_link_libraries(lsptestapp KF5::TextEditor Qt5::Core) +add_executable(lsptestapp "") +target_include_directories(lsptestapp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/..) + +target_link_libraries( + lsptestapp + PRIVATE + KF5::TextEditor + Qt5::Core +) + +target_sources( + lsptestapp + PRIVATE + lsptestapp.cpp + ../lspclientserver.cpp + ${lspclientplugin_debug_SRCS} +) Index: addons/lumen/CMakeLists.txt =================================================================== --- addons/lumen/CMakeLists.txt +++ addons/lumen/CMakeLists.txt @@ -1,18 +1,18 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) +add_library(ktexteditor_lumen MODULE "") +target_compile_definitions(ktexteditor_lumen PRIVATE TRANSLATION_DOMAIN="ktexteditor_lumen") -add_definitions(-DTRANSLATION_DOMAIN=\"ktexteditor_lumen\") - -set(ktexteditor_lumen_SRCS - lumen.cpp - dcd.cpp - completion.cpp +target_link_libraries( + ktexteditor_lumen + PRIVATE KF5::TextEditor ) -add_library(ktexteditor_lumen MODULE ${ktexteditor_lumen_SRCS}) -kcoreaddons_desktop_to_json(ktexteditor_lumen ktexteditor_lumen.desktop) -target_link_libraries(ktexteditor_lumen - KF5::TextEditor +target_sources( + ktexteditor_lumen + PRIVATE + lumen.cpp + dcd.cpp + completion.cpp ) +kcoreaddons_desktop_to_json(ktexteditor_lumen ktexteditor_lumen.desktop) install(TARGETS ktexteditor_lumen DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) - Index: addons/openheader/CMakeLists.txt =================================================================== --- addons/openheader/CMakeLists.txt +++ addons/openheader/CMakeLists.txt @@ -1,17 +1,20 @@ -project (kateopenheader) -add_definitions(-DTRANSLATION_DOMAIN=\"kateopenheader\") +add_library(kateopenheaderplugin MODULE "") +target_compile_definitions(kateopenheaderplugin PRIVATE TRANSLATION_DOMAIN="kateopenheader") -########### next target ############### -set(kateopenheaderplugin_PART_SRCS plugin_kateopenheader.cpp ) +target_link_libraries( + kateopenheaderplugin + PRIVATE + KF5::TextEditor + KF5::I18n + KF5::Parts +) -# resource for ui file and stuff -qt5_add_resources(kateopenheaderplugin_PART_SRCS plugin.qrc) +target_sources( + kateopenheaderplugin + PRIVATE + plugin_kateopenheader.cpp + plugin.qrc +) -add_library(kateopenheaderplugin MODULE ${kateopenheaderplugin_PART_SRCS}) -kcoreaddons_desktop_to_json (kateopenheaderplugin kateopenheaderplugin.desktop) -target_link_libraries(kateopenheaderplugin - KF5::TextEditor - KF5::I18n - KF5::Parts) - -install(TARGETS kateopenheaderplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor ) +kcoreaddons_desktop_to_json(kateopenheaderplugin kateopenheaderplugin.desktop) +install(TARGETS kateopenheaderplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/preview/CMakeLists.txt =================================================================== --- addons/preview/CMakeLists.txt +++ addons/preview/CMakeLists.txt @@ -1,23 +1,25 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"ktexteditorpreviewplugin\") - include(ECMQtDeclareLoggingCategory) set(ktexteditorpreviewplugin_SRCS - ktexteditorpreviewplugin.cpp - ktexteditorpreviewview.cpp - previewwidget.cpp - kpartview.cpp + ktexteditorpreviewplugin.cpp + ktexteditorpreviewview.cpp + previewwidget.cpp + kpartview.cpp ) -ecm_qt_declare_logging_category(ktexteditorpreviewplugin_SRCS - HEADER ktexteditorpreview_debug.h - IDENTIFIER KTEPREVIEW - CATEGORY_NAME "ktexteditorpreviewplugin" +ecm_qt_declare_logging_category( + ktexteditorpreviewplugin_SRCS + HEADER ktexteditorpreview_debug.h + IDENTIFIER KTEPREVIEW + CATEGORY_NAME "ktexteditorpreviewplugin" ) add_library(ktexteditorpreviewplugin MODULE ${ktexteditorpreviewplugin_SRCS}) +target_compile_definitions(ktexteditorpreviewplugin PRIVATE TRANSLATION_DOMAIN="ktexteditorpreviewplugin") -target_link_libraries(ktexteditorpreviewplugin +target_link_libraries( + ktexteditorpreviewplugin + PRIVATE KF5::TextEditor KF5::I18n ) Index: addons/project/CMakeLists.txt =================================================================== --- addons/project/CMakeLists.txt +++ addons/project/CMakeLists.txt @@ -1,53 +1,59 @@ -project(kateprojectplugin) - find_package(KF5NewStuff ${KF5_DEP_VERSION} REQUIRED) # For KMoreTools -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) +add_library(kateprojectplugin MODULE "") +target_compile_definitions(kateprojectplugin PRIVATE TRANSLATION_DOMAIN="kateproject") -add_definitions(-DTRANSLATION_DOMAIN=\"kateproject\") -set(kateprojectplugin_PART_SRCS - fileutil.cpp - kateprojectplugin.cpp - kateprojectpluginview.cpp - kateproject.cpp - kateprojectworker.cpp - kateprojectitem.cpp - kateprojectview.cpp - kateprojectviewtree.cpp - kateprojecttreeviewcontextmenu.cpp - kateprojectinfoview.cpp - kateprojectcompletion.cpp - kateprojectindex.cpp - kateprojectinfoviewindex.cpp - kateprojectinfoviewterminal.cpp - kateprojectinfoviewcodeanalysis.cpp - kateprojectinfoviewnotes.cpp - kateprojectconfigpage.cpp - kateprojectcodeanalysistool.cpp - tools/kateprojectcodeanalysistoolcppcheck.cpp - tools/kateprojectcodeanalysistoolflake8.cpp - tools/kateprojectcodeanalysistoolshellcheck.cpp - tools/kateprojectcodeanalysisselector.cpp +target_link_libraries( + kateprojectplugin + PRIVATE + KF5::TextEditor + KF5::Parts + KF5::I18n + KF5::GuiAddons + KF5::ItemViews + KF5::ItemModels + KF5::IconThemes + KF5::ThreadWeaver + KF5::NewStuff ) -# resource for ui file and stuff -qt5_add_resources(kateprojectplugin_PART_SRCS plugin.qrc) +check_function_exists(ctermid HAVE_CTERMID) +if(HAVE_CTERMID) + target_compile_definitions(kateprojectplugin PRIVATE HAVE_CTERMID) +endif() -add_library(kateprojectplugin MODULE ${kateprojectplugin_PART_SRCS}) -kcoreaddons_desktop_to_json (kateprojectplugin kateprojectplugin.desktop) -target_link_libraries(kateprojectplugin - KF5::TextEditor - KF5::Parts KF5::I18n - KF5::GuiAddons - KF5::ItemViews KF5::ItemModels KF5::IconThemes KF5::ThreadWeaver - KF5::NewStuff # For KMoreTools +target_sources( + kateprojectplugin + PRIVATE + fileutil.cpp + kateprojectplugin.cpp + kateprojectpluginview.cpp + kateproject.cpp + kateprojectworker.cpp + kateprojectitem.cpp + kateprojectview.cpp + kateprojectviewtree.cpp + kateprojecttreeviewcontextmenu.cpp + kateprojectinfoview.cpp + kateprojectcompletion.cpp + kateprojectindex.cpp + kateprojectinfoviewindex.cpp + kateprojectinfoviewterminal.cpp + kateprojectinfoviewcodeanalysis.cpp + kateprojectinfoviewnotes.cpp + kateprojectconfigpage.cpp + kateprojectcodeanalysistool.cpp + tools/kateprojectcodeanalysistoolcppcheck.cpp + tools/kateprojectcodeanalysistoolflake8.cpp + tools/kateprojectcodeanalysistoolshellcheck.cpp + tools/kateprojectcodeanalysisselector.cpp + plugin.qrc ) -########### install files ############### -install(TARGETS kateprojectplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor ) -install( FILES kateproject.example DESTINATION ${DATA_INSTALL_DIR}/kateproject ) +kcoreaddons_desktop_to_json(kateprojectplugin kateprojectplugin.desktop) +install(TARGETS kateprojectplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) +install(FILES kateproject.example DESTINATION ${DATA_INSTALL_DIR}/kateproject) -############# unit tests ################ -if (BUILD_TESTING) - add_subdirectory(autotests) +if(BUILD_TESTING) + add_subdirectory(autotests) endif() Index: addons/project/autotests/CMakeLists.txt =================================================================== --- addons/project/autotests/CMakeLists.txt +++ addons/project/autotests/CMakeLists.txt @@ -1,6 +1,6 @@ include(ECMMarkAsTest) -add_executable(projectplugin_test ${ProjectPluginSrc}) +add_executable(projectplugin_test "") target_include_directories(projectplugin_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..) target_link_libraries( Index: addons/project/kateprojectplugin.cpp =================================================================== --- addons/project/kateprojectplugin.cpp +++ addons/project/kateprojectplugin.cpp @@ -37,8 +37,6 @@ #include -#include "config.h" - #ifdef HAVE_CTERMID #include #include Index: addons/replicode/CMakeLists.txt =================================================================== --- addons/replicode/CMakeLists.txt +++ addons/replicode/CMakeLists.txt @@ -1,32 +1,24 @@ -project(katereplicodeplugin) - -add_definitions(-DTRANSLATION_DOMAIN=\"kate-replicode-plugin\") - -# Set source variables set(katereplicode_SRCS - replicodeplugin.cpp - replicodeconfigpage.cpp - replicodeconfig.cpp - replicodesettings.cpp - replicodeview.cpp + replicodeplugin.cpp + replicodeconfigpage.cpp + replicodeconfig.cpp + replicodesettings.cpp + replicodeview.cpp + plugin.qrc ) -# Generate files ki18n_wrap_ui(katereplicode_SRCS config.ui) -# resource for ui file and stuff -qt5_add_resources(katereplicode_SRCS plugin.qrc) - add_library(katereplicodeplugin MODULE ${katereplicode_SRCS}) +target_compile_definitions(katereplicodeplugin PRIVATE TRANSLATION_DOMAIN="kate-replicode-plugin") -kcoreaddons_desktop_to_json(katereplicodeplugin katereplicodeplugin.desktop) - -# Link it all together -target_link_libraries(katereplicodeplugin +target_link_libraries( + katereplicodeplugin + PRIVATE KF5::TextEditor KF5::IconThemes KF5::I18n ) -# Install +kcoreaddons_desktop_to_json(katereplicodeplugin katereplicodeplugin.desktop) install(TARGETS katereplicodeplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/rustcompletion/CMakeLists.txt =================================================================== --- addons/rustcompletion/CMakeLists.txt +++ addons/rustcompletion/CMakeLists.txt @@ -1,24 +1,22 @@ -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) - -add_definitions(-DTRANSLATION_DOMAIN=\"kterustcompletion\") - -set(kterustcompletion_SRCS - kterustcompletion.cpp - kterustcompletionconfigpage.cpp - kterustcompletionplugin.cpp - kterustcompletionpluginview.cpp -) - -# resource for ui file and stuff -qt5_add_resources(kterustcompletion_SRCS plugin.qrc) - add_library(kterustcompletionplugin MODULE ${kterustcompletion_SRCS}) +target_compile_definitions(kterustcompletionplugin PRIVATE TRANSLATION_DOMAIN="kterustcompletion") -kcoreaddons_desktop_to_json(kterustcompletionplugin kterustcompletionplugin.desktop) +target_link_libraries( + kterustcompletionplugin + PRIVATE + KF5::TextEditor + KF5::XmlGui +) -target_link_libraries(kterustcompletionplugin - KF5::TextEditor - KF5::XmlGui +target_sources( + kterustcompletionplugin + PRIVATE + kterustcompletion.cpp + kterustcompletionconfigpage.cpp + kterustcompletionplugin.cpp + kterustcompletionpluginview.cpp + plugin.qrc ) +kcoreaddons_desktop_to_json(kterustcompletionplugin kterustcompletionplugin.desktop) install(TARGETS kterustcompletionplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/search/CMakeLists.txt =================================================================== --- addons/search/CMakeLists.txt +++ addons/search/CMakeLists.txt @@ -1,24 +1,25 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"katesearch\") - set(katesearchplugin_PART_SRCS - plugin_search.cpp - search_open_files.cpp - SearchDiskFiles.cpp - FolderFilesList.cpp - replace_matches.cpp - htmldelegate.cpp + plugin_search.cpp + search_open_files.cpp + SearchDiskFiles.cpp + FolderFilesList.cpp + replace_matches.cpp + htmldelegate.cpp + plugin.qrc ) -ki18n_wrap_ui (katesearchplugin_PART_SRCS search.ui results.ui) - -# resource for ui file and stuff -qt5_add_resources(katesearchplugin_PART_SRCS plugin.qrc) +ki18n_wrap_ui(katesearchplugin_PART_SRCS search.ui results.ui) add_library(katesearchplugin MODULE ${katesearchplugin_PART_SRCS}) -kcoreaddons_desktop_to_json (katesearchplugin katesearch.desktop) -target_link_libraries(katesearchplugin +target_compile_definitions(katesearchplugin PRIVATE TRANSLATION_DOMAIN="katesearch") + +target_link_libraries( + katesearchplugin + PRIVATE KF5::TextEditor KF5::Parts KF5::I18n KF5::IconThemes - KF5::ItemViews) + KF5::ItemViews +) +kcoreaddons_desktop_to_json(katesearchplugin katesearch.desktop) install(TARGETS katesearchplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/sessionapplet/CMakeLists.txt =================================================================== --- addons/sessionapplet/CMakeLists.txt +++ addons/sessionapplet/CMakeLists.txt @@ -1,6 +1,2 @@ -project(katesessionapplet) - -add_definitions(-DTRANSLATION_DOMAIN=\"plasma_applet_org.kde.plasma.katesessions\") - plasma_install_package(applet org.kde.plasma.katesessions) add_subdirectory(engine) Index: addons/sessionapplet/engine/CMakeLists.txt =================================================================== --- addons/sessionapplet/engine/CMakeLists.txt +++ addons/sessionapplet/engine/CMakeLists.txt @@ -1,15 +1,26 @@ -# Plasma Data Engine -set(plasma_engine_katesessions_SRCS katesessionsengine.cpp katesessionsmodel.cpp katesessionsjob.cpp katesessionsservice.cpp) add_library(plasma_engine_katesessions MODULE ${plasma_engine_katesessions_SRCS}) -kcoreaddons_desktop_to_json(plasma_engine_katesessions plasma-dataengine-katesessions.desktop) -target_link_libraries(plasma_engine_katesessions - Qt5::Widgets # QAction +target_compile_definitions(plasma_engine_katesessions PRIVATE TRANSLATION_DOMAIN="plasma_applet_org.kde.plasma.katesessions") + +target_link_libraries( + plasma_engine_katesessions + PRIVATE + Qt5::Widgets # QAction KF5::IconThemes KF5::Plasma KF5::Service KF5::I18n ) +target_sources( + plasma_engine_katesessions + PRIVATE + katesessionsengine.cpp + katesessionsmodel.cpp + katesessionsjob.cpp + katesessionsservice.cpp +) + +kcoreaddons_desktop_to_json(plasma_engine_katesessions plasma-dataengine-katesessions.desktop) install(TARGETS plasma_engine_katesessions DESTINATION ${PLUGIN_INSTALL_DIR}/plasma/dataengine) install(FILES plasma-dataengine-katesessions.desktop DESTINATION ${SERVICES_INSTALL_DIR}) install(FILES org.kde.plasma.katesessions.operations DESTINATION ${PLASMA_DATA_INSTALL_DIR}/services) Index: addons/snippets/CMakeLists.txt =================================================================== --- addons/snippets/CMakeLists.txt +++ addons/snippets/CMakeLists.txt @@ -1,34 +1,32 @@ -project (katesnippets) -add_definitions(-DTRANSLATION_DOMAIN=\"katesnippetsplugin\") - -########### next target ############### - -set(katesnippetsplugin_PART_SRCS katesnippets.cpp -katesnippetglobal.cpp -snippetview.cpp -snippetstore.cpp -snippetrepository.cpp -snippetcompletionmodel.cpp -snippetcompletionitem.cpp -snippet.cpp -editrepository.cpp -editsnippet.cpp ) - -ki18n_wrap_ui(katesnippetsplugin_PART_SRCS -snippetview.ui -editrepository.ui -editsnippet.ui) - -# resource for ui file and stuff -qt5_add_resources(katesnippetsplugin_PART_SRCS plugin.qrc) - -add_library (katesnippetsplugin MODULE ${katesnippetsplugin_PART_SRCS}) - -kcoreaddons_desktop_to_json (katesnippetsplugin katesnippetsplugin.desktop) - -target_link_libraries(katesnippetsplugin +set(katesnippetsplugin_PART_SRCS + katesnippets.cpp + katesnippetglobal.cpp + snippetview.cpp + snippetstore.cpp + snippetrepository.cpp + snippetcompletionmodel.cpp + snippetcompletionitem.cpp + snippet.cpp + editrepository.cpp + editsnippet.cpp + plugin.qrc +) + +ki18n_wrap_ui(katesnippetsplugin_PART_SRCS snippetview.ui editrepository.ui editsnippet.ui) + +add_library(katesnippetsplugin MODULE ${katesnippetsplugin_PART_SRCS}) +target_compile_definitions(katesnippetsplugin PRIVATE TRANSLATION_DOMAIN="katesnippetsplugin") + +target_link_libraries( + katesnippetsplugin + PRIVATE KF5::TextEditor - KF5::Parts KF5::I18n - KF5::NewStuff KF5::ItemViews KF5::IconThemes) - -install(TARGETS katesnippetsplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor ) + KF5::Parts + KF5::I18n + KF5::NewStuff + KF5::ItemViews + KF5::IconThemes +) + +kcoreaddons_desktop_to_json(katesnippetsplugin katesnippetsplugin.desktop) +install(TARGETS katesnippetsplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/symbolviewer/CMakeLists.txt =================================================================== --- addons/symbolviewer/CMakeLists.txt +++ addons/symbolviewer/CMakeLists.txt @@ -1,15 +1,30 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"katesymbolviewer\") -########### next target ############### -set(katesymbolviewerplugin_PART_SRCS cpp_parser.cpp tcl_parser.cpp fortran_parser.cpp perl_parser.cpp -php_parser.cpp xslt_parser.cpp xml_parser.cpp ruby_parser.cpp python_parser.cpp bash_parser.cpp ecma_parser.cpp plugin_katesymbolviewer.cpp ) +add_library(katesymbolviewerplugin MODULE "") +target_compile_definitions(katesymbolviewerplugin PRIVATE TRANSLATION_DOMAIN="katesymbolviewer") -# resource for ui file and stuff -qt5_add_resources(katesymbolviewerplugin_PART_SRCS plugin.qrc) +target_link_libraries( + katesymbolviewerplugin + PRIVATE + KF5::TextEditor + KF5::I18n KF5::IconThemes +) -add_library(katesymbolviewerplugin MODULE ${katesymbolviewerplugin_PART_SRCS}) +target_sources( + katesymbolviewerplugin + PRIVATE + cpp_parser.cpp + tcl_parser.cpp + fortran_parser.cpp + perl_parser.cpp + php_parser.cpp + xslt_parser.cpp + xml_parser.cpp + ruby_parser.cpp + python_parser.cpp + bash_parser.cpp + ecma_parser.cpp + plugin_katesymbolviewer.cpp + plugin.qrc +) kcoreaddons_desktop_to_json (katesymbolviewerplugin katesymbolviewerplugin.desktop) - -target_link_libraries(katesymbolviewerplugin KF5::TextEditor KF5::I18n KF5::IconThemes) - install(TARGETS katesymbolviewerplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/tabswitcher/CMakeLists.txt =================================================================== --- addons/tabswitcher/CMakeLists.txt +++ addons/tabswitcher/CMakeLists.txt @@ -1,32 +1,28 @@ -project(tabswitcherplugin) -add_definitions(-DTRANSLATION_DOMAIN=\"tabswitcherplugin\") +add_library (tabswitcherplugin MODULE "") +target_compile_definitions(tabswitcherplugin PRIVATE TRANSLATION_DOMAIN="tabswitcherplugin") -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) - -set(tabswitcherplugin_PART_SRCS - tabswitcher.cpp - tabswitcherfilesmodel.cpp - tabswitchertreeview.cpp -) - -# resource for ui file and stuff -qt5_add_resources(tabswitcherplugin_PART_SRCS plugin.qrc) - -add_library (tabswitcherplugin MODULE ${tabswitcherplugin_PART_SRCS}) - -kcoreaddons_desktop_to_json (tabswitcherplugin tabswitcherplugin.desktop) - -target_link_libraries(tabswitcherplugin +target_link_libraries( + tabswitcherplugin + PRIVATE KF5::TextEditor KF5::IconThemes KF5::I18n KF5::Service ) -install(TARGETS tabswitcherplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) +target_sources( + tabswitcherplugin + PRIVATE + tabswitcher.cpp + tabswitcherfilesmodel.cpp + tabswitchertreeview.cpp + plugin.qrc +) + +kcoreaddons_desktop_to_json(tabswitcherplugin tabswitcherplugin.desktop) +install(TARGETS tabswitcherplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) -############# unit tests ################ -if (BUILD_TESTING) - add_subdirectory(autotests) - add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(autotests) + add_subdirectory(tests) endif() Index: addons/tabswitcher/autotests/CMakeLists.txt =================================================================== --- addons/tabswitcher/autotests/CMakeLists.txt +++ addons/tabswitcher/autotests/CMakeLists.txt @@ -1,11 +1,21 @@ include(ECMMarkAsTest) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR}/.. +add_executable(tabswitcher_test "") +target_include_directories(tabswitcher_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..) + +target_link_libraries( + tabswitcher_test + PRIVATE + kdeinit_kate + Qt5::Test +) + +target_sources( + tabswitcher_test + PRIVATE + tabswitchertest.cpp + ../tabswitcherfilesmodel.cpp ) -set(Src tabswitchertest.cpp ../tabswitcherfilesmodel.cpp) -add_executable(tabswitcher_test ${Src}) add_test(NAME plugin-tabswitcher_test COMMAND tabswitcher_test) -target_link_libraries(tabswitcher_test kdeinit_kate Qt5::Test) ecm_mark_as_test(tabswitcher_test) Index: addons/tabswitcher/tests/CMakeLists.txt =================================================================== --- addons/tabswitcher/tests/CMakeLists.txt +++ addons/tabswitcher/tests/CMakeLists.txt @@ -1,3 +1,13 @@ -# small test for the tabswitches -add_executable(tstestapp tstestapp.cpp ../tabswitcherfilesmodel.cpp) -target_link_libraries(tstestapp KF5::TextEditor) +add_executable(tstestapp "") + +target_link_libraries( + tstestapp + PRIVATE KF5::TextEditor +) + +target_sources( + tstestapp + PRIVATE + tstestapp.cpp + ../tabswitcherfilesmodel.cpp +) Index: addons/textfilter/CMakeLists.txt =================================================================== --- addons/textfilter/CMakeLists.txt +++ addons/textfilter/CMakeLists.txt @@ -1,26 +1,21 @@ -project(textfilterplugin) -add_definitions(-DTRANSLATION_DOMAIN=\"katetextfilter\") - -include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) - set(textfilterplugin_PART_SRCS - plugin_katetextfilter.cpp + plugin_katetextfilter.cpp + plugin.qrc ) ki18n_wrap_ui(textfilterplugin_PART_SRCS textfilterwidget.ui) -# resource for ui file and stuff -qt5_add_resources(textfilterplugin_PART_SRCS plugin.qrc) - -add_library (textfilterplugin MODULE ${textfilterplugin_PART_SRCS}) - -kcoreaddons_desktop_to_json (textfilterplugin textfilterplugin.desktop) +add_library(textfilterplugin MODULE ${textfilterplugin_PART_SRCS}) +target_compile_definitions(textfilterplugin PRIVATE TRANSLATION_DOMAIN="katetextfilter") -target_link_libraries(textfilterplugin +target_link_libraries( + textfilterplugin + PRIVATE KF5::TextEditor KF5::IconThemes KF5::I18n KF5::Service ) -install(TARGETS textfilterplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) +kcoreaddons_desktop_to_json(textfilterplugin textfilterplugin.desktop) +install(TARGETS textfilterplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/xmlcheck/CMakeLists.txt =================================================================== --- addons/xmlcheck/CMakeLists.txt +++ addons/xmlcheck/CMakeLists.txt @@ -1,22 +1,14 @@ -project(katexmlcheckplugin) # what is this? -add_definitions(-DTRANSLATION_DOMAIN=\"katexmlcheck\") - -# Maybe remove these later // I just copied this from xmltools example remove_definitions(-DQT_NO_CAST_TO_ASCII) remove_definitions(-DQT_NO_CAST_FROM_ASCII) remove_definitions(-DQT_NO_URL_CAST_FROM_STRING) remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY) - -set(katexmlcheckplugin_PART_SRCS - plugin_katexmlcheck.cpp -) - -# resource for ui file and stuff -qt5_add_resources(katexmlcheckplugin_PART_SRCS plugin.qrc) - add_library(katexmlcheckplugin MODULE ${katexmlcheckplugin_PART_SRCS}) -target_link_libraries(katexmlcheckplugin +target_compile_definitions(katexmlcheckplugin PRIVATE TRANSLATION_DOMAIN="katexmlcheck") + +target_link_libraries( + katexmlcheckplugin + PRIVATE KF5::TextEditor KF5::Parts KF5::IconThemes @@ -24,8 +16,12 @@ KF5::Service ) -# this did not changed -install(TARGETS katexmlcheckplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor ) +target_sources( + katexmlcheckplugin + PRIVATE + plugin_katexmlcheck.cpp + plugin.qrc +) -# It is to generate json -kcoreaddons_desktop_to_json (katexmlcheckplugin katexmlcheck.desktop) +kcoreaddons_desktop_to_json(katexmlcheckplugin katexmlcheck.desktop) +install(TARGETS katexmlcheckplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) Index: addons/xmltools/CMakeLists.txt =================================================================== --- addons/xmltools/CMakeLists.txt +++ addons/xmltools/CMakeLists.txt @@ -1,23 +1,14 @@ -project(katexmltoolsplugin) -add_definitions(-DTRANSLATION_DOMAIN=\"katexmltools\") - -# Maybe remove these later remove_definitions(-DQT_NO_CAST_TO_ASCII) remove_definitions(-DQT_NO_CAST_FROM_ASCII) remove_definitions(-DQT_NO_URL_CAST_FROM_STRING) remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY) -set(katexmltoolsplugin_PART_SRCS - pseudo_dtd.cpp - plugin_katexmltools.cpp -) - -# resource for ui file and stuff -qt5_add_resources(katexmltoolsplugin_PART_SRCS plugin.qrc) - add_library(katexmltoolsplugin MODULE ${katexmltoolsplugin_PART_SRCS}) +target_compile_definitions(katexmltoolsplugin PRIVATE TRANSLATION_DOMAIN="katexmltools") -target_link_libraries(katexmltoolsplugin +target_link_libraries( + katexmltoolsplugin + PRIVATE KF5::TextEditor KF5::Parts KF5::IconThemes @@ -25,11 +16,30 @@ KF5::Service ) -########### install files ############### -install(TARGETS katexmltoolsplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor ) -install( FILES html4-loose.dtd.xml html4-strict.dtd.xml kde-docbook.dtd.xml simplify_dtd.xsl - xhtml1-frameset.dtd.xml xhtml1-strict.dtd.xml xhtml1-transitional.dtd.xml xslt-1.0.dtd.xml - testcases.xml language.dtd.xml kpartgui.dtd.xml kcfg.dtd.xml - DESTINATION ${DATA_INSTALL_DIR}/katexmltools ) +target_sources( + katexmltoolsplugin + PRIVATE + pseudo_dtd.cpp + plugin_katexmltools.cpp + plugin.qrc +) -kcoreaddons_desktop_to_json (katexmltoolsplugin katexmltools.desktop) +kcoreaddons_desktop_to_json(katexmltoolsplugin katexmltools.desktop) +install(TARGETS katexmltoolsplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor) + +install( + FILES + html4-loose.dtd.xml + html4-strict.dtd.xml + kde-docbook.dtd.xml + simplify_dtd.xsl + xhtml1-frameset.dtd.xml + xhtml1-strict.dtd.xml + xhtml1-transitional.dtd.xml + xslt-1.0.dtd.xml + testcases.xml + language.dtd.xml + kpartgui.dtd.xml + kcfg.dtd.xml + DESTINATION ${DATA_INSTALL_DIR}/katexmltools +) Index: config.h.cmake =================================================================== --- config.h.cmake +++ config.h.cmake @@ -5,7 +5,6 @@ #define KATE_VERSION "${KDE_APPLICATIONS_VERSION}" -#cmakedefine HAVE_CTERMID 1 #cmakedefine KActivities_FOUND 1 #endif