Commit 22c9ddda authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6

parent 15401d20
......@@ -10,7 +10,7 @@ set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_
project(kate VERSION ${RELEASE_SERVICE_VERSION})
set(QT_MIN_VERSION "5.15.2")
set(KF5_DEP_VERSION "5.83.0")
set(KF5_DEP_VERSION "5.90.0")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
......@@ -22,7 +22,7 @@ find_package(ECM ${KF5_DEP_VERSION} QUIET REQUIRED NO_MODULE)
# We append to the module path so modules can be overridden from the command line.
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEClangFormat)
......@@ -38,7 +38,7 @@ include(FeatureSummary)
add_definitions(-DQT_NO_FOREACH)
# Required here so that the version comparison below works
find_package(Qt5Widgets ${QT_MIN_VERSION} CONFIG REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Widgets ${QT_MIN_VERSION} CONFIG REQUIRED)
# Required here so that the ki18n_install/kdoctools_install calls injected by
# the release scripts work.
......
......@@ -3,12 +3,12 @@ include(ECMMarkAsTest)
add_executable(btbrowser_test "")
target_include_directories(btbrowser_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
find_package(Qt5Test ${QT_MIN_VERSION} QUIET REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} QUIET REQUIRED)
target_link_libraries(
btbrowser_test
PRIVATE
Qt5::Widgets
Qt5::Test
Qt::Widgets
Qt::Test
)
target_sources(btbrowser_test PRIVATE
......
......@@ -8,7 +8,7 @@ if(NOT KF5IconThemes_FOUND)
return()
endif()
find_package(Qt5Test ${QT_MIN_VERSION} QUIET REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} QUIET REQUIRED)
kate_add_plugin(externaltoolsplugin)
target_compile_definitions(externaltoolsplugin PRIVATE TRANSLATION_DOMAIN="kateexternaltoolsplugin")
......
......@@ -17,5 +17,5 @@ add_executable(externaltools_test
../katetoolrunner.cpp
)
add_test(NAME plugin-externaltools_test COMMAND externaltools_test)
target_link_libraries(externaltools_test PRIVATE Qt5::Test KF5::I18n KF5::ConfigCore KF5::CoreAddons KF5::TextEditor)
target_link_libraries(externaltools_test PRIVATE Qt::Test KF5::I18n KF5::ConfigCore KF5::CoreAddons KF5::TextEditor)
ecm_mark_as_test(externaltools_test)
......@@ -3,14 +3,14 @@ include(ECMMarkAsTest)
add_executable(filetree_model_test "")
target_include_directories(filetree_model_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
find_package(Qt5Test ${QT_MIN_VERSION} QUIET REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} QUIET REQUIRED)
target_link_libraries(
filetree_model_test
PRIVATE
KF5::GuiAddons
KF5::I18n
KF5::TextEditor
Qt5::Test
Qt::Test
)
target_sources(
......
find_package(KF5Wallet ${KF5_DEP_VERSION} QUIET)
set_package_properties(KF5Wallet PROPERTIES PURPOSE "Required to build the katesql addon")
find_package(Qt5Sql ${QT_MIN_VERSION} QUIET)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} QUIET)
set_package_properties(Qt5Sql PROPERTIES PURPOSE "Required to build the katesql addon")
if(NOT KF5Wallet_FOUND OR NOT Qt5Sql_FOUND)
......@@ -17,7 +17,7 @@ target_link_libraries(
KF5::I18n
KF5::TextEditor
KF5::Wallet
Qt5::Sql
Qt::Sql
)
target_sources(
......
find_package(Qt5Test ${QT_MIN_VERSION} QUIET REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} QUIET REQUIRED)
kate_add_plugin(latexcompletionplugin)
target_compile_definitions(latexcompletionplugin PRIVATE TRANSLATION_DOMAIN="latexcompletionplugin")
......
......@@ -2,5 +2,5 @@ include(ECMMarkAsTest)
add_executable(latexcompletion_test testcompletiontable.cpp)
target_include_directories(latexcompletion_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
add_test(NAME plugin-latexunicodecompletion_test COMMAND latexcompletion_test)
target_link_libraries(latexcompletion_test Qt5::Core Qt5::Test)
target_link_libraries(latexcompletion_test Qt::Core Qt::Test)
ecm_mark_as_test(latexcompletion_test)
find_package(Qt5Concurrent ${QT_MIN_VERSION} QUIET)
find_package(Qt${QT_MAJOR_VERSION}Concurrent ${QT_MIN_VERSION} QUIET)
find_package(
KF5 ${KF5_DEP_VERSION}
QUIET
......@@ -21,7 +21,7 @@ target_link_libraries(
kateprojectplugin
PRIVATE
kateshared
Qt5::Concurrent
Qt::Concurrent
KF5::GuiAddons
KF5::I18n
KF5::NewStuff
......
......@@ -3,13 +3,13 @@ include(ECMMarkAsTest)
add_executable(projectplugin_test "")
target_include_directories(projectplugin_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
find_package(Qt5Test ${QT_MIN_VERSION} QUIET REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} QUIET REQUIRED)
target_link_libraries(
projectplugin_test
PRIVATE
KF5::I18n
KF5::TextEditor
Qt5::Test
Qt::Test
)
target_sources(
......
find_package(Qt5Concurrent ${QT_MIN_VERSION} QUIET)
find_package(Qt${QT_MAJOR_VERSION}Concurrent ${QT_MIN_VERSION} QUIET)
find_package(KF5ItemViews ${KF5_DEP_VERSION} QUIET)
set_package_properties(KF5ItemViews PROPERTIES PURPOSE "Required to build the search addon")
......@@ -12,7 +12,7 @@ target_compile_definitions(katesearchplugin PRIVATE TRANSLATION_DOMAIN="katesear
target_link_libraries(
katesearchplugin
PRIVATE
Qt5::Concurrent
Qt::Concurrent
KF5::I18n
KF5::ItemViews
KF5::TextEditor
......
find_package(KF5Plasma ${KF5_DEP_VERSION} QUIET)
set_package_properties(KF5Plasma PROPERTIES PURPOSE "Required to build the sessionapplet addon")
find_package(Qt5Widgets ${QT_MIN_VERSION} QUIET)
find_package(Qt${QT_MAJOR_VERSION}Widgets ${QT_MIN_VERSION} QUIET)
set_package_properties(Qt5Widgets PROPERTIES PURPOSE "Required to build the sessionapplet addon")
if(NOT KF5Plasma_FOUND OR NOT Qt5Widgets_FOUND)
......@@ -17,7 +17,7 @@ target_link_libraries(
KF5::I18n
KF5::Plasma
KF5::KIOGui
Qt5::Widgets
Qt::Widgets
)
target_sources(
......@@ -32,6 +32,6 @@ target_sources(
plasma_install_package(applet org.kde.plasma.katesessions)
kcoreaddons_desktop_to_json(plasma_engine_katesessions plasma-dataengine-katesessions.desktop)
install(FILES plasma-dataengine-katesessions.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
install(FILES plasma-dataengine-katesessions.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR})
install(FILES org.kde.plasma.katesessions.operations DESTINATION ${PLASMA_DATA_INSTALL_DIR}/services)
......@@ -3,12 +3,12 @@ include(ECMMarkAsTest)
add_executable(tabswitcher_test "")
target_include_directories(tabswitcher_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..)
find_package(Qt5Test ${QT_MIN_VERSION} QUIET REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} QUIET REQUIRED)
target_link_libraries(
tabswitcher_test
PRIVATE
KF5::TextEditor
Qt5::Test
Qt::Test
)
target_sources(
......
include(ECMMarkAsTest)
find_package(Qt5Test ${QT_MIN_VERSION} QUIET REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} QUIET REQUIRED)
macro(kate_executable_tests)
foreach(_testname ${ARGN})
......@@ -10,7 +10,7 @@ macro(kate_executable_tests)
${_testname}
PRIVATE
kate-lib
Qt5::Test
Qt::Test
)
add_test(NAME kateapp-${_testname} COMMAND ${_testname})
......
......@@ -3,7 +3,7 @@ add_library(kateshared STATIC
quickdialog.cpp
signal_watcher.cpp
)
set_property(TARGET kateshared PROPERTY POSITION_INDEPENDENT_CODE ON)
target_include_directories(kateshared PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
......
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