summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2023-05-23 22:44:49 +0200
committerNiels Thykier <niels@thykier.net>2023-07-08 09:35:44 +0000
commitc82f57adf1a282b9b3c666a7a03d55c2b20757d3 (patch)
tree5159b09846d8c19f6aa87a455dda8bb5c8dfdb34
parent950761f439dd00ae1c6fb75c72dd589837b34c61 (diff)
cmake.pm: set -DBUILD_TESTING=OFF for nocheck builds
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r--debhelper-compat-upgrade-checklist.pod5
-rw-r--r--lib/Debian/Debhelper/Buildsystem/cmake.pm4
2 files changed, 9 insertions, 0 deletions
diff --git a/debhelper-compat-upgrade-checklist.pod b/debhelper-compat-upgrade-checklist.pod
index e9965258..1ddeba7e 100644
--- a/debhelper-compat-upgrade-checklist.pod
+++ b/debhelper-compat-upgrade-checklist.pod
@@ -107,6 +107,11 @@ B<cmake --install>, respectively, instead of B<ninja install> and B<make install
in the L<dh_auto_install(1)> call. Any override of B<dh_auto_install> that
passes extra parameters to the upstream build system should be reviewed.
+=item -
+
+The B<cmake> build system passes B<< -DBUILD_TESTING:BOOL=OFF >> to B<cmake>
+if B<DEB_BUILD_OPTIONS> contains B<nocheck> thus disabling CTest.
+
=back
=item v13
diff --git a/lib/Debian/Debhelper/Buildsystem/cmake.pm b/lib/Debian/Debhelper/Buildsystem/cmake.pm
index c4a2ad9c..2b793939 100644
--- a/lib/Debian/Debhelper/Buildsystem/cmake.pm
+++ b/lib/Debian/Debhelper/Buildsystem/cmake.pm
@@ -135,6 +135,10 @@ sub configure {
$ENV{CXXFLAGS} .= ' ' . $ENV{CPPFLAGS};
}
+ if (get_buildoption("nocheck") && ! compat(13)) {
+ push(@flags, "-DBUILD_TESTING:BOOL=OFF");
+ }
+
$this->mkdir_builddir();
eval {
$this->doit_in_builddir("cmake", @flags, @_, $this->get_source_rel2builddir());