allow detection of qt5 or qt6

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
pull/4584/head
Matthieu Gallien 2022-05-20 19:03:40 +02:00 committed by Matthieu Gallien
parent d3442d137a
commit aa76de9b68
13 changed files with 113 additions and 91 deletions

View File

@ -139,7 +139,7 @@ if(APPLE AND BUILD_OWNCLOUD_OSX_BUNDLE)
add_definitions(-DBUILD_OWNCLOUD_OSX_BUNDLE) add_definitions(-DBUILD_OWNCLOUD_OSX_BUNDLE)
endif() endif()
find_package(Qt${QT_MAJOR_VERSION} COMPONENTS Core)
option(QUICK_COMPILER "Use QtQuick compiler to improve performance" OFF) option(QUICK_COMPILER "Use QtQuick compiler to improve performance" OFF)
# this option removes Http authentication, keychain, shibboleth etc and is intended for # this option removes Http authentication, keychain, shibboleth etc and is intended for

View File

@ -9,7 +9,7 @@ else()
set(MAC_INSTALLER_DO_CUSTOM_BACKGROUND "0") set(MAC_INSTALLER_DO_CUSTOM_BACKGROUND "0")
endif() endif()
find_package(Qt5 5.15 COMPONENTS Core REQUIRED) find_package(Qt${QT_MAJOR_VERSION} 5.15 COMPONENTS Core REQUIRED)
configure_file(create_mac.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/create_mac.sh) configure_file(create_mac.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/create_mac.sh)
configure_file(macosx.pkgproj.cmake ${CMAKE_CURRENT_BINARY_DIR}/macosx.pkgproj) configure_file(macosx.pkgproj.cmake ${CMAKE_CURRENT_BINARY_DIR}/macosx.pkgproj)
configure_file(pre_install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh) configure_file(pre_install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/pre_install.sh)

View File

@ -25,8 +25,13 @@ macro(libcloudproviders_add_config _sources)
endmacro(libcloudproviders_add_config _sources) endmacro(libcloudproviders_add_config _sources)
find_package(Qt5 5.15 COMPONENTS DBus) if (Qt6_FOUND)
IF (Qt5DBus_FOUND) find_package(Qt6 COMPONENTS COMPONENTS DBus)
else()
set(REQUIRED_QT_VERSION "5.15.0")
find_package(Qt5 ${REQUIRED_QT_VERSION} COMPONENTS DBus)
endif()
IF (Qt5DBus_FOUND OR Qt6DBus_FOUND)
STRING(TOLOWER "${APPLICATION_VENDOR}" DBUS_VENDOR) STRING(TOLOWER "${APPLICATION_VENDOR}" DBUS_VENDOR)
STRING(REGEX REPLACE "[^A-z0-9]" "" DBUS_VENDOR "${DBUS_VENDOR}") STRING(REGEX REPLACE "[^A-z0-9]" "" DBUS_VENDOR "${DBUS_VENDOR}")
STRING(REGEX REPLACE "[^A-z0-9]" "" DBUS_APPLICATION_NAME "${APPLICATION_SHORTNAME}") STRING(REGEX REPLACE "[^A-z0-9]" "" DBUS_APPLICATION_NAME "${APPLICATION_SHORTNAME}")

View File

