!19022 fix opencv install on python3.9

Merge pull request !19022 from zhoufeng/fix-py39-opencv-install
This commit is contained in:
zhangzhenghai 2021-06-28 16:03:45 +00:00 committed by Gitee
commit 627b18b293
1 changed files with 15 additions and 7 deletions

View File

@ -99,13 +99,21 @@ if(ENABLE_MINDDATA)
COMPONENT mindspore
)
endif()
install(FILES ${opencv_LIBPATH}/libopencv_core.so.4.2.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_core.so.4.2 COMPONENT mindspore)
install(FILES ${opencv_LIBPATH}/libopencv_imgcodecs.so.4.2.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_imgcodecs.so.4.2 COMPONENT mindspore)
install(FILES ${opencv_LIBPATH}/libopencv_imgproc.so.4.2.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_imgproc.so.4.2 COMPONENT mindspore)
if(PYTHON_VERSION MATCHES "3.8" OR PYTHON_VERSION MATCHES "3.7")
install(FILES ${opencv_LIBPATH}/libopencv_core.so.4.2.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_core.so.4.2 COMPONENT mindspore)
install(FILES ${opencv_LIBPATH}/libopencv_imgcodecs.so.4.2.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_imgcodecs.so.4.2 COMPONENT mindspore)
install(FILES ${opencv_LIBPATH}/libopencv_imgproc.so.4.2.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_imgproc.so.4.2 COMPONENT mindspore)
elseif(PYTHON_VERSION MATCHES "3.9")
install(FILES ${opencv_LIBPATH}/libopencv_core.so.4.5.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_core.so.4.5 COMPONENT mindspore)
install(FILES ${opencv_LIBPATH}/libopencv_imgcodecs.so.4.5.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_imgcodecs.so.4.5 COMPONENT mindspore)
install(FILES ${opencv_LIBPATH}/libopencv_imgproc.so.4.5.1
DESTINATION ${INSTALL_LIB_DIR} RENAME libopencv_imgproc.so.4.5 COMPONENT mindspore)
endif()
install(FILES ${tinyxml2_LIBPATH}/libtinyxml2.so.8.0.0
DESTINATION ${INSTALL_LIB_DIR} RENAME libtinyxml2.so.8 COMPONENT mindspore)