Package: debhelper Tags: patch X-Debbugs-Cc: jspricke%40debian.org, roehl...@debian.org
Hi Niels et al, I noticed that disabling CTest for nocheck is a recurring pattern. Rather than patch lots of packages, maybe we could automate that in some central tool? I'm attaching a patch for your convenience. Helmut --- debhelper-compat-upgrade-checklist.pod | 5 +++++ lib/Debian/Debhelper/Buildsystem/cmake.pm | 4 ++++ 2 files changed, 9 insertions(+) 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()); -- 2.39.2