From 77b93ad1b920705814fa0d553b3b7cc49565b656 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 13 Jan 2023 05:01:20 -0500 Subject: [PATCH] Adjust ctest macro to use native out-of-tree support With CMake 3.20, ctest(1) learned how to be told where the generated working directory is, so we no longer have to change directories (and thus, rely on shell semantics to get back out of that directory) to make CTest work properly. This change tweaks the %ctest macro such that we are leveraging that new option and eliminates our usage of cd(1) as a workaround. --- cmake.spec | 5 ++++- macros.cmake | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake.spec b/cmake.spec index ee7c5fa..7886a6b 100644 --- a/cmake.spec +++ b/cmake.spec @@ -68,7 +68,7 @@ %{?rcsuf:%global versuf -%{rcsuf}} # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 1 +%global baserelease 2 # Uncomment if building for EPEL #global name_suffix %%{major_version} @@ -525,6 +525,9 @@ popd %changelog +* Fri Jan 13 2023 Neal Gompa - 3.25.1-2 +- Adjust ctest macro to use native out-of-tree support + * Mon Dec 05 2022 Björn Esser - 3.25.1-1 - cmake-3.25.1 Fixes rhbz#2149681 diff --git a/macros.cmake b/macros.cmake index 257f0bd..63860a0 100644 --- a/macros.cmake +++ b/macros.cmake @@ -51,9 +51,7 @@ DESTDIR="%{buildroot}" %__cmake --install "%{__cmake_builddir}" %ctest(:-:h:j:u:v:A:C:D:E:F:H:I:L:M:N:O:Q:R:S:T:U:V:) \ - cd "%{__cmake_builddir}" \ - %__ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} %{**} \ - cd - + %__ctest --test-dir "%{__cmake_builddir}" --output-on-failure --force-new-ctest-process %{?_smp_mflags} %{**} %cmake@@CMAKE_MAJOR_VERSION@@ %cmake