Commit 12beef19 authored by Christoph Cullmann's avatar Christoph Cullmann

initial quick and dirty ktexteditor compilation on KF5

parent ff0e8496
# Kate project
project (kate)
# shared libs
set (LIBRARY_TYPE SHARED)
# minimal cmake req
cmake_minimum_required (VERSION 2.8.6 FATAL_ERROR)
# minimal qt req
set (QT_MIN_VERSION "5.2.0")
# search packages used by KDE
find_package(KDE4 4.8.0 REQUIRED)
include (KDE4Defaults)
include (MacroLibrary)
include (CheckFunctionExists)
# activity feature for Kate/KWrite
macro_optional_find_package(KActivities 6.1.0 NO_MODULE)
macro_log_feature(KActivities_FOUND "KActivities" "Activities interface library" "https://projects.kde.org/projects/kde/kdelibs/kactivities" FALSE "6.1.0" "Required for Activities integration.")
# KDE reqs
find_package(ECM 0.0.8 REQUIRED NO_MODULE)
include(CMakePackageConfigHelpers)
include(FeatureSummary)
include(WriteBasicConfigVersionFile)
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(ECMMarkNonGuiExecutable)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
include(ECMOptionalAddSubdirectory)
include(ECMInstallIcons)
find_package(Qt5Core REQUIRED NO_MODULE)
find_package(Qt5DBus REQUIRED NO_MODULE)
find_package(Qt5Quick REQUIRED NO_MODULE)
find_package(Qt5Widgets REQUIRED NO_MODULE)
# Load the frameworks we need
find_package(KF5 CONFIG REQUIRED
KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver
KConfig KAuth KJS KWallet KDBusAddons Sonnet
KI18n KGuiAddons KService KConfigWidgets ItemViews KNotifications KIconThemes KStyle KCompletion KJobWidgets KTextWidgets XmlGui KCrash
KBookmarks KUnitConversion KIO KCMUtils Kross KParts KNotifyConfig KPrintUtils KDESu KDocTools KNewStuff )
# no in source builds
macro_ensure_out_of_source_build("kate requires an out of source build. Please create a separate build directory and run 'cmake path_to_kate [options]' there.")
find_package(KDeclarative REQUIRED NO_MODULE)
find_package(KIO REQUIRED NO_MODULE)
find_package(KInit)
# needed for set_package_properties macro
find_package(KDE4Support REQUIRED NO_MODULE)
find_package(KDELibs4 REQUIRED NO_MODULE)
find_package(Qt5Transitional MODULE)
# config.h
if(NOT APPLE)
......@@ -33,43 +65,31 @@ add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions (-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DKTEXTEDITOR_NO_DEPRECATED)
# global include directories
include_directories (${CMAKE_CURRENT_BINARY_DIR} ${KDE4_INCLUDES} ${KDE4_KIO_INCLUDES} ${KACTIVITIES_INCLUDE_DIRS})
# allow to build own ktexteditor
option(BUILD_KTEXTEDITOR "Build KTextEditor interfaces, instead of reusing the system version" OFF)
if (BUILD_KTEXTEDITOR)
# use our own copies of some stuff
set (KDE4_KTEXTEDITOR_LIBS "ktexteditor")
# add more includes to let the local ktexteditor stuff be found
include_directories (BEFORE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/includes)
# ktexteditor interfaces, copy from kdelibs/interfaces/ktexteditor
macro_optional_add_subdirectory (ktexteditor)
else()
# kdelibs 4.11 is required
if("${KDE_VERSION}" VERSION_LESS 4.10.60)
message(FATAL_ERROR "kdelibs version ${KDE_VERSION}, but 4.11 is required. Set the option BUILD_KTEXTEDITOR to ON to build anyway.")
endif()
endif (BUILD_KTEXTEDITOR)
include_directories (${CMAKE_CURRENT_BINARY_DIR})
# use our own copies of some stuff
set (KDE4_KTEXTEDITOR_LIBS "ktexteditor")
# add more includes to let the local ktexteditor stuff be found
include_directories (BEFORE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/includes)
# ktexteditor interfaces, copy from kdelibs/interfaces/ktexteditor
ecm_optional_add_subdirectory (ktexteditor)
# kate part
macro_optional_add_subdirectory (part)
#macro_optional_add_subdirectory (part)
# kate application
macro_optional_add_subdirectory (kate)
#macro_optional_add_subdirectory (kate)
# kwrite
macro_optional_add_subdirectory (kwrite)
#macro_optional_add_subdirectory (kwrite)
# addons, e.g. ktexteditor plugins, kate plugins, plasma applets, ...
macro_optional_add_subdirectory (addons)
#macro_optional_add_subdirectory (addons)
# docs
macro_optional_add_subdirectory (doc)
#macro_optional_add_subdirectory (doc)
# tests
macro_optional_add_subdirectory (tests)
# display features ;)
macro_display_feature_log()
#macro_optional_add_subdirectory (tests)
include_directories( ${KDE4_KPARTS_INCLUDES} )
########### next target ###############
set(ktexteditor_LIB_SRCS
ktexteditor.cpp
document.cpp
range.cpp
cursor.cpp
templateinterface.cpp
templateinterface2.cpp
editorchooser.cpp
attribute.cpp
cursorfeedback.cpp
rangefeedback.cpp
smartcursor.cpp
smartrange.cpp
codecompletioninterface.cpp
codecompletionmodel.cpp
codecompletionmodelcontrollerinterface.cpp
configinterface.cpp
smartinterface.cpp
highlightinterface.cpp
movinginterface.cpp
movingcursor.cpp
movingrange.cpp
movingrangefeedback.cpp
messageinterface.cpp
)
kde4_add_ui_files(ktexteditor_LIB_SRCS editorchooser_ui.ui )
kde4_add_library(ktexteditor ${LIBRARY_TYPE} ${ktexteditor_LIB_SRCS})
target_link_libraries(ktexteditor ${KDE4_KDECORE_LIBS} ${QT_QTDBUS_LIBRARY} ${KDE4_KPARTS_LIBS} )
target_link_libraries(ktexteditor LINK_INTERFACE_LIBRARIES ${KDE4_KPARTS_LIBS} )
set_target_properties(ktexteditor
PROPERTIES VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION}
)
install(TARGETS ktexteditor EXPORT kdelibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
install( FILES
# KTextEditor interface header
set(KTEXTEDITOR_PUBLIC_HEADERS
ktexteditor_export.h
factory.h
editor.h
......@@ -88,6 +44,57 @@ install( FILES
movingrangefeedback.h
recoveryinterface.h
messageinterface.h
)
# KTextEditor interface sources
set(ktexteditor_LIB_SRCS
ktexteditor.cpp
document.cpp
range.cpp
cursor.cpp
templateinterface.cpp
templateinterface2.cpp
editorchooser.cpp
attribute.cpp
cursorfeedback.cpp
rangefeedback.cpp
smartcursor.cpp
smartrange.cpp
codecompletioninterface.cpp
codecompletionmodel.cpp
codecompletionmodelcontrollerinterface.cpp
configinterface.cpp
smartinterface.cpp
highlightinterface.cpp
movinginterface.cpp
movingcursor.cpp
movingrange.cpp
movingrangefeedback.cpp
messageinterface.cpp
# private headers for moc
documentadaptor_p.h
)
kde4_add_ui_files(ktexteditor_LIB_SRCS editorchooser_ui.ui )
add_library (ktexteditor SHARED ${ktexteditor_LIB_SRCS} ${KTEXTEDITOR_PUBLIC_HEADERS})
target_link_libraries(ktexteditor
KF5::KParts
KF5::KDE4Support
)
set_target_properties(ktexteditor
PROPERTIES VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION}
)
install(TARGETS ktexteditor EXPORT kdelibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
install( FILES ${KTEXTEDITOR_PUBLIC_HEADERS}
DESTINATION ${INCLUDE_INSTALL_DIR}/ktexteditor COMPONENT Devel)
install( FILES ktexteditor.desktop ktexteditorplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
......
......@@ -20,7 +20,7 @@
#ifndef KDELIBS_KTEXTEDITOR_ATTRIBUTE_H
#define KDELIBS_KTEXTEDITOR_ATTRIBUTE_H
#include <QtGui/QTextFormat>
#include <QTextFormat>
#include <ksharedptr.h>
#include <ktexteditor/ktexteditor_export.h>
......
......@@ -54,7 +54,7 @@ QModelIndex CodeCompletionModel::index( int row, int column, const QModelIndex &
if (row < 0 || row >= d->rowCount || column < 0 || column >= ColumnCount || parent.isValid())
return QModelIndex();
return createIndex(row, column, 0);
return createIndex(row, column, (void *)0);
}
QMap< int, QVariant > CodeCompletionModel::itemData( const QModelIndex & index ) const
......
......@@ -23,7 +23,7 @@
#include <ktexteditor/ktexteditor_export.h>
#include <QtGui/QWidget>
#include <QWidget>
namespace KTextEditor
{
......
......@@ -76,6 +76,4 @@ void SmartCursorWatcher::deleted( SmartCursor * )
{
}
#include "smartcursornotifier.moc"
// kate: space-indent on; indent-width 2; replace-tabs on;
......@@ -22,7 +22,6 @@
#include "document.moc"
#include "documentadaptor_p.h"
#include "documentadaptor_p.moc"
using namespace KTextEditor;
......
......@@ -19,10 +19,10 @@
#include <editorchooser.h>
#include <editorchooser.moc>
#include <QtGui/QComboBox>
#include <QComboBox>
#include <QtCore/QStringList>
#include <QtGui/QLabel>
#include <QtGui/QLayout>
#include <QLabel>
#include <QLayout>
#include <kmimetypetrader.h>
#include <kconfig.h>
......@@ -132,7 +132,7 @@ KTextEditor::Editor *EditorChooser::editor(const QString& postfix,
KService::Ptr serv = KService::serviceByDesktopName(editor);
if (serv)
{
KTextEditor::Editor *tmpEd = KTextEditor::editor(serv->library().toLatin1());
KTextEditor::Editor *tmpEd = KTextEditor::editor(serv->library().toLatin1().data());
if (tmpEd) return tmpEd;
}
if (fallBackToKatePart)
......
......@@ -23,7 +23,7 @@
#include <ktexteditor/document.h>
#include <ktexteditor/editor.h>
#include <QtGui/QWidget>
#include <QWidget>
class KConfig;
class QString;
......
......@@ -19,24 +19,21 @@
#include <QtDBus/QtDBus>
#include <KGlobal>
#include "cursor.h"
#include "configpage.h"
#include "configpage.moc"
#include "factory.h"
#include "factory.moc"
#include "editor.h"
#include "editor.moc"
#include "document.h"
#include "view.h"
#include "view.moc"
#include "plugin.h"
#include "plugin.moc"
#include "recoveryinterface.h"
#include "commandinterface.h"
......@@ -50,10 +47,8 @@
#include "containerinterface.h"
#include "annotationinterface.h"
#include "annotationinterface.moc"
#include "loadsavefiltercheckplugin.h"
#include "loadsavefiltercheckplugin.moc"
#include "modeinterface.h"
......
......@@ -23,8 +23,8 @@
#include <QtCore/QObject>
#include <QtCore/QList>
#include <QtGui/QAction>
#include <QtGui/QIcon>
#include <QAction>
#include <QIcon>
#include <ktexteditor/ktexteditor_export.h>
......
......@@ -107,6 +107,4 @@ void SmartRangeWatcher::parentRangeChanged( SmartRange *, SmartRange *, SmartRan
{
}
#include "smartrangenotifier.moc"
// kate: space-indent on; indent-width 2; replace-tabs on;
......@@ -28,6 +28,7 @@
#include <kcalendarsystem.h>
#include <unistd.h>
#include <klibrary.h>
#include <KLocalizedString>
#include <kdebug.h>
......
......@@ -21,7 +21,7 @@
#include <QtCore/QString>
#include <QtCore/QMap>
#include <QtGui/QImage>
#include <QImage>
#include <ktexteditor/ktexteditor_export.h>
#include <ktexteditor/cursor.h>
......
......@@ -21,7 +21,7 @@
#include <QtCore/QString>
#include <QtCore/QMap>
#include <QtGui/QImage>
#include <QImage>
#include <ktexteditor/ktexteditor_export.h>
#include <ktexteditor/cursor.h>
......
......@@ -27,7 +27,7 @@
#include <kxmlguiclient.h>
// widget
#include <QtGui/QWidget>
#include <QWidget>
class QMenu;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment