]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
Fix opencv build
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Thu, 29 Sep 2022 08:51:48 +0000 (10:51 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Thu, 29 Sep 2022 08:51:48 +0000 (10:51 +0200)
applications/SALOME-master-native.pyconf
products/compil_scripts/opencv.sh
products/opencv.pyconf
products/patches/opencv-3.2.0-python2-cmake-3.17.5.patch [deleted file]
products/patches/opencv-3.2.0-python2-cmake.patch [new file with mode: 0644]

index a5f1ab0ef52956f78df65a3bea070bdd3c717cb8..c379b260ee498429260201840d569b8f2f7f3ad1 100644 (file)
@@ -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'             }
index 7a6e3082569bc13174a7348ce8c7797d828c6e9d..94a0f45593f73f1c8e926be2c5fe7ac64c6e0576 100755 (executable)
@@ -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"
index bb4105e72ec99ee261faa1621a2f7cffa9ba59c0..d16b64a658f2cbb6f2723428973317546c1bf571 100644 (file)
@@ -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-3.17.5.patch
deleted file mode 100644 (file)
index e67a7f2..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-diff -Naur opencv-3.2.0_ref/cmake/OpenCVDetectPython.cmake opencv-3.2.0_new/cmake/OpenCVDetectPython.cmake
---- opencv-3.2.0_ref/cmake/OpenCVDetectPython.cmake    2019-07-16 15:47:28.000000000 +0200
-+++ opencv-3.2.0_new/cmake/OpenCVDetectPython.cmake    2021-06-02 09:20:21.956927178 +0200
-@@ -222,13 +222,7 @@
- endif()
- endfunction(find_python)
--find_python(2.7 "${MIN_VER_PYTHON2}" PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR
--    PYTHON2INTERP_FOUND PYTHON2_EXECUTABLE PYTHON2_VERSION_STRING
--    PYTHON2_VERSION_MAJOR PYTHON2_VERSION_MINOR PYTHON2LIBS_FOUND
--    PYTHON2LIBS_VERSION_STRING PYTHON2_LIBRARIES PYTHON2_LIBRARY
--    PYTHON2_DEBUG_LIBRARIES PYTHON2_LIBRARY_DEBUG PYTHON2_INCLUDE_PATH
--    PYTHON2_INCLUDE_DIR PYTHON2_INCLUDE_DIR2 PYTHON2_PACKAGES_PATH
--    PYTHON2_NUMPY_INCLUDE_DIRS PYTHON2_NUMPY_VERSION)
-+SET(PYTHON2INTERP_FOUND FALSE)
- find_python(3.4 "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR
-     PYTHON3INTERP_FOUND PYTHON3_EXECUTABLE PYTHON3_VERSION_STRING
diff --git a/products/patches/opencv-3.2.0-python2-cmake.patch b/products/patches/opencv-3.2.0-python2-cmake.patch
new file mode 100644 (file)
index 0000000..e67a7f2
--- /dev/null
@@ -0,0 +1,18 @@
+diff -Naur opencv-3.2.0_ref/cmake/OpenCVDetectPython.cmake opencv-3.2.0_new/cmake/OpenCVDetectPython.cmake
+--- opencv-3.2.0_ref/cmake/OpenCVDetectPython.cmake    2019-07-16 15:47:28.000000000 +0200
++++ opencv-3.2.0_new/cmake/OpenCVDetectPython.cmake    2021-06-02 09:20:21.956927178 +0200
+@@ -222,13 +222,7 @@
+ endif()
+ endfunction(find_python)
+-find_python(2.7 "${MIN_VER_PYTHON2}" PYTHON2_LIBRARY PYTHON2_INCLUDE_DIR
+-    PYTHON2INTERP_FOUND PYTHON2_EXECUTABLE PYTHON2_VERSION_STRING
+-    PYTHON2_VERSION_MAJOR PYTHON2_VERSION_MINOR PYTHON2LIBS_FOUND
+-    PYTHON2LIBS_VERSION_STRING PYTHON2_LIBRARIES PYTHON2_LIBRARY
+-    PYTHON2_DEBUG_LIBRARIES PYTHON2_LIBRARY_DEBUG PYTHON2_INCLUDE_PATH
+-    PYTHON2_INCLUDE_DIR PYTHON2_INCLUDE_DIR2 PYTHON2_PACKAGES_PATH
+-    PYTHON2_NUMPY_INCLUDE_DIRS PYTHON2_NUMPY_VERSION)
++SET(PYTHON2INTERP_FOUND FALSE)
+ find_python(3.4 "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR
+     PYTHON3INTERP_FOUND PYTHON3_EXECUTABLE PYTHON3_VERSION_STRING