Commit db634094 authored by Christoph Cullmann's avatar Christoph Cullmann

Merge branch 'main-cmake-cleanup' into 'master'

Main CMake scripts cleanup

See merge request !4
parents 65ae3c28 a167b312
# 3.1 is required for `target_sources`.
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
# Kate project
project (kate)
project(kate)
set (QT_MIN_VERSION "5.4.0")
set(QT_MIN_VERSION "5.4.0")
set(KF5_DEP_VERSION "5.40.0")
# KDE Application Version, managed by release script
set (KDE_APPLICATIONS_VERSION_MAJOR "19")
set (KDE_APPLICATIONS_VERSION_MINOR "11")
set (KDE_APPLICATIONS_VERSION_MICRO "70")
set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
# KDE Applications version, managed by release script.
set(KDE_APPLICATIONS_VERSION_MAJOR "19")
set(KDE_APPLICATIONS_VERSION_MINOR "11")
set(KDE_APPLICATIONS_VERSION_MICRO "70")
set(KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
# we need some parts of the ECM CMake helpers
find_package (ECM ${KF5_DEP_VERSION} REQUIRED NO_MODULE)
set (CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMOptionalAddSubdirectory)
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMMarkNonGuiExecutable)
include(ECMGenerateHeaders)
include(ECMAddAppIcon)
include(GenerateExportHeader)
include(CMakePackageConfigHelpers)
include(FeatureSummary)
include(WriteBasicConfigVersionFile)
include (CheckFunctionExists)
include(KDEInstallDirs)
include(KDECMakeSettings)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core DBus Widgets Sql)
if(BUILD_TESTING)
find_package(Qt5Test ${QT_MIN_VERSION} CONFIG REQUIRED)
endif()
# We need some parts of the ECM CMake helpers.
find_package(ECM ${KF5_DEP_VERSION} QUIET REQUIRED NO_MODULE)
# Load the frameworks we need
find_package(KF5 "${KF5_DEP_VERSION}" REQUIRED COMPONENTS
Config
Crash
I18n
JobWidgets
KIO
Parts
TextEditor
WindowSystem
XmlGui
IconThemes
)
# some optional deps, to make compiling on some OSes easier
find_package(KF5 "${KF5_DEP_VERSION}" COMPONENTS
Activities
DocTools
)
if (KF5Activities_FOUND)
add_definitions(-DKActivities_FOUND)
endif ()
# 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})
# We append to the module path so modules can be overriden from the command line.
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
# 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)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDEInstallDirs)
include(KDECMakeSettings)
# kate application
ecm_optional_add_subdirectory (kate)
include(ECMOptionalAddSubdirectory)
include(ECMAddAppIcon)
include(ECMInstallIcons)
# addons, e.g. kate plugins, plasma applets, ...
ecm_optional_add_subdirectory (addons)
include(FeatureSummary)
# docs, if doc tools around
if (KF5DocTools_FOUND)
ecm_optional_add_subdirectory (doc)
endif ()
ecm_optional_add_subdirectory(addons)
ecm_optional_add_subdirectory(kwrite)
ecm_optional_add_subdirectory(kate)
ecm_optional_add_subdirectory(doc)
# tell about our features (and what is missing)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
feature_summary(INCLUDE_QUIET_PACKAGES WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -2,8 +2,8 @@ add_library(katebacktracebrowserplugin MODULE "")
target_compile_definitions(katebacktracebrowserplugin PRIVATE TRANSLATION_DOMAIN="katebacktracebrowserplugin")
target_link_libraries(katebacktracebrowserplugin PRIVATE KF5::TextEditor)
ki18n_wrap_ui(UI_SRCS btbrowserwidget.ui btconfigwidget.ui)
target_sources(katebacktracebrowserplugin PRIVATE ${UI_SRCS})
ki18n_wrap_ui(UI_SOURCES btbrowserwidget.ui btconfigwidget.ui)
target_sources(katebacktracebrowserplugin PRIVATE ${UI_SOURCES})
target_sources(
katebacktracebrowserplugin
......
# docs
ecm_optional_add_subdirectory( kate )
ecm_optional_add_subdirectory( katepart )
ecm_optional_add_subdirectory( kwrite )
find_package(KF5DocTools QUIET)
if(NOT KF5DocTools_FOUND)
return()
endif()
ecm_optional_add_subdirectory(kate)
ecm_optional_add_subdirectory(katepart)
ecm_optional_add_subdirectory(kwrite)
########### install files ###############
kdoctools_create_handbook(
index.docbook
INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en
SUBDIR kate
)
kdoctools_create_handbook (index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kate)
kdoctools_create_manpage (man-kate.1.docbook 1 INSTALL_DESTINATION ${MAN_INSTALL_DIR})
kdoctools_create_manpage(
man-kate.1.docbook 1
INSTALL_DESTINATION ${MAN_INSTALL_DIR}
)
########### install files ###############
#
#
kdoctools_create_handbook (index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR katepart)
kdoctools_create_handbook(
index.docbook
INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en
SUBDIR katepart
)
########### install files ###############
kdoctools_create_handbook (index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kwrite)
kdoctools_create_handbook(
index.docbook
INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en
SUBDIR kwrite
)
#
# The Kate Application
#
project(kate)
# Load the frameworks we need
find_package(KF5 REQUIRED COMPONENTS DBusAddons GuiAddons)
# includes
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/session
${CMAKE_CURRENT_SOURCE_DIR}/qtsingleapplication
)
# We use an intermediate static library because linking tests directly to an executable is not
# possible with CMake yet.
add_library(kate STATIC "")
configure_file(config.h.in config.h)
# collect the needed source files
set (KATE_LIBRARY_SRCS
kateappadaptor.cpp
kateapp.cpp
kateconfigdialog.cpp
kateconfigplugindialogpage.cpp
katedocmanager.cpp
katefileactions.cpp
katemainwindow.cpp
katepluginmanager.cpp
kateviewmanager.cpp
kateviewspace.cpp
katesavemodifieddialog.cpp
katemwmodonhddialog.cpp
katecolorschemechooser.cpp
katequickopenmodel.cpp
katetabbutton.cpp
katetabbar.cpp
# session
session/katesessionsaction.cpp
session/katesessionmanager.cpp
session/katesessionmanagedialog.cpp
session/katesession.cpp
katemdi.cpp
katerunninginstanceinfo.cpp
katequickopen.cpp
katewaiter.h
include(GenerateExportHeader)
generate_export_header(
kate
EXPORT_FILE_NAME katetests_export.h
EXPORT_MACRO_NAME KATE_TESTS_EXPORT
)
ki18n_wrap_ui(KATE_LIBRARY_SRCS
ui/sessionconfigwidget.ui
session/katesessionmanagedialog.ui
target_include_directories(
kate
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/session
${CMAKE_CURRENT_SOURCE_DIR}/qtsingleapplication
${CMAKE_CURRENT_BINARY_DIR} # katetests_export.h + config.h
)
qt5_add_resources( KATE_LIBRARY_SRCS data/kate.qrc )
find_package(
KF5
QUIET
REQUIRED
COMPONENTS
TextEditor
IconThemes
WindowSystem
DBusAddons
Crash
OPTIONAL_COMPONENTS
Activities
)
add_library(kdeinit_kate STATIC ${KATE_LIBRARY_SRCS})
target_link_libraries(kdeinit_kate
PUBLIC
target_link_libraries(
kate
PUBLIC
KF5::TextEditor
KF5::I18n
KF5::IconThemes
KF5::WindowSystem
KF5::GuiAddons
KF5::WindowSystem
KF5::DBusAddons
KF5::Crash)
KF5::Crash
)
if(KF5Activities_FOUND)
target_link_libraries(kdeinit_kate
PUBLIC
KF5::Activities)
target_link_libraries(kate PUBLIC KF5::Activities)
endif()
generate_export_header(kdeinit_kate
EXPORT_FILE_NAME kateprivate_export.h
EXPORT_MACRO_NAME KATE_TESTS_EXPORT
)
# collect icons
set(KATE_ICONS_PNG
${CMAKE_CURRENT_SOURCE_DIR}/icons/16-apps-kate.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/22-apps-kate.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/32-apps-kate.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/48-apps-kate.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/64-apps-kate.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/128-apps-kate.png
)
ki18n_wrap_ui(UI_SOURCES ui/sessionconfigwidget.ui session/katesessionmanagedialog.ui)
target_sources(kate PRIVATE ${UI_SOURCES})
set(KATE_ICONS_SVG
${CMAKE_CURRENT_SOURCE_DIR}/icons/sc-apps-kate.svgz
set(ICONS_PNG
${CMAKE_CURRENT_SOURCE_DIR}/icons/16-apps-kate.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/22-apps-kate.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/32-apps-kate.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/48-apps-kate.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/64-apps-kate.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/128-apps-kate.png
)
# application only sources
set (KATE_APP_SRCS
main.cpp
set(ICONS_SVG ${CMAKE_CURRENT_SOURCE_DIR}/icons/sc-apps-kate.svgz)
# Add icon files to the application's source files to have CMake bundle them in the executable.
ecm_add_app_icon(ICONS_SOURCES ICONS ${ICONS_PNG})
target_sources(kate PRIVATE ${ICONS_SOURCES})
target_sources(
kate
PRIVATE
data/kate.qrc
session/katesession.cpp
session/katesessionmanagedialog.cpp
session/katesessionmanager.cpp
session/katesessionsaction.cpp
kateapp.cpp
kateappadaptor.cpp
katecolorschemechooser.cpp
kateconfigdialog.cpp
kateconfigplugindialogpage.cpp
katedocmanager.cpp
katefileactions.cpp
katemainwindow.cpp
katemdi.cpp
katemwmodonhddialog.cpp
katepluginmanager.cpp
katequickopen.cpp
katequickopenmodel.cpp
katerunninginstanceinfo.cpp
katesavemodifieddialog.cpp
katetabbar.cpp
katetabbutton.cpp
kateviewmanager.cpp
kateviewspace.cpp
katewaiter.cpp
)
# use single application instead of dbus on mac + windows
if (APPLE OR WIN32)
set(singleapp_SRCS
qtsingleapplication/qtlocalpeer.cpp
qtsingleapplication/qtsingleapplication.cpp
qtsingleapplication/qtlockedfile.cpp
)
if(WIN32)
set(singleapp_SRCS ${singleapp_SRCS} qtsingleapplication/qtlockedfile_win.cpp)
else()
set(singleapp_SRCS ${singleapp_SRCS} qtsingleapplication/qtlockedfile_unix.cpp)
endif()
add_definitions("-DUSE_QT_SINGLE_APP")
set(KATE_APP_SRCS ${KATE_APP_SRCS} ${singleapp_SRCS})
# Use a single application on MacOS + Windows instead of dbus.
if(APPLE OR WIN32)
target_compile_definitions(kate PRIVATE USE_QT_SINGLE_APP)
target_sources(
kate
PRIVATE
qtsingleapplication/qtlocalpeer.cpp
qtsingleapplication/qtsingleapplication.cpp
qtsingleapplication/qtlockedfile.cpp
)
if(WIN32)
target_sources(kate PRIVATE qtsingleapplication/qtlockedfile_win.cpp)
else()
target_sources(kate PRIVATE qtsingleapplication/qtlockedfile_unix.cpp)
endif()
endif()
# add icons to application sources, to have them bundled
ecm_add_app_icon(KATE_APP_SRCS ICONS ${KATE_ICONS_PNG})
# Executable only adds the main definition.
add_executable(kate-bin main.cpp)
target_link_libraries(kate-bin PRIVATE kate)
# create executable
add_executable(kate ${KATE_APP_SRCS})
target_link_libraries(kate kdeinit_kate)
set_property(
TARGET kate-bin
PROPERTY OUTPUT_NAME kate
)
# own plist magic for mac os
# See https://cmake.org/cmake/help/v3.15/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.html
if(APPLE)
# own plist template
set_target_properties (kate PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/data/MacOSXBundleInfo.plist.in)
# the MacOSX bundle display name property (CFBundleDisplayName) is not currently supported by cmake,
# so has to be set for all targets in this cmake file
set(MACOSX_BUNDLE_DISPLAY_NAME Kate)
set_target_properties(kate PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "org.kde.Kate")
set_target_properties(kate PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Kate")
set_target_properties(kate PROPERTIES MACOSX_BUNDLE_DISPLAY_NAME "Kate")
set_target_properties(kate PROPERTIES MACOSX_BUNDLE_INFO_STRING "Kate - Advanced Text Editor")
set_target_properties(kate PROPERTIES MACOSX_BUNDLE_LONG_VERSION_STRING "Kate ${KDE_APPLICATIONS_VERSION}")
set_target_properties(kate PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}")
set_target_properties(kate PROPERTIES MACOSX_BUNDLE_BUNDLE_VERSION "${KDE_APPLICATIONS_VERSION}")
set_target_properties(kate PROPERTIES MACOSX_BUNDLE_COPYRIGHT "2000-2016 The Kate Authors")
set_property(
TARGET kate-bin
PROPERTY MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/data/MacOSXBundleInfo.plist.in
)
# These are substituted by CMake into plist.in.
set(MACOSX_BUNDLE_DISPLAY_NAME "Kate")
set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.kde.Kate")
set(MACOSX_BUNDLE_BUNDLE_NAME "Kate")
set(MACOSX_BUNDLE_DISPLAY_NAME "Kate")
set(MACOSX_BUNDLE_INFO_STRING "Kate - Advanced Text Editor")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "Kate ${KDE_APPLICATIONS_VERSION}")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "${KDE_APPLICATIONS_VERSION}")
set(MACOSX_BUNDLE_COPYRIGHT "2000-2016 The Kate Authors")
endif()
# install executable
install(TARGETS kate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS kate-bin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
# desktop file
install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/data/org.kde.kate.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
ecm_install_icons(
ICONS ${ICONS_PNG} ${ICONS_SVG}
DESTINATION ${ICON_INSTALL_DIR}
THEME hicolor
)
# appdata
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.kde.kate.appdata.xml DESTINATION ${CMAKE_INSTALL_METAINFODIR})
install(
PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/data/org.kde.kate.desktop
DESTINATION ${XDG_APPS_INSTALL_DIR}
)
# install icons
ecm_install_icons(ICONS ${KATE_ICONS_PNG} ${KATE_ICONS_SVG} DESTINATION ${ICON_INSTALL_DIR} THEME hicolor)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.kde.kate.appdata.xml
DESTINATION ${CMAKE_INSTALL_METAINFODIR}
)
# automatic unit tests
if (BUILD_TESTING)
add_subdirectory(autotests)
if(BUILD_TESTING)
add_subdirectory(autotests)
endif()
include(ECMMarkAsTest)
find_package(Qt5Test QUIET REQUIRED)
macro(kate_executable_tests)
foreach(_testname ${ARGN})
add_executable(${_testname} ${_testname}.cpp)
target_link_libraries(
${_testname}
PRIVATE
kate
Qt5::Test
)
add_test(NAME kateapp-${_testname} COMMAND ${_testname})
target_link_libraries(${_testname} kdeinit_kate Qt5::Test)
ecm_mark_as_test(${_testname})
endforeach(_testname)
endmacro(kate_executable_tests)
endforeach()
endmacro()
kate_executable_tests(
session_test
......
......@@ -5,6 +5,6 @@
#define KATE_VERSION "${KDE_APPLICATIONS_VERSION}"
#cmakedefine KActivities_FOUND 1
#cmakedefine KF5Activities_FOUND
#endif
......@@ -23,7 +23,7 @@
#include <ktexteditor/application.h>
#include "kateprivate_export.h"
#include "katetests_export.h"
#include "katemainwindow.h"
#include "katedocmanager.h"
#include "katepluginmanager.h"
......
......@@ -18,8 +18,6 @@
Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include "katepluginmanager.h"
#include "kateapp.h"
......
......@@ -21,6 +21,7 @@
//BEGIN Includes
#include "kateviewmanager.h"
#include "config.h"
#include "kateapp.h"
#include "katemainwindow.h"
#include "kateviewspace.h"
......@@ -39,9 +40,7 @@
#include <KLocalizedString>
#include <KXMLGUIFactory>
#include <config.h>
#ifdef KActivities_FOUND
#ifdef KF5Activities_FOUND
#include <KActivities/ResourceInstance>
#endif
......@@ -457,7 +456,7 @@ KTextEditor::View *KateViewManager::createView(KTextEditor::Document *doc, KateV
m_views[view].active = false;
m_views[view].lruAge = m_minAge--;
#ifdef KActivities_FOUND
#ifdef KF5Activities_FOUND
m_views[view].activityResource = new KActivities::ResourceInstance(view->window()->winId(), view);
m_views[view].activityResource->setUri(doc->url());
#endif
......@@ -649,7 +648,7 @@ void KateViewManager::activateView(KTextEditor::View *view)
emit viewChanged(view);
#ifdef KActivities_FOUND
#ifdef KF5Activities_FOUND
// inform activity manager
m_views[view].activityResource->setUri(view->document()->url());
m_views[view].activityResource->notifyFocusedIn();
......
......@@ -28,8 +28,6 @@
#include <QSplitter>
#include <QMap>
#include <config.h>
namespace KActivities
{
class ResourceInstance;
......
/* This file is part of the KDE project
Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
Copyright (C) 2001, 2005 Anders Lund <anders.lund@lund.tdcadsl.dk>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "katewaiter.h"
KateWaiter::KateWaiter(const QString &service, const QStringList &tokens)
: QObject(QCoreApplication::instance())
, m_tokens(tokens)
, m_watcher(service, QDBusConnection::sessionBus())
{
connect(&m_watcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &KateWaiter::serviceOwnerChanged);
}
void KateWaiter::exiting()
{
QCoreApplication::instance()->quit();
}
void KateWaiter::documentClosed(const QString &token)
{
m_tokens.removeAll(token);
if (m_tokens.count() == 0) {
QCoreApplication::instance()->quit();
}
}
void KateWaiter::serviceOwnerChanged(const QString &, const QString &, const QString &)
{
QCoreApplication::instance()->quit();
}
\ No newline at end of file
......@@ -32,32 +32,14 @@ class KateWaiter : public QObject
Q_OBJECT
public:
KateWaiter(const QString &service, const QStringList &tokens)
: QObject(QCoreApplication::instance())
, m_tokens(tokens)
, m_watcher(service, QDBusConnection::sessionBus())
{
connect(&m_watcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &KateWaiter::serviceOwnerChanged);
}
KateWaiter(const QString &service, const QStringList &tokens);
public Q_SLOTS:
void exiting()
{
QCoreApplication::instance()->quit();
}
void exiting();
void documentClosed(const QString &token)
{
m_tokens.removeAll(token);
if (m_tokens.count() == 0) {
QCoreApplication::instance()->quit();
}
}
void documentClosed(const QString &token);
void serviceOwnerChanged(const QString &, const QString &, const QString &)
{
QCoreApplication::instance()->quit();
}
void serviceOwnerChanged(const QString &, const QString &, const QString &);
private:
QStringList m_tokens;
......
......@@ -21,10 +21,11 @@
#ifndef __KATE_SESSION_H__
#define __KATE_SESSION_H__
#include "katetests_export.h"
#include <QExplicitlySharedDataPointer>
#include <QString>
#include <QDateTime>
#include "kateprivate_export.h"
class KConfig;
......
......@@ -18,8 +18,6 @@
* Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include "katesessionmanager.h"
#include "katesessionmanagedialog.h"
......
......@@ -21,7 +21,7 @@
#ifndef __KATE_SESSIONS_ACTION_H__
#define __KATE_SESSIONS_ACTION_H__
#include "kateprivate_export.h"
#include "katetests_export.h"
#include <KActionMenu>
class KateSessionManager;
......
# KWrite
project (kwrite)
add_executable(kwrite "")
# Load the frameworks we need
find_package(KF5 REQUIRED COMPONENTS DBusAddons)
configure_file(config.h.in config.h)
target_include_directories(kwrite PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) # config.h
# collect icons
set(KWRITE_ICONS_PNG
${CMAKE_CURRENT_SOURCE_DIR}/icons/16-apps-kwrite.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/22-apps-kwrite.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/32-apps-kwrite.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/48-apps-kwrite.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/64-apps-kwrite.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/128-apps-kwrite.png
find_package(
KF5
QUIET
REQUIRED
COMPONENTS
TextEditor
DBusAddons
Crash
OPTIONAL_COMPONENTS
Activities
)
set(KWRITE_ICONS_SVG
${CMAKE_CURRENT_SOURCE_DIR}/icons/sc-apps-kwrite.svgz
target_link_libraries(
kwrite
PUBLIC
KF5::TextEditor
KF5::DBusAddons
KF5::Crash
)
# collect the sources
set (KWRITE_APPLICATION_SRCS main.cpp kwrite.cpp kwriteapplication.cpp)
qt5_add_resources(KWRITE_APPLICATION_SRCS data/kwrite.qrc)
# add icons to application sources, to have them bundled
ecm_add_app_icon(KWRITE_APPLICATION_SRCS ICONS ${KWRITE_ICONS_PNG})
if(KF5Activities_FOUND)
target_link_libraries(kwrite PUBLIC KF5::Activities)
endif()
# build KWrite application
add_executable(kwrite ${KWRITE_APPLICATION_SRCS})
target_link_libraries(kwrite
PUBLIC
KF5::TextEditor
KF5::I18n
KF5::DBusAddons
KF5::Crash
set(ICONS_PNG
${CMAKE_CURRENT_SOURCE_DIR}/icons/16-apps-kwrite.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/22-apps-kwrite.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/32-apps-kwrite.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/48-apps-kwrite.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/64-apps-kwrite.png
${CMAKE_CURRENT_SOURCE_DIR}/icons/128-apps-kwrite.png
)
if(KF5Activities_FOUND)
target_link_libraries(kwrite
PUBLIC
KF5::Activities)