Commit 0caacad3 authored by Dominik Haumann's avatar Dominik Haumann

External Tools: Fix CMakeLists.txt files

parent eb7556ba
find_package(KF5TextEditor QUIET REQUIRED)
if(KF5TextEditor_VERSION VERSION_LESS 5.57.0) if(KF5TextEditor_VERSION VERSION_LESS 5.57.0)
return() return()
endif() endif()
project(externaltoolsplugin) find_package(KF5I18n QUIET REQUIRED)
add_definitions(-DTRANSLATION_DOMAIN=\"kateexternaltoolsplugin\") if(NOT KF5I18n_Found)
return()
endif()
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
set(externaltoolsplugin_PART_SRCS find_package(KF5IconThemes QUIET)
externaltoolsplugin.cpp set_package_properties(KF5IconThemes PROPERTIES PURPOSE "Required to build the externaltools addon")
kateexternaltoolsview.cpp
katetoolrunner.cpp
kateexternaltool.cpp
kateexternaltoolscommand.cpp
kateexternaltoolsconfigwidget.cpp
)
# resource for ui file and stuff if(NOT KF5IconThemes_FOUND)
qt5_add_resources(externaltoolsplugin_PART_SRCS plugin.qrc) return()
endif()
set(externaltoolsplugin_PART_UI find_package(Qt5Test QUIET REQUIRED)
configwidget.ui
tooldialog.ui
toolview.ui
)
ki18n_wrap_ui(externaltoolsplugin_PART_SRCS ${externaltoolsplugin_PART_UI} )
add_library(externaltoolsplugin MODULE ${externaltoolsplugin_PART_SRCS})
# we compile in the .desktop file add_library(externaltoolsplugin MODULE "")
kcoreaddons_desktop_to_json (externaltoolsplugin externaltoolsplugin.desktop) target_compile_definitions(externaltoolsplugin PRIVATE TRANSLATION_DOMAIN="kateexternaltoolsplugin")
target_link_libraries(externaltoolsplugin PRIVATE
target_link_libraries(externaltoolsplugin
KF5::CoreAddons KF5::CoreAddons
KF5::IconThemes KF5::IconThemes
KF5::TextEditor KF5::TextEditor
KF5::I18n KF5::I18n
) )
########### install files ############### ki18n_wrap_ui(UI_SOURCES configwidget.ui
tooldialog.ui
toolview.ui
)
target_sources(
externaltoolsplugin
PRIVATE
externaltoolsplugin.cpp
kateexternaltoolsview.cpp
katetoolrunner.cpp
kateexternaltool.cpp
kateexternaltoolscommand.cpp
kateexternaltoolsconfigwidget.cpp
plugin.qrc
${UI_SOURCES}
)
kcoreaddons_desktop_to_json (externaltoolsplugin externaltoolsplugin.desktop)
install(TARGETS externaltoolsplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor ) install(TARGETS externaltoolsplugin DESTINATION ${PLUGIN_INSTALL_DIR}/ktexteditor )
############# unit tests ################
if (BUILD_TESTING) if (BUILD_TESTING)
add_subdirectory(autotests) add_subdirectory(autotests)
endif() endif()
include(ECMMarkAsTest) include(ECMMarkAsTest)
find_package(KF5Config QUIET) # KConfig, KConfigGroup
if(NOT KF5Config_FOUND)
return()
endif()
find_package(KF5CoreAddons QUIET) # KShell
if(NOT KF5CoreAddons_FOUND)
return()
endif()
# Project Plugin # Project Plugin
add_executable(externaltools_test add_executable(externaltools_test
externaltooltest.cpp externaltooltest.cpp
...@@ -7,5 +17,5 @@ add_executable(externaltools_test ...@@ -7,5 +17,5 @@ add_executable(externaltools_test
../katetoolrunner.cpp ../katetoolrunner.cpp
) )
add_test(plugin-externaltools_test externaltools_test) add_test(plugin-externaltools_test externaltools_test)
target_link_libraries(externaltools_test kdeinit_kate Qt5::Test) target_link_libraries(externaltools_test kdeinit_kate Qt5::Test KF5::ConfigCore KF5::CoreAddons)
ecm_mark_as_test(externaltools_test) ecm_mark_as_test(externaltools_test)
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