Improve compatibility with new CMake macro

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Raits 2020-07-04 09:59:41 +02:00
parent fd76ebf327
commit 7a624944f0
No known key found for this signature in database
GPG Key ID: 115D5AB89C5C1E1E

View File

@ -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