@ -2,71 +2,73 @@ include(ECMEnableSanitizers)
set(REQUIRED_QT_VERSION "5.15.0") set(REQUIRED_QT_VERSION "5.15.0")
find_package(Qt5Core ${REQUIRED_QT_VERSION} CONFIG QUIET) find_package(Qt${QT_MAJOR_VERSION}Core ${REQUIRED_QT_VERSION} CONFIG QUIET)
set_package_properties(Qt5Core PROPERTIES set_package_properties(Qt${QT_MAJOR_VERSION}Core PROPERTIES
DESCRIPTION "Qt5 Core component." DESCRIPTION "Qt${QT_MAJOR_VERSION} Core component."
TYPE REQUIRED TYPE REQUIRED
) )
find_package(Qt5Network ${REQUIRED_QT_VERSION} CONFIG QUIET) find_package(Qt${QT_MAJOR_VERSION}Network ${REQUIRED_QT_VERSION} CONFIG QUIET)
set_package_properties(Qt5Network PROPERTIES set_package_properties(Qt${QT_MAJOR_VERSION}Network PROPERTIES
DESCRIPTION "Qt5 Network component." DESCRIPTION "Qt${QT_MAJOR_VERSION} Network component."
TYPE REQUIRED TYPE REQUIRED
) )
find_package(Qt5Xml ${REQUIRED_QT_VERSION} CONFIG QUIET) find_package(Qt${QT_MAJOR_VERSION}Xml ${REQUIRED_QT_VERSION} CONFIG QUIET)
set_package_properties(Qt5Xml PROPERTIES set_package_properties(Qt${QT_MAJOR_VERSION}Xml PROPERTIES
DESCRIPTION "Qt5 Xml component." DESCRIPTION "Qt${QT_MAJOR_VERSION} Xml component."
TYPE REQUIRED TYPE REQUIRED
) )
find_package(Qt5Concurrent ${REQUIRED_QT_VERSION} CONFIG QUIET) find_package(Qt${QT_MAJOR_VERSION}Concurrent ${REQUIRED_QT_VERSION} CONFIG QUIET)
set_package_properties(Qt5Concurrent PROPERTIES set_package_properties(Qt${QT_MAJOR_VERSION}Concurrent PROPERTIES
DESCRIPTION "Qt5 Concurrent component." DESCRIPTION "Qt${QT_MAJOR_VERSION} Concurrent component."
TYPE REQUIRED TYPE REQUIRED
) )
find_package(Qt5QuickWidgets ${REQUIRED_QT_VERSION} CONFIG QUIET) find_package(Qt${QT_MAJOR_VERSION}QuickWidgets ${REQUIRED_QT_VERSION} CONFIG QUIET)
set_package_properties(Qt5QuickWidgets PROPERTIES set_package_properties(Qt${QT_MAJOR_VERSION}QuickWidgets PROPERTIES
DESCRIPTION "Qt5 QuickWidgets component." DESCRIPTION "Qt5 QuickWidgets component."
TYPE REQUIRED TYPE REQUIRED
) )
find_package(Qt5WebEngineWidgets ${REQUIRED_QT_VERSION} CONFIG QUIET) find_package(Qt${QT_MAJOR_VERSION}WebEngineWidgets ${REQUIRED_QT_VERSION} CONFIG QUIET)
if(NOT BUILD_WITH_WEBENGINE) if(NOT BUILD_WITH_WEBENGINE)
set_package_properties(Qt5WebEngineWidgets PROPERTIES set_package_properties(Qt${QT_MAJOR_VERSION}WebEngineWidgets PROPERTIES
DESCRIPTION "Qt5 WebEngineWidgets component." DESCRIPTION "Qt${QT_MAJOR_VERSION} WebEngineWidgets component."
TYPE RECOMMENDED TYPE RECOMMENDED
) )
else() else()
set_package_properties(Qt5WebEngineWidgets PROPERTIES set_package_properties(Qt${QT_MAJOR_VERSION}WebEngineWidgets PROPERTIES
DESCRIPTION "Qt5 WebEngineWidgets component." DESCRIPTION "Qt${QT_MAJOR_VERSION} WebEngineWidgets component."
TYPE REQUIRED TYPE REQUIRED
) )
endif() endif()
find_package(Qt5WebEngine ${REQUIRED_QT_VERSION} CONFIG QUIET) if (${QT_MAJOR_VERSION} STREQUAL "5")
if(NOT BUILD_WITH_WEBENGINE) find_package(Qt${QT_MAJOR_VERSION}WebEngine ${REQUIRED_QT_VERSION} CONFIG QUIET)
set_package_properties(Qt5WebEngine PROPERTIES if(APPLE)
DESCRIPTION "Qt5 WebEngine component." set_package_properties(Qt${QT_MAJOR_VERSION}WebEngine PROPERTIES
TYPE RECOMMENDED DESCRIPTION "Qt${QT_MAJOR_VERSION} WebEngine component."
) TYPE RECOMMENDED
else() )
set_package_properties(Qt5WebEngine PROPERTIES else()
DESCRIPTION "Qt5 WebEngine component." set_package_properties(Qt${QT_MAJOR_VERSION}WebEngine PROPERTIES
TYPE REQUIRED DESCRIPTION "Qt${QT_MAJOR_VERSION} WebEngine component."
) TYPE REQUIRED
)
endif()
endif() endif()
if(BUILD_WITH_WEBENGINE AND Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND) if(Qt${QT_MAJOR_VERSION}WebEngine_FOUND AND Qt${QT_MAJOR_VERSION}WebEngineWidgets_FOUND)
add_compile_definitions(WITH_WEBENGINE=1) add_compile_definitions(WITH_WEBENGINE=1)
endif() endif()
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) get_target_property (QT_QMAKE_EXECUTABLE Qt::qmake IMPORTED_LOCATION)
message(STATUS "Using Qt ${Qt5Core_VERSION} (${QT_QMAKE_EXECUTABLE})") message(STATUS "Using Qt ${Qt${QT_MAJOR_VERSION}Core_VERSION} (${QT_QMAKE_EXECUTABLE})")
if(NOT TOKEN_AUTH_ONLY) if(NOT TOKEN_AUTH_ONLY)
find_package(Qt5Keychain REQUIRED) find_package(Qt${QT_MAJOR_VERSION}Keychain REQUIRED)
endif() endif()
# TODO: Mingw64 7.3 might also need to be excluded here as it seems to not automatically link libssp # TODO: Mingw64 7.3 might also need to be excluded here as it seems to not automatically link libssp

