2015-01-05 19:23:09 +03:00
|
|
|
project(dolphin-owncloud)
|
|
|
|
|
2021-08-25 13:20:31 +03:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2021-04-06 13:06:35 +03:00
|
|
|
|
2023-12-27 21:21:21 +03:00
|
|
|
if(KF6KIO_FOUND)
|
|
|
|
set(QT_MAJOR_VERSION "6")
|
|
|
|
set(QT_MIN_VERSION "6.6.0")
|
|
|
|
set(KF_MIN_VERSION "5.240.0")
|
|
|
|
else()
|
|
|
|
set(QT_MAJOR_VERSION "5")
|
|
|
|
set(QT_MIN_VERSION "5.15.0")
|
|
|
|
set(KF_MIN_VERSION "5.16.0")
|
|
|
|
endif()
|
|
|
|
|
2018-02-03 12:53:35 +03:00
|
|
|
set(KDE_INSTALL_USE_QT_SYS_PATHS ON CACHE BOOL "Install the plugin in the right directory")
|
2015-09-07 21:59:30 +03:00
|
|
|
|
2023-12-27 21:21:21 +03:00
|
|
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Network)
|
2015-01-05 19:23:09 +03:00
|
|
|
|
2023-12-27 21:21:21 +03:00
|
|
|
find_package(ECM ${KF_MIN_VERSION} REQUIRED CONFIG)
|
2021-04-06 13:06:35 +03:00
|
|
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
|
2015-01-05 19:23:09 +03:00
|
|
|
|
2023-12-27 21:21:21 +03:00
|
|
|
find_package(KF${QT_MAJOR_VERSION} ${KF_MIN_VERSION} REQUIRED COMPONENTS CoreAddons KIO)
|
2015-09-07 21:59:30 +03:00
|
|
|
|
2018-12-28 16:55:45 +03:00
|
|
|
set(KDE_INSTALL_DIRS_NO_DEPRECATED TRUE)
|
2015-01-05 19:23:09 +03:00
|
|
|
include(KDEInstallDirs)
|
2023-12-27 21:21:21 +03:00
|
|
|
# Before KF${QT_MAJOR_VERSION} 5.54, kcoreaddons_add_plugin uses deprecated VAR PLUGIN_INSTALL_DIR
|
2018-12-28 16:55:45 +03:00
|
|
|
# when that is fixed and you want to remove this workaround,
|
|
|
|
# you need to _require_ the new enough kcoreaddons
|
|
|
|
set(PLUGIN_INSTALL_DIR "${KDE_INSTALL_PLUGINDIR}")
|
2015-01-05 19:23:09 +03:00
|
|
|
include(KDECMakeSettings)
|
|
|
|
include(KDECompilerSettings)
|
|
|
|
|
|
|
|
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
|
|
|
|
|
2015-10-19 16:22:27 +03:00
|
|
|
#---HELPER---
|
2016-04-13 16:05:04 +03:00
|
|
|
set(OWNCLOUDDOLPHINHELPER ${APPLICATION_EXECUTABLE}dolphinpluginhelper)
|
2022-02-07 15:48:52 +03:00
|
|
|
add_library(${OWNCLOUDDOLPHINHELPER} SHARED
|
|
|
|
ownclouddolphinpluginhelper.h
|
|
|
|
ownclouddolphinpluginhelper.cpp)
|
2023-12-27 21:21:21 +03:00
|
|
|
target_link_libraries(${OWNCLOUDDOLPHINHELPER} Qt${QT_MAJOR_VERSION}::Network)
|
2016-05-04 15:19:18 +03:00
|
|
|
generate_export_header(${OWNCLOUDDOLPHINHELPER} BASE_NAME ownclouddolphinpluginhelper)
|
2016-04-13 16:05:04 +03:00
|
|
|
install(TARGETS ${OWNCLOUDDOLPHINHELPER} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
2015-10-19 16:22:27 +03:00
|
|
|
|
|
|
|
#---OVERLAY PLUGIN---
|
2016-04-13 16:05:04 +03:00
|
|
|
set(OWNCLOUDDOLPHINOVERLAYPLUGIN ${APPLICATION_EXECUTABLE}dolphinoverlayplugin)
|
2023-12-27 21:21:21 +03:00
|
|
|
if(KF6KIO_FOUND)
|
|
|
|
kcoreaddons_add_plugin(${OWNCLOUDDOLPHINOVERLAYPLUGIN} INSTALL_NAMESPACE "kf${QT_MAJOR_VERSION}/overlayicon"
|
|
|
|
SOURCES ownclouddolphinoverlayplugin.cpp)
|
|
|
|
else()
|
|
|
|
kcoreaddons_add_plugin(${OWNCLOUDDOLPHINOVERLAYPLUGIN} INSTALL_NAMESPACE "kf${QT_MAJOR_VERSION}/overlayicon"
|
|
|
|
JSON ownclouddolphinoverlayplugin.json SOURCES ownclouddolphinoverlayplugin.cpp)
|
|
|
|
endif()
|
|
|
|
target_link_libraries(${OWNCLOUDDOLPHINOVERLAYPLUGIN} KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::KIOCore KF${QT_MAJOR_VERSION}::KIOWidgets ${OWNCLOUDDOLPHINHELPER})
|
2015-10-19 16:22:27 +03:00
|
|
|
|
|
|
|
#---ACTION PLUGIN---
|
2016-04-13 16:05:04 +03:00
|
|
|
set(OWNCLOUDDOLPHINACTIONPLUGIN ${APPLICATION_EXECUTABLE}dolphinactionplugin)
|
2023-12-27 21:14:40 +03:00
|
|
|
configure_file(ownclouddolphinactionplugin.json.in ${OWNCLOUDDOLPHINACTIONPLUGIN}.json ESCAPE_QUOTES @ONLY)
|
2023-12-27 21:21:21 +03:00
|
|
|
kcoreaddons_add_plugin(${OWNCLOUDDOLPHINACTIONPLUGIN} INSTALL_NAMESPACE "kf${QT_MAJOR_VERSION}/kfileitemaction"
|
2022-11-19 20:59:17 +03:00
|
|
|
SOURCES ownclouddolphinactionplugin.cpp)
|
2023-12-27 21:21:21 +03:00
|
|
|
target_link_libraries(${OWNCLOUDDOLPHINACTIONPLUGIN} KF${QT_MAJOR_VERSION}::CoreAddons KF${QT_MAJOR_VERSION}::KIOCore KF${QT_MAJOR_VERSION}::KIOWidgets ${OWNCLOUDDOLPHINHELPER})
|