diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bfa1ff0d..da2ee9481 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -338,10 +338,17 @@ optional_component(SPARKLE ON "Sparkle integration" DEPENDS "Sparkle" SPARKLE ) -optional_component(TRANSLATIONS ON "Translations" - DEPENDS "gettext" GETTEXT_FOUND - DEPENDS "Qt5LinguistTools" Qt5LinguistTools_FOUND -) +if(WITH_QT6) + optional_component(TRANSLATIONS ON "Translations" + DEPENDS "gettext" GETTEXT_FOUND + DEPENDS "Qt6LinguistTools" Qt6LinguistTools_FOUND + ) +else() + optional_component(TRANSLATIONS ON "Translations" + DEPENDS "gettext" GETTEXT_FOUND + DEPENDS "Qt5LinguistTools" Qt5LinguistTools_FOUND + ) +endif() optional_component(SUBSONIC ON "Subsonic support") optional_component(TIDAL ON "Tidal support") diff --git a/cmake/Translations.cmake b/cmake/Translations.cmake index a3ae0ab71..5794f38d5 100644 --- a/cmake/Translations.cmake +++ b/cmake/Translations.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.0) find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext) if(NOT GETTEXT_XGETTEXT_EXECUTABLE) @@ -73,5 +73,9 @@ macro(add_po outfiles po_prefix) file(APPEND ${_qrc} "${po_prefix}${_lang}.qm") endforeach(_lang) file(APPEND ${_qrc} "") - qt5_add_resources(${outfiles} ${_qrc}) + if(WITH_QT6) + qt6_add_resources(${outfiles} ${_qrc}) + else() + qt5_add_resources(${outfiles} ${_qrc}) + endif() endmacro(add_po)