streamline find_package calls to really find Qt6
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>pull/4584/head
parent
aa76de9b68
commit
4566400ee6
|
@ -23,6 +23,9 @@ set(BIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
|
||||||
|
|
||||||
include(${CMAKE_SOURCE_DIR}/NEXTCLOUD.cmake)
|
include(${CMAKE_SOURCE_DIR}/NEXTCLOUD.cmake)
|
||||||
|
|
||||||
|
set(QT_VERSION_MAJOR "6")
|
||||||
|
set(REQUIRED_QT_VERSION "6.0.0")
|
||||||
|
|
||||||
# CfAPI Shell Extensions
|
# CfAPI Shell Extensions
|
||||||
set( CFAPI_SHELL_EXTENSIONS_LIB_NAME CfApiShellExtensions )
|
set( CFAPI_SHELL_EXTENSIONS_LIB_NAME CfApiShellExtensions )
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,19 @@ if (${QT_MAJOR_VERSION} STREQUAL "5")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR}WebEngineCore ${REQUIRED_QT_VERSION} CONFIG QUIET)
|
||||||
|
if(APPLE)
|
||||||
|
set_package_properties(Qt${QT_VERSION_MAJOR}WebEngineCore PROPERTIES
|
||||||
|
DESCRIPTION "Qt${QT_VERSION_MAJOR} WebEngineCore component."
|
||||||
|
TYPE RECOMMENDED
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
set_package_properties(Qt${QT_VERSION_MAJOR}WebEngine PROPERTIES
|
||||||
|
DESCRIPTION "Qt${QT_VERSION_MAJOR} WebEngine component."
|
||||||
|
TYPE REQUIRED
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(Qt${QT_MAJOR_VERSION}WebEngine_FOUND AND Qt${QT_MAJOR_VERSION}WebEngineWidgets_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()
|
||||||
|
|
|
@ -16,7 +16,7 @@ if(QUICK_COMPILER)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT TARGET Qt::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 Qt. It might be shipped as a separate package, please check that.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
|
@ -336,7 +336,7 @@ IF( APPLE )
|
||||||
list(APPEND updater_DEPS ${SPARKLE_LIBRARY})
|
list(APPEND updater_DEPS ${SPARKLE_LIBRARY})
|
||||||
|
|
||||||
# Sparkle.framework is installed from here because macdeployqt's CopyFramework breaks on this bundle
|
# Sparkle.framework is installed from here because macdeployqt's CopyFramework breaks on this bundle
|
||||||
# as its logic is tightly tailored around Qt5 frameworks
|
# as its logic is tightly tailored around Qt frameworks
|
||||||
install(DIRECTORY "${SPARKLE_LIBRARY}"
|
install(DIRECTORY "${SPARKLE_LIBRARY}"
|
||||||
DESTINATION "${OWNCLOUD_OSX_BUNDLE}/Contents/Frameworks" USE_SOURCE_PERMISSIONS)
|
DESTINATION "${OWNCLOUD_OSX_BUNDLE}/Contents/Frameworks" USE_SOURCE_PERMISSIONS)
|
||||||
|
|
||||||
|
@ -381,7 +381,7 @@ 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(Qt6 COMPONENTS LinguistTools)
|
find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} COMPONENTS LinguistTools)
|
||||||
if(Qt${QT_MAJOR_VERSION}LinguistTools_FOUND)
|
if(Qt${QT_MAJOR_VERSION}LinguistTools_FOUND)
|
||||||
qt_add_translation(client_I18N ${TRANSLATIONS})
|
qt_add_translation(client_I18N ${TRANSLATIONS})
|
||||||
endif()
|
endif()
|
||||||
|
@ -709,12 +709,7 @@ endif()
|
||||||
|
|
||||||
## handle DBUS for Fdo notifications
|
## handle DBUS for Fdo notifications
|
||||||
if( UNIX AND NOT APPLE )
|
if( UNIX AND NOT APPLE )
|
||||||
if (Qt6_FOUND)
|
find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} COMPONENTS 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_link_libraries(nextcloudCore PUBLIC Qt::DBus)
|
||||||
target_compile_definitions(nextcloudCore PUBLIC "USE_FDO_NOTIFICATIONS")
|
target_compile_definitions(nextcloudCore PUBLIC "USE_FDO_NOTIFICATIONS")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
if (Qt6_FOUND)
|
find_package(Qt6 ${REQUIRED_QT_VERSION} COMPONENTS REQUIRED Core Test Xml Network Qml Quick)
|
||||||
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)
|
||||||
|
|
Loading…
Reference in New Issue