https://bugs.kde.org/show_bug.cgi?id=527990
Bug ID: 527990
Summary: `message(ERROR ...)` in RulesLibJpeg.cmake is not a
valid CMake severity — the "libjpeg >= 8 required for
DNG" check neither fails nor warns
Classification: Applications
Product: digikam
Version First 8.5.0
Reported In:
Platform: Compiled Sources
OS: Linux
Status: REPORTED
Severity: minor
Priority: NOR
Component: Portability-Cmake
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
DESCRIPTION
Since commit 8e8b39bcef (bug 491888), core/cmake/rules/RulesLibJpeg.cmake runs
this when the detected system libjpeg API is below 8:
message(ERROR "The Libjpeg API is less than 8.0. At least libjpeg >= 8 is
required to support DNG compression.")
CMake's message() has no ERROR mode. The recognized severities are FATAL_ERROR,
SEND_ERROR, WARNING, AUTHOR_WARNING, DEPRECATION, NOTICE, STATUS, VERBOSE,
DEBUG and TRACE; an unrecognized first argument is treated as part of the
message text. The check therefore produces only a malformed plain line and
configuration succeeds.
STEPS TO REPRODUCE
1. On a Linux system whose libjpeg presents the pre-8 API (any stock
distribution libjpeg-turbo in its default 62-ABI mode; here: Fedora 44,
libjpeg-turbo 3.1.3, JPEG_LIB_VERSION 62 in /usr/include/jconfig.h), check out
current git master (observed at f71b8610e2, 2026-10-22; the same code ships in
every release since 8.5.0).
2. Configure a build (e.g. cmake -S . -B build with the usual options, or the
repository's bootstrap wrapper).
3. Inspect the configure output for the libjpeg check and note the exit status
of the configure run.
OBSERVED RESULT
Configuration prints a malformed line that is neither a CMake Error nor a
warning:
ERRORThe Libjpeg API is less than 8.0. At least libjpeg >= 8 is required to
support DNG compression.
and then completes successfully (exit 0) — verified with CMake 4.3.0 against
libjpeg-turbo 3.1.3 (JPEG_LIB_VERSION 62).
The stated requirement is not enforced, and JPEG8_FOUND is left undefined
(8e8b39bcef also removed the set(JPEG8_FOUND FALSE) from that branch), so
RulesLibraw.cmake compiles LibRaw without USE_JPEG8 and with
LIBRAW_USE_DNGLOSSYCODEC=0. The Adobe lossy-DNG degradation from bug 491888
therefore still exists for such builds, silently: lossy-compressed DNGs fail to
load and can be misdetected as TIFF, with no visible notice.
EXPECTED RESULT
The line was added to signal an unmet hard requirement (commit message: "set
libjpeg version dependency to 8.0 or later for DNG support"; Mainpage.dox:
"jpeglib >= 8.0 required by RawEngine for DNG support"). Instead of the
malformed no-op, configuration should either stop with a genuine CMake Error
(FATAL_ERROR / SEND_ERROR semantics), or — if builds against a pre-8 libjpeg
are meant to remain supported, as they are on most distributions whose
libjpeg-turbo offers only the 62 API — emit a properly formatted CMake Warning.
Today neither happens.
SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 44
KDE Plasma Version: 6.7.5
KDE Frameworks Version: 6.31.0
Qt Version: 6.11.2
ADDITIONAL INFORMATION
The bug is in the configure stage, so the toolchain matters more than the
desktop versions above: CMake 4.3.0, libjpeg-turbo 3.1.3 (JPEG_LIB_VERSION 62),
digiKam git master f71b8610e2.
Affected range: introduced by commit 8e8b39bcef (2024-08-28) during the 8.5.0
development cycle. git tag --contains 8e8b39bcef yields v8.5.0 through v9.1.0,
and the current release 9.2.0 contains the line as well, so the report is filed
against 8.5.0, the earliest affected version.
The official bundles are unaffected (AppImage and Windows use libjpeg-turbo
built with --with-jpeg8, macOS uses MacPorts libjpeg 9f), so today the no-op
only hides the limitation from source builders.
Possible resolutions (happy to provide a patch for whichever is preferred):
1. message(FATAL_ERROR ...) — enforces the documented requirement, but fails
configuration for any self-build against a distribution libjpeg-turbo, which
offers only the 62 API on most distributions (Fedora, for example, has no
jpeg8-flavored package).
2. message(SEND_ERROR ...) — same requirement, but configuration continues and
reports all problems before generation stops.
3. message(WARNING ...) plus restoring set(JPEG8_FOUND FALSE) on that branch —
keeps Linux self-builds working while making the disabled lossy-DNG support
visible. This matches the existing pattern in MacroOpenCV.cmake for a mandatory
dependency found below its required version (message(WARNING ...) +
set(OpenCV_FOUND FALSE)).
--
You are receiving this mail because:
You are watching all bug changes.