Commit dca6a697 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

more work to have one shared library

parent e3985a77
kate_add_plugin(compilerexplorer)
target_compile_definitions(compilerexplorer PRIVATE TRANSLATION_DOMAIN="compilerexplorer")
target_link_libraries(compilerexplorer PRIVATE kateshared KF5::I18n KF5::TextEditor)
target_link_libraries(compilerexplorer PRIVATE kateprivate KF5::I18n KF5::TextEditor)
target_sources(
compilerexplorer
......
......@@ -17,6 +17,7 @@ target_link_libraries(externaltoolsplugin PRIVATE
KF5::IconThemes
KF5::TextEditor
KF5::I18n
kateprivate
)
ki18n_wrap_ui(externaltoolsplugin configwidget.ui
......@@ -36,12 +37,6 @@ target_sources(
plugin.qrc
)
target_include_directories(
externaltoolsplugin
PUBLIC
${CMAKE_SOURCE_DIR}/shared
)
if (BUILD_TESTING)
add_subdirectory(autotests)
endif()
kate_add_plugin(kategitblameplugin)
target_compile_definitions(kategitblameplugin PRIVATE TRANSLATION_DOMAIN="kategitblameplugin")
target_link_libraries(kategitblameplugin PRIVATE kateshared KF5::I18n KF5::TextEditor)
target_link_libraries(kategitblameplugin PRIVATE kateprivate KF5::I18n KF5::TextEditor)
target_sources(
kategitblameplugin
......
kate_add_plugin(katebuildplugin)
target_compile_definitions(katebuildplugin PRIVATE TRANSLATION_DOMAIN="katebuild-plugin")
target_link_libraries(katebuildplugin PRIVATE KF5::I18n KF5::TextEditor)
target_link_libraries(katebuildplugin PRIVATE KF5::I18n KF5::TextEditor kateprivate)
ki18n_wrap_ui(katebuildplugin build.ui)
......@@ -15,9 +15,3 @@ target_sources(
TargetFilterProxyModel.cpp
plugin.qrc
)
target_include_directories(
katebuildplugin
PUBLIC
${CMAKE_SOURCE_DIR}/shared
)
......@@ -4,7 +4,7 @@ target_compile_definitions(lspclientplugin PRIVATE TRANSLATION_DOMAIN="lspclient
target_link_libraries(
lspclientplugin
PRIVATE
kateshared
kateprivate
)
include(ECMQtDeclareLoggingCategory)
......
......@@ -20,7 +20,7 @@ target_compile_definitions(kateprojectplugin PRIVATE TRANSLATION_DOMAIN="katepro
target_link_libraries(
kateprojectplugin
PRIVATE
kateshared
kateprivate
Qt::Concurrent
KF5::GuiAddons
KF5::I18n
......
......@@ -16,12 +16,7 @@ target_link_libraries(
KF5::I18n
KF5::ItemViews
KF5::TextEditor
)
target_include_directories(
katesearchplugin
PUBLIC
${CMAKE_SOURCE_DIR}/shared
kateprivate
)
ki18n_wrap_ui(katesearchplugin search.ui results.ui MatchExportDialog.ui)
......
# Kate executable, just main.cpp & resource file & our large shared part in the static library
add_executable(kate-bin main.cpp data/kate.qrc)
target_link_libraries(kate-bin PRIVATE kate-lib)
# Kate application
add_executable(kate-bin
main.cpp
data/kate.qrc
katewaiter.cpp
# single application handing for the non-dbus case
SingleApplication/singleapplication.cpp
SingleApplication/singleapplication_p.cpp)
target_link_libraries(kate-bin PRIVATE kateprivate)
# ensure consistent SingleApplication usage
target_compile_definitions(kate-bin PUBLIC -DQAPPLICATION_CLASS=QApplication)
# we have different windows icons, less margins
set(ICONS_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/icons/unix)
......
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/kxmlgui5/kate">
<file alias="kateui.rc">../../lib/data/kateui.rc</file>
<file alias="kateui.rc">../../../lib/data/kateui.rc</file>
</qresource>
<qresource prefix="/kate">
<file alias="kate.svg">../icons/unix/sc-apps-kate.svg</file>
<file alias="mascot.png">../../lib/data/mascot.png</file>
<file alias="mascot.png">../../../lib/data/mascot.png</file>
</qresource>
</RCC>
# KWrite executable, just main.cpp & resource file & our large shared part in the static library
# KWrite application
add_executable(kwrite main.cpp data/kwrite.qrc)
target_link_libraries(kwrite PRIVATE kate-lib)
target_link_libraries(kwrite PRIVATE kateprivate)
# application icon, in all sizes needed to have e.g. nice Windows icons, too
set(ICONS_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/icons)
......
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/kxmlgui5/kwrite">
<file alias="kateui.rc">../../lib/data/kateui.rc</file>
<file alias="kateui.rc">../../../lib/data/kateui.rc</file>
</qresource>
<qresource prefix="/kwrite">
<file alias="kwrite.svg">../icons/sc-apps-kwrite.svg</file>
<file alias="mascot.png">../../lib/data/mascot.png</file>
<file alias="mascot.png">../../../lib/data/mascot.png</file>
</qresource>
</RCC>
# We use an intermediate static library because linking tests directly to an executable is not
# possible with CMake yet.
add_library(kate-lib STATIC "")
# Kate shared library, used by Kate/KWrite and the addons
add_library(kateprivate SHARED "")
set_target_properties(kateprivate PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
install(TARGETS kateprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
configure_file(config.h.in config.h)
include(GenerateExportHeader)
generate_export_header(
kate-lib
kateprivate
EXPORT_FILE_NAME katetests_export.h
EXPORT_MACRO_NAME KATE_TESTS_EXPORT
EXPORT_MACRO_NAME KATE_PRIVATE_EXPORT
)
target_include_directories(
kate-lib
kateprivate
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/session
......@@ -34,7 +35,7 @@ find_package(
)
target_link_libraries(
kate-lib
kateprivate
PUBLIC
KF5::I18n
KF5::TextEditor
......@@ -42,24 +43,23 @@ target_link_libraries(
KF5::DBusAddons
KF5::Crash
KF5::TextWidgets
kateshared
)
if(KF5Activities_FOUND)
target_link_libraries(kate-lib PUBLIC KF5::Activities)
target_link_libraries(kateprivate PUBLIC KF5::Activities)
endif()
# optional KUserFeedback integration
find_package(KUserFeedback)
if (TARGET KUserFeedbackWidgets)
target_link_libraries(kate-lib PUBLIC KUserFeedbackWidgets)
target_compile_definitions(kate-lib PUBLIC -DWITH_KUSERFEEDBACK)
target_link_libraries(kateprivate PUBLIC KUserFeedbackWidgets)
target_compile_definitions(kateprivate PUBLIC -DWITH_KUSERFEEDBACK)
endif()
ki18n_wrap_ui(kate-lib ui/sessionconfigwidget.ui session/katesessionmanagedialog.ui)
ki18n_wrap_ui(kateprivate ui/sessionconfigwidget.ui session/katesessionmanagedialog.ui)
target_sources(
kate-lib
kateprivate
PRIVATE
session/katesession.cpp
session/katesessionmanagedialog.cpp
......@@ -87,7 +87,6 @@ target_sources(
katesplitter.cpp
kateviewmanager.cpp
kateviewspace.cpp
katewaiter.cpp
tabmimedata.cpp
kateoutputview.cpp
......@@ -96,15 +95,10 @@ target_sources(
kateurlbar.cpp
signal_watcher.cpp
# single application handing for the non-dbus case
SingleApplication/singleapplication.cpp
SingleApplication/singleapplication_p.cpp
gitprocess.cpp
quickdialog.cpp
)
# ensure consistent SingleApplication usage
target_compile_definitions(kate-lib PUBLIC -DQAPPLICATION_CLASS=QApplication)
if(BUILD_TESTING)
add_subdirectory(autotests)
endif()
Supports Markdown
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