Commit 1d0a1e76 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6

parent a7eed550
Pipeline #120975 passed with stage
in 2 minutes and 13 seconds
......@@ -43,6 +43,9 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KMBOX
########### Find packages ###########
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6Core5Compat)
endif()
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f02)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055A00)
......@@ -80,7 +83,7 @@ install(EXPORT KF5MboxTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5M
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/kmbox_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}
COMPONENT Devel
)
......
......@@ -4,8 +4,8 @@
kde_enable_exceptions()
include(ECMAddTests)
find_package(Qt5Test CONFIG REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test CONFIG REQUIRED)
########### next target ###############
ecm_add_tests(mboxtest.cpp mboxbenchmark.cpp NAME_PREFIX "mbox-" LINK_LIBRARIES KF5Mbox Qt::Test)
ecm_add_tests(mboxtest.cpp mboxbenchmark.cpp NAME_PREFIX "mbox-" LINK_LIBRARIES KF5Mbox Qt${QT_MAJOR_VERSION}::Test)
......@@ -25,13 +25,16 @@ endif()
generate_export_header(KF5Mbox BASE_NAME kmbox)
target_include_directories(KF5Mbox INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/KMbox>")
target_include_directories(KF5Mbox INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KMbox>")
target_include_directories(KF5Mbox PUBLIC "$<BUILD_INTERFACE:${KMbox_SOURCE_DIR}/src;${KMbox_BINARY_DIR}/src>")
target_link_libraries(KF5Mbox
PUBLIC
KF5::Mime
)
if (TARGET Qt6::Core5Compat)
target_link_libraries(KF5Mbox PRIVATE Qt6::Core5Compat) # QTextCodec
endif()
set_target_properties(KF5Mbox PROPERTIES
VERSION ${KMBOX_VERSION}
......@@ -52,7 +55,7 @@ ecm_generate_headers(KMbox_CamelCase_HEADERS
install(FILES
${KMbox_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KMbox/KMbox/
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KMbox/KMbox/
COMPONENT Devel
)
......@@ -60,12 +63,12 @@ install(FILES
install(FILES
${KMbox_BINARY_DIR}/src/kmbox_export.h
${KMbox_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KMbox/kmbox
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KMbox/kmbox
COMPONENT Devel
)
ecm_qt_install_logging_categories(EXPORT KMBOX FILE kmbox.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
ecm_generate_pri_file(BASE_NAME KMbox LIB_NAME KF5Mbox DEPS "KMime" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KMbox)
ecm_generate_pri_file(BASE_NAME KMbox LIB_NAME KF5Mbox DEPS "KMime" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/KMbox)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
if (BUILD_QCH)
......
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