View File

@ -10,8 +10,8 @@ add_library(cmdCore STATIC
target_link_libraries(cmdCore target_link_libraries(cmdCore
PUBLIC PUBLIC
Nextcloud::sync Nextcloud::sync
Qt5::Core Qt::Core
Qt5::Network Qt::Network
) )
# Need tokenizer for netrc parser # Need tokenizer for netrc parser

View File

@ -24,14 +24,14 @@ if(NOT BUILD_LIBRARIES_ONLY)
${crashreporter_RC_RCC} ${crashreporter_RC_RCC}
) )
find_package(Qt5 REQUIRED COMPONENTS Widgets) find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Widgets)
target_include_directories(${CRASHREPORTER_EXECUTABLE} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(${CRASHREPORTER_EXECUTABLE} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES AUTOMOC ON) set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES AUTOMOC ON)
set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} ) set_target_properties(${CRASHREPORTER_EXECUTABLE} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIRECTORY} )
target_link_libraries(${CRASHREPORTER_EXECUTABLE} target_link_libraries(${CRASHREPORTER_EXECUTABLE}
crashreporter-gui crashreporter-gui
Qt5::Core Qt5::Widgets Qt::Core Qt::Widgets
) )
if(BUILD_OWNCLOUD_OSX_BUNDLE) if(BUILD_OWNCLOUD_OSX_BUNDLE)
@ -48,7 +48,7 @@ if(NOT BUILD_LIBRARIES_ONLY)
# currently it needs to be done because the code right above needs to be executed no matter # currently it needs to be done because the code right above needs to be executed no matter
# if building a bundle or not and the install_qt4_executable needs to be called afterwards # if building a bundle or not and the install_qt4_executable needs to be called afterwards
if(BUILD_OWNCLOUD_OSX_BUNDLE) if(BUILD_OWNCLOUD_OSX_BUNDLE)
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) get_target_property (QT_QMAKE_EXECUTABLE Qt::qmake IMPORTED_LOCATION)
get_filename_component(QT_BIN_DIR "${QT_QMAKE_EXECUTABLE}" DIRECTORY) get_filename_component(QT_BIN_DIR "${QT_QMAKE_EXECUTABLE}" DIRECTORY)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}") find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}")

