From 11fd82b4c3d1cbaae5f5754c0baae349c73bcebb Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Mon, 20 Jul 2020 12:09:10 +0200 Subject: [PATCH] Improve compatibility with new CMake macro Signed-off-by: Igor Raits --- double-conversion.spec | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/double-conversion.spec b/double-conversion.spec index d57ce23..8d9bcf3 100644 --- a/double-conversion.spec +++ b/double-conversion.spec @@ -1,3 +1,4 @@ +%undefine __cmake_in_source_build %bcond_without static_libs # don't build static libraries Summary: Library providing binary-decimal and decimal-binary routines for IEEE doubles @@ -39,35 +40,27 @@ Static %{name} library. %setup -q %build -mkdir -p build-shared -pushd build-shared - %cmake -DBUILD_TESTING=ON .. - make %{_smp_mflags} -popd +%global _vpath_builddir build-shared +%cmake -DBUILD_TESTING=ON +%cmake_build %if %{with static_libs} -mkdir -p build-static -pushd build-static - CXXFLAGS="%{optflags} -fPIC" %cmake -DBUILD_SHARED_LIBS=NO .. - make %{_smp_mflags} -popd +%global _vpath_builddir build-static +CXXFLAGS="%{optflags} -fPIC" %cmake -DBUILD_SHARED_LIBS=NO +%cmake_build %endif %install %if %{with static_libs} -pushd build-static - make install DESTDIR=%{buildroot} -popd +%global _vpath_builddir build-static +%cmake_install %endif -pushd build-shared - make install DESTDIR=%{buildroot} -popd +%global _vpath_builddir build-shared +%cmake_install %check -pushd build-shared - ctest -V -popd +%ctest %ldconfig_scriptlets