X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=products%2Fcompil_scripts%2Fopencv.sh;h=94a0f45593f73f1c8e926be2c5fe7ac64c6e0576;hb=fad79a435baeb7e05a709ad2c35ef6416b3a9401;hp=237bfc4e6827fea8af51d5914b974e575e9c3a74;hpb=8294e6de2ef6727364e2b3138673175d06c5d05a;p=tools%2Fsat_salome.git diff --git a/products/compil_scripts/opencv.sh b/products/compil_scripts/opencv.sh index 237bfc4..94a0f45 100755 --- a/products/compil_scripts/opencv.sh +++ b/products/compil_scripts/opencv.sh @@ -5,7 +5,6 @@ echo "opencv" $VERSION echo "##########################################################################" function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; } - CMAKE_OPTIONS="" CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_INSTALL}" CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release" @@ -20,6 +19,12 @@ if version_ge $VERSION "3."; then CMAKE_OPTIONS+=" -DBUILD_opencv_java:BOOL=OFF" CMAKE_OPTIONS+=" -DPYTHON_INCLUDE_DIR=${PYTHON_ROOT_DIR}/include/python${PYTHON_VERSION}" CMAKE_OPTIONS+=" -DPYTHON_INCLUDE_DIR2=${PYTHON_ROOT_DIR}/include/python${PYTHON_VERSION}" + if [ "${SAT_Python_IS_NATIVE}" != "1" ] + then + CMAKE_OPTIONS+=" -DPython3_INCLUDE_DIR:STRING=${PYTHON_ROOT_DIR}/include/python${PYTHON_VERSION}" + CMAKE_OPTIONS+=" -DPython3_LIBRARY:STRING=${PYTHON_ROOT_DIR}/lib/libpython${PYTHON_VERSION}.so" + CMAKE_OPTIONS+=" -DPython3_EXECUTABLE=${PYTHON_ROOT_DIR}/bin/python${PYTHON_VERSION}" + fi CMAKE_OPTIONS+=" -DWITH_FFMPEG:BOOL=OFF" CMAKE_OPTIONS+=" -DWITH_LAPACK:BOOL=OFF" CMAKE_OPTIONS+=" -DWITH_CUDA:BOOL=OFF" @@ -28,13 +33,19 @@ if version_ge $VERSION "3."; then CMAKE_OPTIONS+=" -DENABLE_PRECOMPILED_HEADERS:BOOL=OFF" CMAKE_OPTIONS+=" -DCMAKE_CXX_FLAGS=-fPIC" CMAKE_OPTIONS+=" -DCMAKE_C_FLAGS=-fPIC" - + LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" + case $LINUX_DISTRIBUTION in + FD34|FD35|FD36|UB22*) + CMAKE_OPTIONS+=" -DCMAKE_CXX_FLAGS=\"-std=c++14\"" + CMAKE_OPTIONS+=" -DCMAKE_CXX_STANDARD=14" + ;; + esac + CMAKE_OPTIONS+=" -DCMAKE_C_FLAGS=-fPIC" # else echo "*** openCV version $VERSION < 3." CMAKE_OPTIONS+=" -DWITH_CUDA:BOOL=OFF" CMAKE_OPTIONS+=" -DWITH_FFMPEG:BOOL=OFF" - # OP opencv on Ubuntu CMAKE_OPTIONS+=" -DPYTHON_EXECUTABLE=${PYTHON_ROOT_DIR}/bin/python" CMAKE_OPTIONS+=" -DPYTHON_INCLUDE_DIRS=${PYTHON_ROOT_DIR}/include/python${PYTHON_VERSION}" CMAKE_OPTIONS+=" -DPYTHON_LIBRARY=${PYTHON_ROOT_DIR}/lib/libpython${PYTHON_VERSION}.so" @@ -46,6 +57,7 @@ rm -rf $BUILD_DIR mkdir -p $BUILD_DIR cd $BUILD_DIR +echo "*** cmake $CMAKE_OPTIONS $SOURCE_DIR" cmake $CMAKE_OPTIONS $SOURCE_DIR if [ $? -ne 0 ]