@ -122,6 +122,8 @@ endif()
if ( NOT " ${PYTHON}" STREQUAL " PYTHON" AND DEFINED OPENCV_ ${ PYTHON } _INSTALL_PATH )
set ( __python_binary_install_path "${OPENCV_${PYTHON}_INSTALL_PATH}" )
elseif ( OPENCV_SKIP_PYTHON_LOADER AND DEFINED ${ PYTHON } _PACKAGES_PATH )
set ( __python_binary_install_path "${${PYTHON}_PACKAGES_PATH}" )
else ( )
ocv_assert ( DEFINED OPENCV_PYTHON_INSTALL_PATH )
set ( __python_binary_install_path "${OPENCV_PYTHON_INSTALL_PATH}/${__python_loader_subdir}python-${${PYTHON}_VERSION_MAJOR}.${${PYTHON}_VERSION_MINOR}" )
@ -134,6 +136,8 @@ install(TARGETS ${the_module}
$ { P Y T H O N _ I N S T A L L _ A R C H I V E }
)
set ( __INSTALL_PATH_ ${ PYTHON } "${__python_binary_install_path}" CACHE INTERNAL "" ) # C M a k e s t a t u s
if ( NOT OPENCV_SKIP_PYTHON_LOADER )
ocv_assert ( DEFINED OPENCV_PYTHON_INSTALL_PATH )
if ( OpenCV_FOUND )
@ -143,12 +147,11 @@ if(NOT OPENCV_SKIP_PYTHON_LOADER)
endif ( )
set ( __python_loader_install_tmp_path "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/install/python_loader/" )
set ( OpenCV_PYTHON_LOADER_FULL_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${OPENCV_PYTHON_INSTALL_PATH}/cv2" )
if ( IS_ABSOLUTE "${OPENCV_PYTHON_INSTALL_PATH}" )
set ( OpenCV_PYTHON_INSTALL_PATH_RELATIVE_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/" )
set ( CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE "'${CMAKE_INSTALL_PREFIX}'" )
set ( CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE "'${OPENCV_PYTHON_INSTALL_PATH}/cv2'" )
else ( )
file ( RELATIVE_PATH OpenCV_PYTHON_INSTALL_PATH_RELATIVE_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/${OPENCV_PYTHON_INSTALL_PATH}/cv2" ${ CMAKE_INSTALL_PREFIX } )
set ( CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE "os.path.join(LOADER_DIR, '${OpenCV_PYTHON_INSTALL_PATH_RELATIVE_CONFIGCMAKE}')" )
set ( CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE "LOADER_DIR" )
endif ( )
if ( DEFINED ${ PYTHON } _VERSION_MINOR )
@ -167,7 +170,8 @@ if(NOT OPENCV_SKIP_PYTHON_LOADER)
if ( IS_ABSOLUTE __python_binary_install_path )
set ( CMAKE_PYTHON_EXTENSION_PATH "'${__python_binary_install_path}'" )
else ( )
set ( CMAKE_PYTHON_EXTENSION_PATH "os.path.join(${CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE}, '${__python_binary_install_path}')" )
file ( RELATIVE_PATH OpenCV_PYTHON_BINARY_RELATIVE_INSTALL_PATH "${OpenCV_PYTHON_LOADER_FULL_INSTALL_PATH}" "${CMAKE_INSTALL_PREFIX}/${__python_binary_install_path}" )
set ( CMAKE_PYTHON_EXTENSION_PATH "os.path.join(${CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE}, '${OpenCV_PYTHON_BINARY_RELATIVE_INSTALL_PATH}')" )
endif ( )
configure_file ( "${PYTHON_SOURCE_DIR}/package/template/config-x.y.py.in" "${__python_loader_install_tmp_path}/cv2/${__target_config}" @ONLY )
install ( FILES "${__python_loader_install_tmp_path}/cv2/${__target_config}" DESTINATION "${OPENCV_PYTHON_INSTALL_PATH}/cv2/" COMPONENT python )