Commit 4bc9c6b1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6

parent 23baa544
Pipeline #155624 passed with stage
in 2 minutes and 44 seconds
......@@ -8,7 +8,7 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
project(kio-extras VERSION ${RELEASE_SERVICE_VERSION})
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.89.0")
set(KF5_MIN_VERSION "5.90.0")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
......@@ -28,15 +28,15 @@ include(CheckIncludeFile)
include(CMakePackageConfigHelpers)
include(FeatureSummary)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS DBus Network Widgets Svg)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS DBus Network Widgets Svg)
find_package(Qt5Test ${QT_MIN_VERSION} CONFIG QUIET)
set_package_properties(Qt5Test PROPERTIES
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} CONFIG QUIET)
set_package_properties(Qt${QT_MAJOR_VERSION}Test PROPERTIES
PURPOSE "Required for tests"
TYPE OPTIONAL
)
add_feature_info("Qt5Test" Qt5Test_FOUND "Required for building tests")
if (NOT Qt5Test_FOUND)
add_feature_info("Qt${QT_MAJOR_VERSION}Test" Qt${QT_MAJOR_VERSION}Test_FOUND "Required for building tests")
if (NOT Qt${QT_MAJOR_VERSION}Test_FOUND)
set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
endif()
......@@ -66,8 +66,8 @@ set_package_properties(KF5Activities PROPERTIES
TYPE OPTIONAL
)
find_package(Qt5Sql QUIET)
set_package_properties(Qt5Sql PROPERTIES
find_package(Qt${QT_MAJOR_VERSION}Sql QUIET)
set_package_properties(Qt${QT_MAJOR_VERSION}Sql PROPERTIES
PURPOSE "Provides the activities:/ kioslave and fileitem plugin."
TYPE OPTIONAL
)
......@@ -78,8 +78,8 @@ set_package_properties(KF5ActivitiesStats PROPERTIES
TYPE OPTIONAL
)
find_package(Phonon4Qt5 4.6.60 NO_MODULE)
set_package_properties(Phonon4Qt5 PROPERTIES
find_package(Phonon4Qt${QT_MAJOR_VERSION} 4.6.60 NO_MODULE)
set_package_properties(Phonon4Qt${QT_MAJOR_VERSION} PROPERTIES
DESCRIPTION "Qt-based audio library"
PURPOSE "Required for the audio preview plugin"
TYPE OPTIONAL)
......@@ -167,7 +167,7 @@ add_definitions(
add_subdirectory( doc )
add_subdirectory( about )
if(TARGET KF5::Activities AND TARGET Qt5::Sql AND NOT WIN32)
if(TARGET KF5::Activities AND TARGET Qt::Sql AND NOT WIN32)
add_subdirectory( activities )
endif()
if(KF5ActivitiesStats_FOUND)
......@@ -175,7 +175,7 @@ if(KF5ActivitiesStats_FOUND)
endif()
add_subdirectory( bookmarks )
add_subdirectory( filter )
if(Phonon4Qt5_FOUND)
if(Phonon4Qt${QT_MAJOR_VERSION}_FOUND)
add_subdirectory( kfileaudiopreview )
endif()
add_subdirectory( info )
......
......@@ -7,7 +7,7 @@ target_sources(kio_about PRIVATE kio_about.cpp)
target_link_libraries(kio_about
KF5::KIOCore
Qt5::Network
Qt::Network
)
install(TARGETS kio_about DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio )
install(TARGETS kio_about DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/kio )
......@@ -27,15 +27,15 @@ target_sources(kio_activities PRIVATE
target_link_libraries (
kio_activities
Qt5::Sql
Qt::Sql
KF5::KIOCore
KF5::DBusAddons
KF5::Activities
KF5::I18n
Qt5::Network
Qt::Network
)
install (
TARGETS kio_activities
DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio
DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/kio
)
......@@ -10,8 +10,8 @@ target_sources(kactivitymanagerd_fileitem_linking_plugin PRIVATE
target_link_libraries (
kactivitymanagerd_fileitem_linking_plugin
Qt5::Core
Qt5::Sql
Qt::Core
Qt::Sql
KF5::KIOFileWidgets
KF5::I18n
KF5::Activities
......@@ -19,5 +19,5 @@ target_link_libraries (
install (
TARGETS kactivitymanagerd_fileitem_linking_plugin
DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kfileitemaction
DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/kfileitemaction
)
......@@ -36,7 +36,7 @@ install(EXPORT KioArchiveTargets
install(FILES
kio_archivebase.h
${CMAKE_CURRENT_BINARY_DIR}/libkioarchive_export.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}
COMPONENT Devel
)
......@@ -67,8 +67,8 @@ target_link_libraries(kioarchive
KF5::KIOCore
PRIVATE
KF5::I18n
Qt5::Network
Qt5::DBus
Qt::Network
Qt::DBus
)
set_target_properties(kioarchive PROPERTIES
......@@ -82,6 +82,6 @@ install(TARGETS kioarchive EXPORT KioArchiveTargets LIBRARY NAMELINK_SKIP ${KF5_
############### Archive KIOslave ######################
add_library(kio_archive MODULE kio_archive.cpp ${kio_archive_debug_SRCS})
target_link_libraries(kio_archive KF5::KIOCore KF5::Archive kioarchive Qt5::Network)
target_link_libraries(kio_archive KF5::KIOCore KF5::Archive kioarchive Qt::Network)
set_target_properties(kio_archive PROPERTIES OUTPUT_NAME "archive")
install(TARGETS kio_archive DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio)
install(TARGETS kio_archive DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/kio)
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
add_executable(testkioarchive testkioarchive.cpp)
target_link_libraries(testkioarchive KF5::KIOCore KF5::Archive Qt5::Test)
target_link_libraries(testkioarchive KF5::KIOCore KF5::Archive Qt::Test)
ecm_mark_as_test(testkioarchive)
add_test(NAME testkioarchive COMMAND testkioarchive)
......@@ -15,6 +15,6 @@ target_sources(kio_bookmarks PRIVATE
target_link_libraries(kio_bookmarks KF5::KIOCore KF5::I18n KF5::Bookmarks KF5::Solid KF5::GuiAddons KF5::KIOFileWidgets)
install(TARGETS kio_bookmarks DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio)
install(TARGETS kio_bookmarks DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/kio)
install( FILES kio_bookmarks.css DESTINATION ${KDE_INSTALL_DATADIR}/kio_bookmarks )
kcoreaddons_add_plugin(kio_filenamesearch INSTALL_NAMESPACE "kf5/kio")
target_link_libraries(kio_filenamesearch KF5::KIOCore KF5::DBusAddons Qt5::Network KF5::KIOCore KF5::I18n)
target_link_libraries(kio_filenamesearch KF5::KIOCore KF5::DBusAddons Qt::Network KF5::KIOCore KF5::I18n)
target_sources(kio_filenamesearch PRIVATE kio_filenamesearch.cpp)
ecm_qt_declare_logging_category(kio_filenamesearch
......
......@@ -17,6 +17,6 @@ ecm_qt_declare_logging_category(kio_filter
EXPORT KIO_EXTRAS
)
target_link_libraries(kio_filter KF5::Archive KF5::KIOCore Qt5::Network)
target_link_libraries(kio_filter KF5::Archive KF5::KIOCore Qt::Network)
install(TARGETS kio_filter DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio)
......@@ -65,7 +65,7 @@ if (MD5SUM_EXECUTABLE)
EXPORT KIO_EXTRAS
)
target_link_libraries(kio_fish KF5::KIOCore KF5::WidgetsAddons KF5::I18n Qt5::Network)
target_link_libraries(kio_fish KF5::KIOCore KF5::WidgetsAddons KF5::I18n Qt::Network)
if (UTIL_LIBRARIES)
target_link_libraries(kio_fish ${UTIL_LIBRARIES})
......
......@@ -6,7 +6,7 @@ add_library(kio_info MODULE info.cpp)
target_link_libraries(kio_info
KF5::I18n
KF5::KIOCore
Qt5::Network
Qt::Network
)
set_target_properties(kio_info PROPERTIES OUTPUT_NAME "info")
......
......@@ -25,7 +25,7 @@ endif()
# intermediate target/library, also used by the tests
add_library(kio_man_debug OBJECT)
target_link_libraries(kio_man_debug
PRIVATE Qt5::Core
PRIVATE Qt::Core
)
ecm_qt_declare_logging_category(kio_man_debug
HEADER kio_man_debug.h
......@@ -57,7 +57,7 @@ if (AVOID_NULLPTR_WARNING_FLAG)
endif()
target_link_libraries(kio_man
PRIVATE KF5::KIOCore Qt5::Widgets KF5::Archive KF5::I18n KF5::Codecs Qt5::Network kio_man_debug
PRIVATE KF5::KIOCore Qt::Widgets KF5::Archive KF5::I18n KF5::Codecs Qt::Network kio_man_debug
)
install(TARGETS kio_man DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio)
......@@ -20,7 +20,7 @@ target_sources(kio_man_test PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../kio_man.cpp
)
target_link_libraries(kio_man_test Qt5::Widgets KF5::I18n KF5::KIOCore KF5::Archive KF5::Codecs Qt5::Network kio_man_debug)
target_link_libraries(kio_man_test Qt::Widgets KF5::I18n KF5::KIOCore KF5::Archive KF5::Codecs Qt::Network kio_man_debug)
if (AVOID_NULLPTR_WARNING_FLAG)
target_compile_options(kio_man_test PRIVATE ${AVOID_NULLPTR_WARNING_FLAG})
endif()
......@@ -44,7 +44,7 @@ target_sources(man2html PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../man2html.cpp
)
target_link_libraries(man2html Qt5::Core KF5::Codecs KF5::Archive kio_man_debug)
target_link_libraries(man2html Qt::Core KF5::Codecs KF5::Archive kio_man_debug)
if (AVOID_NULLPTR_WARNING_FLAG)
target_compile_options(man2html PRIVATE ${AVOID_NULLPTR_WARNING_FLAG})
endif()
......@@ -13,7 +13,7 @@ target_sources(kio_mtp PRIVATE
)
target_include_directories(kio_mtp PRIVATE shared)
target_link_libraries(kio_mtp kmtp Qt5::Core KF5::KIOCore KF5::I18n KF5::DBusAddons)
target_link_libraries(kio_mtp kmtp Qt::Core KF5::KIOCore KF5::I18n KF5::DBusAddons)
ecm_qt_declare_logging_category(kio_mtp
HEADER kio_mtp_debug.h
......
......@@ -4,9 +4,9 @@ set(kiod_kmtpd_SRCS
mtpstorage.cpp
)
qt5_add_dbus_adaptor(kiod_kmtpd_SRCS ../shared/org.kde.kmtp.daemon.xml kmtpd.h KMTPd)
qt5_add_dbus_adaptor(kiod_kmtpd_SRCS ../shared/org.kde.kmtp.device.xml mtpdevice.h MTPDevice)
qt5_add_dbus_adaptor(kiod_kmtpd_SRCS ../shared/org.kde.kmtp.storage.xml mtpstorage.h MTPStorage)
qt_add_dbus_adaptor(kiod_kmtpd_SRCS ../shared/org.kde.kmtp.daemon.xml kmtpd.h KMTPd)
qt_add_dbus_adaptor(kiod_kmtpd_SRCS ../shared/org.kde.kmtp.device.xml mtpdevice.h MTPDevice)
qt_add_dbus_adaptor(kiod_kmtpd_SRCS ../shared/org.kde.kmtp.storage.xml mtpstorage.h MTPStorage)
kcoreaddons_add_plugin(kmtpd INSTALL_NAMESPACE "kf5/kiod" SOURCES ${kiod_kmtpd_SRCS})
......@@ -16,7 +16,7 @@ target_link_libraries(kmtpd
KF5::DBusAddons
KF5::Solid
KF5::KIOCore
Qt5::Core
Qt::Core
Libmtp::Libmtp
)
......@@ -29,4 +29,4 @@ ecm_qt_declare_logging_category(kmtpd
EXPORT KIO_EXTRAS
)
kdbusaddons_generate_dbus_service_file(kiod5 org.kde.kmtpd5 ${KDE_INSTALL_FULL_LIBEXECDIR_KF5})
kdbusaddons_generate_dbus_service_file(kiod5 org.kde.kmtpd5 ${KDE_INSTALL_FULL_LIBEXECDIR_KF})
......@@ -5,7 +5,7 @@ set_source_files_properties(org.kde.kmtp.storage.xml PROPERTIES
)
set(kmtp_dbus_SRCS)
qt5_add_dbus_interfaces(kmtp_dbus_SRCS
qt_add_dbus_interfaces(kmtp_dbus_SRCS
org.kde.kmtp.daemon.xml
org.kde.kmtp.device.xml
org.kde.kmtp.storage.xml
......@@ -19,4 +19,4 @@ target_sources(kmtp PRIVATE
${kmtp_dbus_SRCS}
)
target_link_libraries(kmtp Qt5::Core Qt5::DBus)
target_link_libraries(kmtp Qt::Core Qt::DBus)
......@@ -55,7 +55,7 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kio5_nfs\")
include_directories(${TIRPC_INCLUDE_DIRS})
add_library(kio_nfs MODULE kio_nfs.cpp nfsv2.cpp nfsv3.cpp rpc_nfs3_prot_xdr.c rpc_nfs2_prot_xdr.c)
target_link_libraries(kio_nfs KF5::KIOCore KF5::I18n Qt5::Network ${TIRPC_LIBRARIES})
target_link_libraries(kio_nfs KF5::KIOCore KF5::I18n Qt::Network ${TIRPC_LIBRARIES})
set_target_properties(kio_nfs PROPERTIES OUTPUT_NAME "nfs")
if(AVOID_UNUSED_VARIABLE_WARNING_FLAG)
......
......@@ -3,7 +3,7 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kio5_recentdocuments\")
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
add_library(kio_recentdocuments MODULE recentdocuments.cpp)
target_link_libraries(kio_recentdocuments KF5::KIOCore KF5::I18n KF5::ConfigCore Qt5::DBus Qt5::Network)
target_link_libraries(kio_recentdocuments KF5::KIOCore KF5::I18n KF5::ConfigCore Qt::DBus Qt::Network)
set_target_properties(kio_recentdocuments PROPERTIES OUTPUT_NAME "recentdocuments")
install(TARGETS kio_recentdocuments DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio)
......
......@@ -36,7 +36,7 @@ target_link_libraries(kio_sftp
KF5::KIOCore
KF5::WidgetsAddons # KMessageBox
KF5::I18n
Qt5::Network
Qt::Network
ssh)
install(TARGETS kio_sftp DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio)
......@@ -83,7 +83,7 @@ target_link_libraries(kio_smb_static
KF5::I18n
KF5::ConfigCore
${SAMBA_LIBRARIES}
Qt5::Network
Qt::Network
KF5::DNSSD
KDSoap::WSDiscoveryClient
Threads::Threads # std::async
......
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