Commit 653bcfb3 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6

parent 3595f912
Pipeline #120968 passed with stage
in 5 minutes and 25 seconds
......@@ -45,7 +45,9 @@ add_feature_info(QCH ${BUILD_QCH} "API documentation in QCH format (for e.g. Qt
########### Find packages ###########
find_package(Sasl2)
set_package_properties(Sasl2 PROPERTIES TYPE REQUIRED)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6Core5Compat)
endif()
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
......@@ -77,7 +79,7 @@ endif()
add_subdirectory(src)
if(BUILD_TESTING)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Test)
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} CONFIG REQUIRED Test)
add_subdirectory(autotests)
add_subdirectory(tests)
endif()
......@@ -94,7 +96,7 @@ install(EXPORT KF5IMAPTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5I
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/kimap_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF} COMPONENT Devel
)
if (BUILD_QCH)
......
......@@ -116,7 +116,7 @@ generate_export_header(KF5IMAP BASE_NAME kimap)
target_include_directories(KF5IMAP INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/KIMAP>")
target_include_directories(KF5IMAP INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KIMAP>")
target_include_directories(KF5IMAP PUBLIC "$<BUILD_INTERFACE:${KIMAP_SOURCE_DIR}/src;${KIMAP_BINARY_DIR}/src>")
if (WIN32)
......@@ -127,7 +127,7 @@ target_link_libraries(KF5IMAP
PUBLIC
KF5::Mime
KF5::CoreAddons
Qt::Network
Qt${QT_MAJOR_VERSION}::Network
PRIVATE
KF5::KIOCore
KF5::Codecs
......@@ -197,18 +197,18 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/kimap_export.h
${KIMAP_HEADERS}
${KIMAP_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KIMAP/kimap
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KIMAP/kimap
COMPONENT Devel
)
install(FILES
${KIMAP_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KIMAP/KIMAP
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KIMAP/KIMAP
COMPONENT Devel
)
ecm_qt_install_logging_categories(EXPORT KIMAP FILE kimap.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
ecm_generate_pri_file(BASE_NAME KIMAP LIB_NAME KF5IMAP DEPS "KMime" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KIMAP)
ecm_generate_pri_file(BASE_NAME KIMAP LIB_NAME KF5IMAP DEPS "KMime" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/KIMAP)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
if (BUILD_QCH)
......
......@@ -3,7 +3,7 @@
kde_enable_exceptions()
add_executable(testimapidle testimapidle.cpp)
target_link_libraries(testimapidle KF5IMAP Qt::Test KF5::KIOCore Qt::Network)
target_link_libraries(testimapidle KF5IMAP Qt${QT_MAJOR_VERSION}::Test KF5::KIOCore Qt${QT_MAJOR_VERSION}::Network)
add_executable(testimapserver testimapserver.cpp)
target_link_libraries(testimapserver KF5IMAP Qt::Test KF5::KIOCore Qt::Network)
target_link_libraries(testimapserver KF5IMAP Qt${QT_MAJOR_VERSION}::Test KF5::KIOCore Qt${QT_MAJOR_VERSION}::Network)
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