diff --git a/kf5-khtml.spec b/kf5-khtml.spec
index a97b77b..b181eec 100644
--- a/kf5-khtml.spec
+++ b/kf5-khtml.spec
@@ -1,3 +1,4 @@
+%undefine __cmake_in_source_build
%global framework khtml
Name: kf5-%{framework}
@@ -72,17 +73,13 @@ developing applications that use %{name}.
%autosetup -n %{framework}-%{version}
%build
-mkdir %{_target_platform}
-pushd %{_target_platform}
-%{cmake_kf5} .. \
+%{cmake_kf5} \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed"
-popd
-
-make %{?_smp_mflags} -C %{_target_platform}
+%cmake_build
%install
-make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
+%cmake_install
%find_lang khtml5_qt --with-qt --all-name