Commit d138604c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6

parent d02e742f
Pipeline #121289 passed with stage
in 1 minute and 16 seconds
......@@ -44,7 +44,7 @@ set(GRANTLEETHEME_LIB_VERSION "5.19.40")
set(GRANTLEE_LIB_VERSION "5.2")
set(QT_REQUIRED_VERSION "5.15.2")
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test)
find_package(Qt${QT_MAJOR_VERSION} ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test)
########### Find packages ###########
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
......
......@@ -5,6 +5,6 @@ include(ECMAddTests)
ecm_qt_declare_logging_category(akonadi_serializer_autotest_addressee_SRCS HEADER serializer_debug.h IDENTIFIER AKONADI_SERIALIZER_CONTACT_LOG CATEGORY_NAME org.kde.pim.contact_serializer)
ecm_add_test(addresseeserializertest.cpp ../akonadi_serializer_addressee.cpp ${akonadi_serializer_autotest_addressee_SRCS}
LINK_LIBRARIES KF5::AkonadiCore KF5::AkonadiContact KF5::Contacts KF5::I18n Qt::Core Qt::Test
LINK_LIBRARIES KF5::AkonadiCore KF5::AkonadiContact KF5::Contacts KF5::I18n Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Test
TEST_NAME addresseeserializertest
)
......@@ -208,8 +208,8 @@ endif()
generate_export_header(KF5AkonadiContact BASE_NAME akonadi-contact)
target_include_directories(KF5AkonadiContact INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/Akonadi/Contact;${KDE_INSTALL_INCLUDEDIR_KF5}>")
target_include_directories(KF5AkonadiContact INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/akonadi/contact>")
target_include_directories(KF5AkonadiContact INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/Akonadi/Contact;${KDE_INSTALL_INCLUDEDIR_KF}>")
target_include_directories(KF5AkonadiContact INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/akonadi/contact>")
target_include_directories(KF5AkonadiContact PUBLIC "$<BUILD_INTERFACE:${Akonadi-Contact_SOURCE_DIR}/src;${Akonadi-Contact_BINARY_DIR}/src>")
target_link_libraries(KF5AkonadiContact
......@@ -217,7 +217,7 @@ target_link_libraries(KF5AkonadiContact
KF5::AkonadiCore
KF5::Contacts
KF5::AkonadiWidgets
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
KF5::GrantleeTheme
PRIVATE
KF5::ConfigCore
......@@ -259,7 +259,7 @@ install(TARGETS
ecm_generate_pri_file(BASE_NAME AkonadiContact
LIB_NAME KF5AkonadiContact
DEPS "AkonadiCore KContacts" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/Akonadi/Contact
DEPS "AkonadiCore KContacts" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/Akonadi/Contact
)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
......@@ -336,7 +336,7 @@ install( FILES
${AkonadiContactJob_CamelCase_HEADERS}
${AkonadiContactRecipients_CamelCase_HEADERS}
${AkonadiContactGrantlee_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/Akonadi/Contact COMPONENT Devel
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/Akonadi/Contact COMPONENT Devel
)
install( FILES
......@@ -345,7 +345,7 @@ install( FILES
${AkonadiContactRecipients_HEADERS}
${AkonadiContactGrantlee_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/akonadi-contact_export.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/akonadi/contact COMPONENT Devel
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/akonadi/contact COMPONENT Devel
)
......
......@@ -11,7 +11,7 @@ macro(add_akonadi_contact_demo _source)
add_test(NAME ${_name} COMMAND ${_name} )
target_link_libraries(${_name}
KF5::AkonadiContact
Qt::Test)
Qt${QT_MAJOR_VERSION}::Test)
ecm_mark_as_test(${_name})
endmacro()
......@@ -20,5 +20,5 @@ endmacro()
add_akonadi_contact_demo(contactmetadataattributetest.cpp)
ecm_add_test(grantleeprinttest.cpp
LINK_LIBRARIES KF5::AkonadiContact Qt::Test KF5::Contacts
LINK_LIBRARIES KF5::AkonadiContact Qt${QT_MAJOR_VERSION}::Test KF5::Contacts
)
......@@ -12,7 +12,7 @@ macro(add_akonadi_contact_demo _source)
KF5::Completion
KF5::I18n
KF5::WidgetsAddons
Qt::Test)
Qt${QT_MAJOR_VERSION}::Test)
ecm_mark_as_test(${_name})
endmacro()
......
......@@ -164,14 +164,14 @@ endif()
generate_export_header(KF5ContactEditor BASE_NAME contacteditor)
target_include_directories(KF5ContactEditor INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor;${KDE_INSTALL_INCLUDEDIR_KF5}>")
target_include_directories(KF5ContactEditor INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/contacteditor>")
target_include_directories(KF5ContactEditor INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/ContactEditor;${KDE_INSTALL_INCLUDEDIR_KF}>")
target_include_directories(KF5ContactEditor INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF}/contacteditor>")
target_include_directories(KF5ContactEditor PUBLIC "$<BUILD_INTERFACE:${Akonadi-Contact_SOURCE_DIR}/src/contact-editor;${Akonadi-Contact_BINARY_DIR}/src/contact-editor>")
target_link_libraries(KF5ContactEditor
PUBLIC
KF5::Contacts
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
PRIVATE
KF5::Completion
KF5::ConfigCore
......@@ -195,7 +195,7 @@ install(TARGETS
ecm_generate_pri_file(BASE_NAME ContactEditor
LIB_NAME KF5ContactEditor
DEPS "KContacts" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor
DEPS "KContacts" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF}/ContactEditor
)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
......@@ -218,14 +218,14 @@ ecm_generate_headers(ContactEditorWidget_CamelCase_HEADERS
install( FILES
${ContactEditor_CamelCase_HEADERS}
${ContactEditorWidget_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/ContactEditor COMPONENT Devel
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/ContactEditor COMPONENT Devel
)
install( FILES
${ContactEditor_HEADERS}
${ContactEditorWidget_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/contacteditor_export.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/contacteditor COMPONENT Devel
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF}/contacteditor COMPONENT Devel
)
......@@ -239,8 +239,8 @@ if (BUILD_TESTING)
add_subdirectory(editor/widgets/autotests/)
endif()
install(FILES editor/pics/world.jpg DESTINATION ${KDE_INSTALL_DATADIR_KF5}/akonadi/contact/pics)
install(FILES editor/data/zone.tab DESTINATION ${KDE_INSTALL_DATADIR_KF5}/akonadi/contact/data)
install(FILES editor/pics/world.jpg DESTINATION ${KDE_INSTALL_DATADIR_KF}/akonadi/contact/pics)
install(FILES editor/data/zone.tab DESTINATION ${KDE_INSTALL_DATADIR_KF}/akonadi/contact/data)
if (BUILD_QCH)
ecm_add_qch(
......
......@@ -9,4 +9,4 @@ set(addresslocationwidget_SRCS addresslocationwidgettest.cpp addresslocationwidg
add_executable(addresslocationwidget ${addresslocationwidget_SRCS})
add_test(NAME addresslocationwidget COMMAND addresslocationwidget)
ecm_mark_as_test(addresslocationwidget)
target_link_libraries(addresslocationwidget Qt::Test Qt::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion KF5::WidgetsAddons)
target_link_libraries(addresslocationwidget Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion KF5::WidgetsAddons)
......@@ -5,13 +5,13 @@ set(customfieldswidgettest_SRCS customfieldswidgettest.cpp customfieldswidgettes
add_executable(customfieldswidgettest ${customfieldswidgettest_SRCS})
add_test(NAME customfieldswidgettest COMMAND customfieldswidgettest)
ecm_mark_as_test(customfieldswidgettest)
target_link_libraries(customfieldswidgettest Qt::Test Qt::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion KF5::ConfigCore KF5::WidgetsAddons)
target_link_libraries(customfieldswidgettest Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion KF5::ConfigCore KF5::WidgetsAddons)
add_executable(customfieldeditorwidgettest customfieldeditorwidgettest.cpp ../customfieldeditorwidget.cpp)
add_test(NAME customfieldeditorwidgettest COMMAND customfieldeditorwidgettest)
ecm_mark_as_test(customfieldeditorwidgettest)
target_link_libraries(customfieldeditorwidgettest Qt::Test Qt::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion KF5::WidgetsAddons)
target_link_libraries(customfieldeditorwidgettest Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion KF5::WidgetsAddons)
add_executable(customfieldslistwidgettest)
target_sources(customfieldslistwidgettest PRIVATE
......@@ -21,4 +21,4 @@ target_sources(customfieldslistwidgettest PRIVATE
)
add_test(NAME customfieldslistwidgettest COMMAND customfieldslistwidgettest)
ecm_mark_as_test(customfieldslistwidgettest)
target_link_libraries(customfieldslistwidgettest Qt::Test Qt::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion KF5::ConfigCore KF5::WidgetsAddons)
target_link_libraries(customfieldslistwidgettest Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion KF5::ConfigCore KF5::WidgetsAddons)
......@@ -13,7 +13,7 @@ set(customfieldeditor_SRCS
add_executable(customfieldeditortest ${customfieldeditor_SRCS})
target_link_libraries(customfieldeditortest
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
KF5::ContactEditor
KF5::Contacts
KF5::I18n
......
......@@ -6,20 +6,20 @@ set(phonewidgettest_SRCS phonewidgettest.cpp)
add_executable(phonewidgettest ${phonewidgettest_SRCS})
add_test(NAME phonewidgettest COMMAND phonewidgettest)
ecm_mark_as_test(phonewidgettest)
target_link_libraries(phonewidgettest Qt::Test KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion)
target_link_libraries(phonewidgettest Qt${QT_MAJOR_VERSION}::Test KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion)
set(mailwidgettest_SRCS mailwidgettest.cpp)
add_executable(mailwidgettest ${mailwidgettest_SRCS})
add_test(NAME mailwidgettest COMMAND mailwidgettest)
ecm_mark_as_test(mailwidgettest)
target_link_libraries(mailwidgettest Qt::Test KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion)
target_link_libraries(mailwidgettest Qt${QT_MAJOR_VERSION}::Test KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion)
set(messagingwidgettest_SRCS messagingwidgettest.cpp ../../widgets/preferredlineeditwidget.cpp)
add_executable(messagingwidgettest ${messagingwidgettest_SRCS})
add_test(NAME messagingwidgettest COMMAND messagingwidgettest)
ecm_mark_as_test(messagingwidgettest)
target_link_libraries(messagingwidgettest Qt::Test KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion KF5::Service)
target_link_libraries(messagingwidgettest Qt${QT_MAJOR_VERSION}::Test KF5::ContactEditor KF5::Contacts KF5::I18n KF5::Completion KF5::Service)
......@@ -27,24 +27,24 @@ set(contactselecttypecomboboxtest_SRCS contactselecttypecomboboxtest.cpp)
add_executable(contactselecttypecomboboxtest ${contactselecttypecomboboxtest_SRCS})
add_test(NAME contactselecttypecomboboxtest COMMAND contactselecttypecomboboxtest)
ecm_mark_as_test(contactselecttypecomboboxtest)
target_link_libraries(contactselecttypecomboboxtest Qt::Test Qt::Widgets KF5::ContactEditor KF5::I18n )
target_link_libraries(contactselecttypecomboboxtest Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::ContactEditor KF5::I18n )
set(nicknamewidgettest_SRCS nicknamewidgettest.cpp)
add_executable(nicknamewidgettest ${nicknamewidgettest_SRCS})
add_test(NAME nicknamewidgettest COMMAND nicknamewidgettest)
ecm_mark_as_test(nicknamewidgettest)
target_link_libraries(nicknamewidgettest Qt::Test Qt::Widgets KF5::ContactEditor KF5::I18n KF5::Completion)
target_link_libraries(nicknamewidgettest Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::ContactEditor KF5::I18n KF5::Completion)
set(blogfeedwidgettest_SRCS blogfeedwidgettest.cpp)
add_executable(blogfeedwidgettest ${blogfeedwidgettest_SRCS})
add_test(NAME blogfeedwidgettest COMMAND blogfeedwidgettest)
ecm_mark_as_test(blogfeedwidgettest)
target_link_libraries(blogfeedwidgettest Qt::Test Qt::Widgets KF5::ContactEditor KF5::I18n KF5::Completion)
target_link_libraries(blogfeedwidgettest Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::ContactEditor KF5::I18n KF5::Completion)
set(messageformattingwidgettest_SRCS messageformattingwidgettest.cpp)
add_executable(messageformattingwidgettest ${messageformattingwidgettest_SRCS})
add_test(NAME messageformattingwidgettest COMMAND messageformattingwidgettest)
ecm_mark_as_test(messageformattingwidgettest)
target_link_libraries(messageformattingwidgettest Qt::Test Qt::Widgets KF5::ContactEditor KF5::I18n )
target_link_libraries(messageformattingwidgettest Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::ContactEditor KF5::I18n )
......@@ -21,7 +21,7 @@ set(generalinfoeditor_SRCS
add_executable(generalinfoeditortest ${generalinfoeditor_SRCS})
target_link_libraries(generalinfoeditortest
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
KF5::ContactEditor
KF5::Contacts
KF5::I18n
......
......@@ -4,4 +4,4 @@ set( preferredlineeditwidgettest_SRCS preferredlineeditwidgettest.cpp ../preferr
add_executable( preferredlineeditwidgettest ${preferredlineeditwidgettest_SRCS})
add_test(NAME preferredlineeditwidgettest COMMAND preferredlineeditwidgettest)
ecm_mark_as_test(preferredlineeditwidgettest)
target_link_libraries( preferredlineeditwidgettest Qt::Test Qt::Widgets KF5::Completion KF5::I18n)
target_link_libraries( preferredlineeditwidgettest Qt${QT_MAJOR_VERSION}::Test Qt${QT_MAJOR_VERSION}::Widgets KF5::Completion KF5::I18n)
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