From 4ba4aa15535111058a36cebddd3614094a9c187d Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Thu, 29 Sep 2022 10:51:48 +0200 Subject: [PATCH] Fix opencv build --- applications/SALOME-master-native.pyconf | 1 + products/compil_scripts/opencv.sh | 8 ++++++-- products/opencv.pyconf | 2 +- ...make-3.17.5.patch => opencv-3.2.0-python2-cmake.patch} | 0 4 files changed, 8 insertions(+), 3 deletions(-) rename products/patches/{opencv-3.2.0-python2-cmake-3.17.5.patch => opencv-3.2.0-python2-cmake.patch} (100%) diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index a5f1ab0..c379b26 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -236,6 +236,7 @@ __overwrite__ : # - Qt minimal version 5.12 # - xmlpatterns executable __condition__ : "VARS.dist in ['DB10']" + 'APPLICATION.products.cmake': '3.24.2' 'APPLICATION.products.opencv': '3.2.0' 'APPLICATION.products.cminpack': 'native' 'APPLICATION.products.PyFMI' : {tag:'2.6', base: 'no', section: 'version_2_6_no_pip' } diff --git a/products/compil_scripts/opencv.sh b/products/compil_scripts/opencv.sh index 7a6e308..94a0f45 100755 --- a/products/compil_scripts/opencv.sh +++ b/products/compil_scripts/opencv.sh @@ -19,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" @@ -27,7 +33,6 @@ 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_DIST="$DIST_NAME$DIST_VERSION" LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" case $LINUX_DISTRIBUTION in FD34|FD35|FD36|UB22*) @@ -41,7 +46,6 @@ 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" diff --git a/products/opencv.pyconf b/products/opencv.pyconf index bb4105e..d16b64a 100644 --- a/products/opencv.pyconf +++ b/products/opencv.pyconf @@ -38,7 +38,7 @@ default_win: version_3_2_0 : { - patches : ["opencv-3.2.0-ccache.patch", "SPNS-29988-opencv-3.2.0-persistence.patch"] + patches : ["opencv-3.2.0-ccache.patch", "SPNS-29988-opencv-3.2.0-persistence.patch", "opencv-3.2.0-python2-cmake.patch"] } version_3_2_0_win : diff --git a/products/patches/opencv-3.2.0-python2-cmake-3.17.5.patch b/products/patches/opencv-3.2.0-python2-cmake.patch similarity index 100% rename from products/patches/opencv-3.2.0-python2-cmake-3.17.5.patch rename to products/patches/opencv-3.2.0-python2-cmake.patch -- 2.39.2