summaryrefslogtreecommitdiffstats
path: root/lib/Debian/Debhelper/Buildsystem/cmake.pm
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:17:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-26 10:17:26 +0000
commit36b03e2bee4497aef85033f4f900f5d89d5dc55e (patch)
treeec9a0e0972bd08cc628efaa53161b44f9361dd37 /lib/Debian/Debhelper/Buildsystem/cmake.pm
parentAdding debian version 13.16. (diff)
downloaddebhelper-36b03e2bee4497aef85033f4f900f5d89d5dc55e.tar.xz
debhelper-36b03e2bee4497aef85033f4f900f5d89d5dc55e.zip
Merging upstream version 13.17.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/Debian/Debhelper/Buildsystem/cmake.pm')
-rw-r--r--lib/Debian/Debhelper/Buildsystem/cmake.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Debian/Debhelper/Buildsystem/cmake.pm b/lib/Debian/Debhelper/Buildsystem/cmake.pm
index cafc743..42e4cac 100644
--- a/lib/Debian/Debhelper/Buildsystem/cmake.pm
+++ b/lib/Debian/Debhelper/Buildsystem/cmake.pm
@@ -79,9 +79,15 @@ sub new {
return $this;
}
+sub _get_pkgconf {
+ my $toolprefix = is_cross_compiling() ? dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-" : "";
+ return "/usr/bin/" . $toolprefix . "pkg-config";
+}
+
sub _get_cmake_env {
my $update_env = {};
$update_env->{DEB_PYTHON_INSTALL_LAYOUT} = 'deb' unless $ENV{DEB_PYTHON_INSTALL_LAYOUT};
+ $update_env->{PKG_CONFIG} = _get_pkgconf() unless $ENV{PKG_CONFIG};
return $update_env;
}
@@ -129,8 +135,8 @@ sub configure {
if (not $ENV{CXX}) {
push @flags, "-DCMAKE_CXX_COMPILER=" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-g++";
}
- push(@flags, "-DPKG_CONFIG_EXECUTABLE=/usr/bin/" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-pkg-config");
- push(@flags, "-DPKGCONFIG_EXECUTABLE=/usr/bin/" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-pkg-config");
+ push(@flags, "-DPKG_CONFIG_EXECUTABLE=" . _get_pkgconf());
+ push(@flags, "-DPKGCONFIG_EXECUTABLE=" . _get_pkgconf());
push(@flags, "-DQMAKE_EXECUTABLE=/usr/bin/" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "-qmake");
}
push(@flags, "-DCMAKE_INSTALL_LIBDIR=lib/" . dpkg_architecture_value("DEB_HOST_MULTIARCH"));