From 28141d4131ab2180852665cd43b2022aa5d0b8a5 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Tue, 5 Nov 2024 19:18:56 +0800 Subject: [PATCH] change __cmake_builddir definition based on numeric comparision --- cmake.spec | 6 +++++- macros.cmake.in | 16 +++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/cmake.spec b/cmake.spec index 7f97af7..6f6b392 100644 --- a/cmake.spec +++ b/cmake.spec @@ -28,7 +28,7 @@ Name: cmake Version: 3.27.9 %global major_version %(echo %{version} | awk -F. '{print $1}') -Release: 6 +Release: 7 Summary: Cross-platform make system License: BSD-3-Clause AND MIT-open-group AND Zlib URL: http://www.cmake.org @@ -316,6 +316,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %exclude %{_pkgdocdir}/Copyright.txt %changelog +* Tue Nov 05 2024 Funda Wang - 3.27.9-7 +- change __cmake_builddir definition based on numeric comparision +- force define source and binary directory + * Mon Sep 02 2024 Funda Wang - 3.27.9-6 - make use of _vpath_builddir, but default to in source build for backward compatibility - enable check section diff --git a/macros.cmake.in b/macros.cmake.in index e50a99e..cddccd9 100644 --- a/macros.cmake.in +++ b/macros.cmake.in @@ -11,7 +11,17 @@ %_cmake_version @@CMAKE_VERSION@@ %__cmake /usr/bin/cmake %__ctest /usr/bin/ctest -%__cmake_builddir %{!?__cmake_in_source_build:%{_vpath_builddir}}%{?__cmake_in_source_build:.} +%__cmake_builddir %{lua: + if rpm.expand('%{__cmake_in_source_build}') == '%{__cmake_in_source_build}' then + print(rpm.expand('%{_vpath_builddir}')) + else + if rpm.expand('%{__cmake_in_source_build}') == '0' then + print(rpm.expand('%{_vpath_builddir}')) + else + print(".") + end + end +} %_cmake_module_linker_flags %(echo %build_ldflags|sed -e 's#-Wl,--no-undefined##') # - Set default compile flags @@ -24,8 +34,8 @@ %cmake \ %{set_build_flags} \ %__cmake \\\ - %{!?__cmake_in_source_build:-S "%{_vpath_srcdir}"} \\\ - %{!?__cmake_in_source_build:-B "%{__cmake_builddir}"} \\\ + -S "%{_vpath_srcdir}" \\\ + -B "%{__cmake_builddir}" \\\ -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ -- Gitee