[packages/opencv] workaround for ccache builds
glen
glen at pld-linux.org
Sat May 17 20:28:16 CEST 2014
commit ea26b025ecc28ad82afad772f3f6dcd8b21c4ba1
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sat May 17 21:26:10 2014 +0300
workaround for ccache builds
opencv.spec | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/opencv.spec b/opencv.spec
index c58b867..19dec10 100644
--- a/opencv.spec
+++ b/opencv.spec
@@ -127,9 +127,6 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define sover %(v=%{version}; k=${v#?.?.?}; echo ${v%$k})
-# build broken, can't find g++
-%undefine with_ccache
-
%description
OpenCV (Open Source Computer Vision) is a library of programming
functions mainly aimed at real time computer vision.
@@ -263,7 +260,20 @@ Wiązania Pythona do OpenCV.
%build
install -d build
cd build
+
+# handle cmake & ccache
+# http://stackoverflow.com/questions/1815688/how-to-use-ccache-with-cmakec
+if [[ "%{__cc}" = *ccache* ]]; then
+ cc="%{__cc}"
+ cxx="%{__cxx}"
+ ccache="
+ -DCMAKE_C_COMPILER="ccache" -DCMAKE_C_COMPILER_ARG1="${cc#ccache }" \
+ -DCMAKE_CXX_COMPILER="ccache" -DCMAKE_CXX_COMPILER_ARG1="${cxx#ccache }" \
+ "
+fi
+
%cmake .. \
+ $ccache \
-DENABLE_AVX=%{?with_avx:ON}%{!?with_avx:OFF} \
-DENABLE_SSE=%{?with_sse:ON}%{!?with_sse:OFF} \
-DENABLE_SSE2=%{?with_sse2:ON}%{!?with_sse2:OFF} \
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/opencv.git/commitdiff/835e0cddf845974cb2f802856da2a57b4843bb4a
More information about the pld-cvs-commit
mailing list