Improve compatibility with new CMake macro
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
This commit is contained in:
parent
80ace889df
commit
11fd82b4c3
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user