Commit 78ba686a authored by Antoine Regimbeau's avatar Antoine Regimbeau

PKG: default python is the one of OTB

parent 5f3f9902
......@@ -52,7 +52,7 @@ if( "${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
endif()
if(OTB_WRAP_PYTHON AND NOT PYTHON_EXECUTABLE)
find_package(PythonInterp REQUIRED)
find_package(PythonInterp 3 REQUIRED)
endif()
find_program(FILE_COMMAND NAMES "file")
......@@ -182,11 +182,6 @@ if(EXISTS "${SUPERBUILD_INSTALL_DIR}/lib/otb/python/_otbApplication${PYMODULE_EX
set(HAVE_PYTHON TRUE)
endif()
set(HAVE_PYTHON3 FALSE CACHE INTERNAL "Python3 wrappings")
if(EXISTS "${SUPERBUILD_INSTALL_DIR}/lib/otb/python3/_otbApplication${PYMODULE_EXT}")
set(HAVE_PYTHON3 TRUE)
endif()
set(HAVE_JAVA FALSE CACHE INTERNAL "Java wrappings")
if(EXISTS "${SUPERBUILD_INSTALL_DIR}/lib/otb/java/org.otb.application.jar")
set(HAVE_JAVA TRUE)
......
......@@ -40,17 +40,13 @@ python_version="$python_major_version.$python_minor_version.$python_patch_versio
python_check_failed() {
printf %s\\n "*****Error occurred during installation******"
printf %s\\n "OTB python bindings requires python2.6 or python2.7 but current detected python version is $python_version"
printf %s\\n "If you have python2.6 or Python2.7 installed in your system "
printf %s\\n "OTB python bindings require python3 but current detected python version is $python_version"
printf %s\\n "If you have python3 installed in your system "
printf %s\\n "You should set OTB_PYTHON_EXE and re-run this installation script."
printf %s\\n "eg: OTB_PYTHON_EXE=/path/to/python2.7 ./OTB-X.Y-Linux64.run"
printf %s\\n "eg: OTB_PYTHON_EXE=/path/to/python3 ./OTB-X.Y-Linux64.run"
exit 1
}
if [ "$python_major_version" -gt 2 ]; then
python_check_failed
fi
if [ "$python_minor_version" -lt 5 ]; then
if [ "$python_major_version" -gt 3 ]; then
python_check_failed
fi
......
......@@ -25,20 +25,15 @@ function(install_python_bindings)
PATTERN "__pycache__" EXCLUDE
)
endif()
if(HAVE_PYTHON3)
install(DIRECTORY ${SUPERBUILD_INSTALL_DIR}/lib/otb/python3
DESTINATION ${PKG_STAGE_DIR}/lib
PATTERN "*.pyc" EXCLUDE
PATTERN "__pycache__" EXCLUDE
)
endif()
# Handle GDAL python bindings
file(GLOB gdal_python_scripts "${SUPERBUILD_INSTALL_DIR}/bin/gdal*.py")
foreach(_script ${gdal_python_scripts})
install(PROGRAMS ${_script}
DESTINATION ${PKG_STAGE_DIR}/bin)
endforeach()
file(GLOB gdal_python_wrappings "${SUPERBUILD_INSTALL_DIR}/lib/python[2|3]*")
# file(GLOB gdal_python_wrappings "${SUPERBUILD_INSTALL_DIR}/lib/python[2|3]*")
# Do we need to get rid of gdal python 2 bindings too?
file(GLOB gdal_python_wrappings "${SUPERBUILD_INSTALL_DIR}/lib/python3*")
foreach(_wrap ${gdal_python_wrappings})
if (IS_DIRECTORY "${_wrap}")
install(DIRECTORY ${_wrap}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment