kde: ECMPoQmTools — make LinguistTools optional (cross-build without qttools)
ecm_process_po_files_as_qm() did find_package(Qt6 COMPONENTS LinguistTools REQUIRED) for lrelease/lconvert. Those live in qttools, which is not in the Redox cross toolchain, so every KDE package that installs translations failed to configure (Qt6_FOUND=FALSE). Use OPTIONAL_COMPONENTS (so a missing LinguistTools neither aborts nor registers as a required package the final feature_summary fails on) and return early when the tools are absent — .po -> .qm compilation is skipped and the app builds untranslated. Systemic: unblocks all KF6 packages.
This commit is contained in:
@@ -148,11 +148,21 @@ function(ecm_process_po_files_as_qm lang)
|
||||
message(FATAL_ERROR "ecm_process_po_files_as_qm() must be called with PO_FILES argument")
|
||||
endif()
|
||||
|
||||
# Find lrelease and lconvert
|
||||
# Find lrelease and lconvert. LinguistTools (lrelease/lconvert) live in
|
||||
# qttools, which is not part of the cross toolchain when building for Redox.
|
||||
# Use OPTIONAL_COMPONENTS so a missing LinguistTools neither aborts here nor
|
||||
# registers as a required package that the final feature_summary would fail
|
||||
# on. Without the tools, .po -> .qm translation compilation cannot run, so
|
||||
# skip it gracefully (the app is built untranslated).
|
||||
if (QT_MAJOR_VERSION EQUAL "5")
|
||||
find_package(Qt5LinguistTools CONFIG REQUIRED)
|
||||
find_package(Qt5LinguistTools CONFIG)
|
||||
else()
|
||||
find_package(Qt6 COMPONENTS LinguistTools CONFIG REQUIRED)
|
||||
find_package(Qt6 OPTIONAL_COMPONENTS LinguistTools CONFIG)
|
||||
endif()
|
||||
|
||||
if (NOT TARGET Qt${QT_MAJOR_VERSION}::lconvert AND NOT TARGET Qt${QT_MAJOR_VERSION}::lrelease)
|
||||
message(STATUS "ECMPoQmTools: LinguistTools unavailable; skipping .po -> .qm processing")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(TARGET Qt${QT_MAJOR_VERSION}::lconvert)
|
||||
|
||||
Reference in New Issue
Block a user