[Pkg-cmake-team] Bug#1114681: cmake: CMake-4 weirdness with CMAKE_INSTALL_LIBDIR
IOhannes m zmölnig (Debian/GNU)
umlaeute at debian.org
Mon Sep 8 13:57:28 BST 2025
Package: cmake
Version: 4.1.1+really4.1.1-1
Severity: normal
Dear Maintainer,
i recently went on to tackle #1112936 ('src:frei0r' FTBFS with cmake4),
and noticed a weirdness.
my package tries to force installation into /usr/lib/ (rather than
multi-arch specified /usr/lib/$(DEB_HOST_MULTIARCH)) for historic
reasons (dlopen()ed files are expected to be at a non-multiarch
location).
for this, my dh-based d/rules has
```make
override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_INSTALL_LIBDIR=lib
```
this works nicely with CMake-3.x.
however, for reasons unknown to me, the very same code with CMake-4.x
installs the files to /usr/lib/$(DEB_HOST_MULTIARCH)
now, if i run the actual commands generated by debhelper manually in my
sbuild environment, e.g.
```
cd obj-x86_64-linux-gnu && DEB_PYTHON_INSTALL_LAYOUT=deb PKG_CONFIG=/usr/bin/pkg-config cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DCMAKE_INSTALL_RUNSTATEDIR=/run -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DCMAKE_INSTALL_LIBDIR=lib ..
```
..., then it it appears to work OK ('make install' installs again into
the unqualified /usr/lib)
i have no idea what is going on here (and whether the bug is actually in
cmake or in debhelper).
for now, i've switched my package to installing into the default
(/usr/lib/$(DEB_HOST_MULTIARCH)) and using symlinks to keep
compatibility with host applications that dlopen() the files.
but I wonder what is going on...
More information about the Pkg-cmake-team
mailing list