opencv: update rule to compile opencv with tbb.

This commit is contained in:
Pedro Gonçalves 2017-05-30 13:19:39 +01:00
parent 741c21e41c
commit 8795a05ccb

View File

@ -24,6 +24,12 @@ maintainer=\
'Renato Caldas <rmsc@fe.up.pt>' 'Renato Caldas <rmsc@fe.up.pt>'
) )
post_unpack()
{
wget "http://lsts.pt/glued/tbb43_20141204oss_src.tgz"
mv tbb43_20141204oss_src.tgz "3rdparty/tbb/"
}
configure() configure()
{ {
LINKER_ADDED_FLAGS="-Wl,-rpath,${cfg_dir_rootfs}/usr/lib" LINKER_ADDED_FLAGS="-Wl,-rpath,${cfg_dir_rootfs}/usr/lib"
@ -31,26 +37,28 @@ configure()
mkdir -p ../build mkdir -p ../build
cd ../build cd ../build
${cfg_dir_toolchain}/usr/local/bin/cmake \ ${cfg_dir_toolchain}/usr/local/bin/cmake \
-DCMAKE_SYSTEM_NAME="Linux" \ -DCMAKE_SYSTEM_NAME="Linux" \
-DCMAKE_SYSTEM_PROCESSOR="$cfg_architecture" \ -DCMAKE_SYSTEM_PROCESSOR="$cfg_architecture" \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH="${cfg_dir_toolchain_sysroot}/usr ${cfg_dir_rootfs}/usr" \ -DCMAKE_FIND_ROOT_PATH="${cfg_dir_toolchain_sysroot}/usr ${cfg_dir_rootfs}/usr" \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \ -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \ -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_C_COMPILER="${cmd_target_cc}" \ -DCMAKE_C_COMPILER="${cmd_target_cc}" \
-DCMAKE_CXX_COMPILER="${cmd_target_cxx}" \ -DCMAKE_CXX_COMPILER="${cmd_target_cxx}" \
-DCMAKE_C_FLAGS="${cfg_target_gcc_flags}" \ -DCMAKE_C_FLAGS="${cfg_target_gcc_flags}" \
-DCMAKE_SHARED_LINKER_FLAGS="${LINKER_ADDED_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" \ -DCMAKE_SHARED_LINKER_FLAGS="${LINKER_ADDED_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" \
-DCMAKE_MODULE_LINKER_FLAGS="${LINKER_ADDED_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" \ -DCMAKE_MODULE_LINKER_FLAGS="${LINKER_ADDED_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" \
-DCMAKE_EXE_LINKER_FLAGS="${LINKER_ADDED_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" \ -DCMAKE_EXE_LINKER_FLAGS="${LINKER_ADDED_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" \
-DCMAKE_INSTALL_PREFIX="${cfg_dir_toolchain_sysroot}/usr" \ -DCMAKE_INSTALL_PREFIX="${cfg_dir_toolchain_sysroot}/usr" \
-DBUILD_DOCS=OFF \ -DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \ -DBUILD_EXAMPLES=OFF \
-DBUILD_PERF_TESTS=OFF \ -DBUILD_PERF_TESTS=OFF \
-DBUILD_SHARED_LIBS=ON \ -DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTS=OFF \ -DBUILD_TESTS=OFF \
-DBUILD_WITH_DEBUG_INFO=OFF \ -DBUILD_WITH_DEBUG_INFO=OFF \
../opencv-$version/ -DBUILD_TBB=ON \
-DWITH_TBB=ON \
../opencv-$version/
} }
build() build()
@ -75,4 +83,7 @@ target_install()
$cmd_target_strip -v "$f" -o "$cfg_dir_rootfs/usr/lib/$(basename "$f")" $cmd_target_strip -v "$f" -o "$cfg_dir_rootfs/usr/lib/$(basename "$f")"
fi fi
done done
$cmd_cp -r "${pkg_build_dir}/../build/lib/"libtbb.so "$cfg_dir_rootfs/usr/lib/"
$cmd_cp -r "${pkg_build_dir}/../build/lib/"libtbb.so "$cfg_dir_toolchain_sysroot/usr/lib/"
} }