From 7a624944f0c795c98d47ba4f7a0fbeedf088e221 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Sat, 4 Jul 2020 09:59:41 +0200 Subject: [PATCH] Improve compatibility with new CMake macro Signed-off-by: Igor Raits --- yaml-cpp.spec | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/yaml-cpp.spec b/yaml-cpp.spec index 575c9f0..fb2572c 100644 --- a/yaml-cpp.spec +++ b/yaml-cpp.spec @@ -41,29 +41,23 @@ The %{name}-static package contains the static library for %{name}. %build -rm -rf build_shared && mkdir build_shared -rm -rf build_static && mkdir build_static - -pushd build_shared -%cmake -DYAML_CPP_BUILD_TOOLS=OFF \ +%cmake -B build_shared \ + -DYAML_CPP_BUILD_TOOLS=OFF \ -DYAML_BUILD_SHARED_LIBS=ON \ -DYAML_CPP_BUILD_TESTS=OFF \ - ../ -%make_build -popd + %{nil} +%make_build -C build_shared -pushd build_static -%cmake -DYAML_CPP_BUILD_TOOLS=OFF \ +%cmake -B build_static \ + -DYAML_CPP_BUILD_TOOLS=OFF \ -DYAML_BUILD_SHARED_LIBS=OFF \ -DYAML_CPP_BUILD_TESTS=OFF \ - ../ -%make_build + %{nil} +%make_build -C build_static %install -pushd build_static -%make_install yaml-cpp -popd +%make_install -C build_static yaml-cpp # Move files so they don't get trampled mv %{buildroot}%{_libdir}/cmake/%{name} \ @@ -72,8 +66,7 @@ mv %{buildroot}%{_libdir}/pkgconfig/%{name}.pc \ %{buildroot}%{_libdir}/pkgconfig/%{name}-static.pc -pushd build_shared -%make_install +%make_install -C build_shared %ldconfig_scriptlets