Commit 564f1981 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6

parent 24633642
Pipeline #120994 passed with stage
in 1 minute and 27 seconds
......@@ -35,8 +35,8 @@ find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5DocTools ${KF5_MIN_VERSION} CONFIG)
find_package(Qt5Keychain CONFIG)
set_package_properties(Qt5Keychain PROPERTIES
find_package(Qt${QT_MAJOR_VERSION}Keychain CONFIG)
set_package_properties(Qt${QT_MAJOR_VERSION}Keychain PROPERTIES
DESCRIPTION "Provides support for secure credentials storage"
URL "https://github.com/frankosterfeld/qtkeychain"
TYPE REQUIRED)
......@@ -104,7 +104,7 @@ install(EXPORT KF5LdapTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5L
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/kldap_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}
COMPONENT Devel
)
......
......@@ -2,14 +2,14 @@
# SPDX-License-Identifier: BSD-3-Clause
include(ECMAddTests)
find_package(Qt5Test CONFIG REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test CONFIG REQUIRED)
if(Ldap_FOUND)
ecm_add_tests(testkldap.cpp NAME_PREFIX "kldap-" LINK_LIBRARIES KF5::Ldap Qt::Test)
ecm_add_tests(testkldap.cpp NAME_PREFIX "kldap-" LINK_LIBRARIES KF5::Ldap Qt${QT_MAJOR_VERSION}::Test)
endif()
add_executable(ldapclientsearchconfigreadconfigjobtest ldapclientsearchconfigreadconfigjobtest.cpp)
add_test(NAME ldapclientsearchconfigreadconfigjobtest COMMAND ldapclientsearchconfigreadconfigjobtest)
ecm_mark_as_test(ldapclientsearchconfigreadconfigjobtest)
target_link_libraries(ldapclientsearchconfigreadconfigjobtest Qt::Test KF5::Ldap KF5::ConfigCore)
target_link_libraries(ldapclientsearchconfigreadconfigjobtest Qt${QT_MAJOR_VERSION}::Test KF5::Ldap KF5::ConfigCore)
......@@ -10,7 +10,7 @@ ecm_qt_declare_logging_category(kio_ldap HEADER kldap_debug.h IDENTIFIER KLDAP_L
)
target_link_libraries(kio_ldap Qt::Network KF5::KIOCore KF5::I18n KF5::Ldap)
target_link_libraries(kio_ldap Qt${QT_MAJOR_VERSION}::Network KF5::KIOCore KF5::I18n KF5::Ldap)
if (WIN32)
target_link_libraries(kio_ldap ws2_32)
endif()
......
......@@ -105,17 +105,22 @@ generate_export_header(KF5Ldap BASE_NAME kldap)
target_link_libraries(KF5Ldap
PRIVATE
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
KF5::I18n
KF5::WidgetsAddons
KF5::ConfigCore
KF5::CoreAddons
KF5::KIOCore
${kldap_EXTRA_LIBS}
qt5keychain
)
target_include_directories(KF5Ldap INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/KLDAP>")
if (QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(KF5Ldap PRIVATE qt6keychain)
else()
target_link_libraries(KF5Ldap PRIVATE qt5keychain)
endif()
target_include_directories(KF5Ldap INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/KLDAP>")
target_include_directories(KF5Ldap PUBLIC "$<BUILD_INTERFACE:${KLdap_SOURCE_DIR}/src/core;${KLdap_BINARY_DIR}/src>")
set_target_properties(KF5Ldap PROPERTIES
......@@ -166,14 +171,14 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/kldap_export.h
${KLdapCore_HEADERS}
${KLdapWidgets_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KLDAP/kldap
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KLDAP/kldap
COMPONENT Devel
)
install(FILES
${KLdapCore_CamelCase_HEADERS}
${KLdapWidgets_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/KLDAP/KLDAP/
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/KLDAP/KLDAP/
COMPONENT Devel
)
......@@ -204,6 +209,6 @@ if (BUILD_QCH)
)
endif()
ecm_generate_pri_file(BASE_NAME Ldap LIB_NAME KF5Ldap FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/KLDAP/)
ecm_generate_pri_file(BASE_NAME Ldap LIB_NAME KF5Ldap FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/KLDAP/)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
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