Improve compatibility with new CMake macro

Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Raits 2020-07-08 16:53:52 +02:00
parent 81405c7c30
commit 95e6e35f73
No known key found for this signature in database
GPG Key ID: 115D5AB89C5C1E1E

View File

@ -1,3 +1,4 @@
%undefine __cmake_in_source_build
## 1.11 currently disables tests with BUILD_SHARED_LIBS=ON
#bcond_without tests
@ -68,28 +69,25 @@ Files needed when building software with %{name}.
%build
mkdir %{_target_platform}
pushd %{_target_platform}
%{cmake} .. \
%{cmake} \
%if %{with tests}
-DBUILD_TESTS:BOOL=ON \
%endif
-DCMAKE_BUILD_TYPE:STRING="Release"
popd
%make_build -C %{_target_platform}
%cmake_build
%if %{with doc}
make docs -C %{_target_platform}
%cmake_build --target docs
%endif
%install
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
%cmake_install
%if %{with doc}
rm -fr %{apidocdir} ; mkdir %{apidocdir}
cp -a %{_target_platform}/doc/html/ %{apidocdir}/
cp -a %{_vpath_builddir}/doc/html/ %{apidocdir}/
ln -s html/index.html %{apidocdir}
find %{apidocdir} -name '*.md5' | xargs rm -fv
%endif
@ -102,7 +100,7 @@ test "$(pkg-config --modversion taglib_c)" = "%{version}"
%if %{with tests}
#ln -s ../../tests/data %{_target_platform}/tests/
#LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH \
make check -C %{_target_platform}
%ctest
%endif
%ldconfig_scriptlets