View File

@ -72,7 +72,7 @@ generate_export_header(nextcloud_csync
target_link_libraries(nextcloud_csync target_link_libraries(nextcloud_csync
PUBLIC PUBLIC
${CSYNC_REQUIRED_LIBRARIES} ${CSYNC_REQUIRED_LIBRARIES}
Qt5::Core Qt5::Concurrent Qt::Core Qt::Concurrent
) )
if(ZLIB_FOUND) if(ZLIB_FOUND)

View File

@ -1,17 +1,21 @@
project(gui) project(gui)
find_package(Qt5 REQUIRED COMPONENTS Widgets Svg Qml Quick QuickControls2 QuickWidgets Xml Network) find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS Widgets Svg Qml Quick QuickControls2 QuickWidgets Xml Network)
find_package(KF5Archive REQUIRED) find_package(KF5Archive REQUIRED)
find_package(KF5GuiAddons) find_package(KF5GuiAddons)
if(QUICK_COMPILER) if(QUICK_COMPILER)
find_package(Qt5QuickCompiler) if (${QT_MAJOR_VERSION} STREQUAL "6")
else()
set(REQUIRED_QT_VERSION "5.15.0")
find_package(Qt${QT_MAJOR_VERSION} ${REQUIRED_QT_VERSION} CONFIG REQUIRED QuickCompiler)
set_package_properties(Qt5QuickCompiler PROPERTIES set_package_properties(Qt5QuickCompiler PROPERTIES
DESCRIPTION "Compile QML at build time" DESCRIPTION "Compile QML at build time"
TYPE REQUIRED TYPE REQUIRED
) )
endif()
endif() endif()
if (NOT TARGET Qt5::GuiPrivate) if (NOT TARGET Qt::GuiPrivate)
message(FATAL_ERROR "Could not find GuiPrivate component of Qt5. It might be shipped as a separate package, please check that.") message(FATAL_ERROR "Could not find GuiPrivate component of Qt5. It might be shipped as a separate package, please check that.")
endif() endif()
@ -55,7 +59,7 @@ set(client_UI_SRCS
wizard/welcomepage.ui wizard/welcomepage.ui
) )
if(QUICK_COMPILER) if(Qt5QuickCompiler_FOUND)
qtquick_compiler_add_resources(client_UI_SRCS ../../resources.qrc ${CMAKE_SOURCE_DIR}/theme.qrc) qtquick_compiler_add_resources(client_UI_SRCS ../../resources.qrc ${CMAKE_SOURCE_DIR}/theme.qrc)
else() else()
qt_add_resources(client_UI_SRCS ../../resources.qrc ${CMAKE_SOURCE_DIR}/theme.qrc) qt_add_resources(client_UI_SRCS ../../resources.qrc ${CMAKE_SOURCE_DIR}/theme.qrc)
@ -261,7 +265,7 @@ set(client_SRCS
wizard/linklabel.cpp wizard/linklabel.cpp
) )
if (Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND) if (Qt${QT_MAJOR_VERSION}WebEngine_FOUND AND Qt${QT_MAJOR_VERSION}WebEngineWidgets_FOUND)
list(APPEND client_SRCS list(APPEND client_SRCS
wizard/webviewpage.h wizard/webviewpage.h
wizard/webviewpage.cpp wizard/webviewpage.cpp
@ -377,9 +381,9 @@ else()
set_property(SOURCE ../3rdparty/qtlockedfile/qtlockedfile_win.cpp PROPERTY SKIP_UNITY_BUILD_INCLUSION ON) set_property(SOURCE ../3rdparty/qtlockedfile/qtlockedfile_win.cpp PROPERTY SKIP_UNITY_BUILD_INCLUSION ON)
endif() endif()
find_package(Qt5LinguistTools) find_package(Qt6 COMPONENTS LinguistTools)
if(Qt5LinguistTools_FOUND) if(Qt${QT_MAJOR_VERSION}LinguistTools_FOUND)
qt5_add_translation(client_I18N ${TRANSLATIONS}) qt_add_translation(client_I18N ${TRANSLATIONS})
endif() endif()
IF( WIN32 ) IF( WIN32 )
@ -402,7 +406,7 @@ set( final_src
${3rdparty_MOC} ${3rdparty_MOC}
) )
if(Qt5Keychain_FOUND) if(Qt${QT_MAJOR_VERSION}Keychain_FOUND)
list(APPEND libsync_LINK_TARGETS qt5keychain) list(APPEND libsync_LINK_TARGETS qt5keychain)
endif() endif()
@ -556,15 +560,15 @@ add_library(nextcloudCore STATIC ${final_src})
target_link_libraries(nextcloudCore target_link_libraries(nextcloudCore
PUBLIC PUBLIC
Nextcloud::sync Nextcloud::sync
Qt5::Widgets Qt::Widgets
Qt5::GuiPrivate Qt::GuiPrivate
Qt5::Svg Qt::Svg
Qt5::Network Qt::Network
Qt5::Xml Qt::Xml
Qt5::Qml Qt::Qml
Qt5::Quick Qt::Quick
Qt5::QuickControls2 Qt::QuickControls2
Qt5::QuickWidgets Qt::QuickWidgets
KF5::Archive KF5::Archive
) )
@ -589,7 +593,7 @@ foreach(FILE IN LISTS client_UI_SRCS)
endforeach() endforeach()
if(Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND) if(Qt5WebEngine_FOUND AND Qt5WebEngineWidgets_FOUND)
target_link_libraries(nextcloudCore PUBLIC Qt5::WebEngineWidgets) target_link_libraries(nextcloudCore PUBLIC Qt::WebEngineWidgets)
endif() endif()
set_target_properties(nextcloudCore set_target_properties(nextcloudCore
@ -647,7 +651,7 @@ else()
set (QM_DIR ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/Translations) set (QM_DIR ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources/Translations)
install(FILES ${client_I18N} DESTINATION ${QM_DIR}) install(FILES ${client_I18N} DESTINATION ${QM_DIR})
get_target_property(_qmake Qt5::qmake LOCATION) get_target_property(_qmake Qt::qmake LOCATION)
execute_process(COMMAND ${_qmake} -query QT_INSTALL_TRANSLATIONS execute_process(COMMAND ${_qmake} -query QT_INSTALL_TRANSLATIONS
OUTPUT_VARIABLE QT_TRANSLATIONS_DIR OUTPUT_VARIABLE QT_TRANSLATIONS_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
@ -662,7 +666,7 @@ endif()
IF(BUILD_UPDATER) IF(BUILD_UPDATER)
add_library(updater STATIC ${updater_SRCS}) add_library(updater STATIC ${updater_SRCS})
target_link_libraries(updater Nextcloud::sync ${updater_DEPS} Qt5::Widgets Qt5::Svg Qt5::Network Qt5::Xml) target_link_libraries(updater Nextcloud::sync ${updater_DEPS} Qt::Widgets Qt::Svg Qt::Network Qt::Xml)
target_include_directories(updater PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(updater PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties(updater PROPERTIES AUTOMOC ON) set_target_properties(updater PROPERTIES AUTOMOC ON)
target_link_libraries(nextcloudCore PUBLIC updater) target_link_libraries(nextcloudCore PUBLIC updater)
@ -705,20 +709,25 @@ endif()
## handle DBUS for Fdo notifications ## handle DBUS for Fdo notifications
if( UNIX AND NOT APPLE ) if( UNIX AND NOT APPLE )
find_package(Qt5 COMPONENTS DBus) if (Qt6_FOUND)
target_link_libraries(nextcloudCore PUBLIC Qt5::DBus) find_package(Qt6 COMPONENTS DBus)
else()
set(REQUIRED_QT_VERSION "5.15.0")
find_package(Qt5 ${REQUIRED_QT_VERSION} COMPONENTS DBus)
endif()
target_link_libraries(nextcloudCore PUBLIC Qt::DBus)
target_compile_definitions(nextcloudCore PUBLIC "USE_FDO_NOTIFICATIONS") target_compile_definitions(nextcloudCore PUBLIC "USE_FDO_NOTIFICATIONS")
endif() endif()
if (APPLE) if (APPLE)
find_package(Qt5 COMPONENTS MacExtras) find_package(Qt${QT_MAJOR_VERSION} COMPONENTS MacExtras)
if (BUILD_FILE_PROVIDER_MODULE) if (BUILD_FILE_PROVIDER_MODULE)
target_link_libraries(nextcloudCore PUBLIC Qt5::MacExtras "-framework UserNotifications -framework FileProvider") target_link_libraries(nextcloudCore PUBLIC Qt::MacExtras "-framework UserNotifications -framework FileProvider")
elseif(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.14) elseif(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.14)
target_link_libraries(nextcloudCore PUBLIC Qt5::MacExtras "-framework UserNotifications") target_link_libraries(nextcloudCore PUBLIC Qt::MacExtras "-framework UserNotifications")
else() else()
target_link_libraries(nextcloudCore PUBLIC Qt5::MacExtras) target_link_libraries(nextcloudCore PUBLIC Qt::MacExtras)
endif() endif()
endif() endif()
@ -746,7 +755,7 @@ install(TARGETS nextcloud
# #
# OSX: Run macdeployqt for src/gui and for src/cmd using the -executable option # OSX: Run macdeployqt for src/gui and for src/cmd using the -executable option
if(BUILD_OWNCLOUD_OSX_BUNDLE AND NOT BUILD_LIBRARIES_ONLY) if(BUILD_OWNCLOUD_OSX_BUNDLE AND NOT BUILD_LIBRARIES_ONLY)
get_target_property (QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) get_target_property (QT_QMAKE_EXECUTABLE Qt::qmake IMPORTED_LOCATION)
get_filename_component(QT_BIN_DIR "${QT_QMAKE_EXECUTABLE}" DIRECTORY) get_filename_component(QT_BIN_DIR "${QT_QMAKE_EXECUTABLE}" DIRECTORY)
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}") find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}")

View File

@ -195,7 +195,7 @@ IF (NOT APPLE)
) )
ENDIF(NOT APPLE) ENDIF(NOT APPLE)
find_package(Qt5 REQUIRED COMPONENTS WebSockets Xml Sql) find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS WebSockets Xml Sql)
add_library(nextcloudsync SHARED ${libsync_SRCS}) add_library(nextcloudsync SHARED ${libsync_SRCS})
add_library(Nextcloud::sync ALIAS nextcloudsync) add_library(Nextcloud::sync ALIAS nextcloudsync)
@ -206,11 +206,11 @@ target_link_libraries(nextcloudsync
OpenSSL::Crypto OpenSSL::Crypto
OpenSSL::SSL OpenSSL::SSL
${OS_SPECIFIC_LINK_LIBRARIES} ${OS_SPECIFIC_LINK_LIBRARIES}
Qt5::Core Qt::Core
Qt5::Network Qt::Network
Qt5::WebSockets Qt::WebSockets
Qt5::Xml Qt::Xml
Qt5::Sql Qt::Sql
KF5::Archive KF5::Archive
) )
@ -225,7 +225,8 @@ find_package(Qt5 REQUIRED COMPONENTS Gui Widgets Svg)
target_link_libraries(nextcloudsync PUBLIC Qt5::Gui Qt5::Widgets Qt5::Svg) target_link_libraries(nextcloudsync PUBLIC Qt5::Gui Qt5::Widgets Qt5::Svg)
if (NOT TOKEN_AUTH_ONLY) if (NOT TOKEN_AUTH_ONLY)
target_link_libraries(nextcloudsync PUBLIC qt5keychain) find_package(Qt${QT_MAJOR_VERSION} COMPONENTS REQUIRED Widgets Svg)
target_link_libraries(nextcloudsync PUBLIC Qt::Widgets Qt::Svg qt5keychain)
endif() endif()
if(Inotify_FOUND) if(Inotify_FOUND)

View File

@ -185,7 +185,7 @@ endif()
add_dependencies(CfApiShellExtensions CustomStateProviderImpl) add_dependencies(CfApiShellExtensions CustomStateProviderImpl)
target_link_libraries(CfApiShellExtensions shlwapi Gdiplus onecoreuap Nextcloud::csync Qt5::Core Qt5::Network) target_link_libraries(CfApiShellExtensions shlwapi Gdiplus onecoreuap Nextcloud::csync Qt::Core Qt::Network)
target_include_directories(CfApiShellExtensions PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(CfApiShellExtensions PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(CfApiShellExtensions PRIVATE ${GeneratedFilesPath}) target_include_directories(CfApiShellExtensions PRIVATE ${GeneratedFilesPath})

View File

@ -15,7 +15,7 @@ add_library(testutils
activitylistmodeltestutils.cpp activitylistmodeltestutils.cpp
) )
target_link_libraries(testutils PUBLIC Nextcloud::sync Qt5::Test) target_link_libraries(testutils PUBLIC Nextcloud::sync Qt::Test)
target_include_directories(testutils PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(testutils PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties(testutils PROPERTIES FOLDER Tests) set_target_properties(testutils PROPERTIES FOLDER Tests)

View File

@ -14,7 +14,7 @@ include_directories(
add_library(${TORTURE_LIBRARY} STATIC torture.c cmdline.c) add_library(${TORTURE_LIBRARY} STATIC torture.c cmdline.c)
target_link_libraries(${TORTURE_LIBRARY} ${CMOCKA_LIBRARIES}) target_link_libraries(${TORTURE_LIBRARY} ${CMOCKA_LIBRARIES})
set(TEST_TARGET_LIBRARIES ${TORTURE_LIBRARY} Qt5::Core Nextcloud::csync) set(TEST_TARGET_LIBRARIES ${TORTURE_LIBRARY} Qt::Core Nextcloud::csync)
# create tests # create tests

View File

@ -1,4 +1,9 @@
find_package(Qt5 COMPONENTS Core Test Xml Network Qml Quick REQUIRED) if (Qt6_FOUND)
find_package(Qt6 COMPONENTS REQUIRED Core Test Xml Network Qml Quick)
else()
set(REQUIRED_QT_VERSION "5.15.0")
find_package(Qt5 ${REQUIRED_QT_VERSION} COMPONENTS REQUIRED Core Test Xml Network Qml Quick)
endif()
macro(nextcloud_build_test test_class) macro(nextcloud_build_test test_class)
set(CMAKE_AUTOMOC TRUE) set(CMAKE_AUTOMOC TRUE)
@ -13,8 +18,8 @@ macro(nextcloud_build_test test_class)
testutils testutils
nextcloudCore nextcloudCore
cmdCore cmdCore
Qt5::Test Qt::Test
Qt5::Quick Qt::Quick
) )
if (WIN32) if (WIN32)
@ -50,8 +55,8 @@ macro(nextcloud_add_test test_class)
testutils testutils
nextcloudCore nextcloudCore
cmdCore cmdCore
Qt5::Test Qt::Test
Qt5::Quick Qt::Quick
) )
if (WIN32) if (WIN32)
@ -99,10 +104,10 @@ macro(nextcloud_add_benchmark test_class)
testutils testutils
nextcloudCore nextcloudCore
cmdCore cmdCore
Qt5::Core Qt::Core
Qt5::Test Qt::Test
Qt5::Xml Qt::Xml
Qt5::Network Qt::Network
) )
IF(BUILD_UPDATER) IF(BUILD_UPDATER)