Commit d2c28a4c authored by Antoine Regimbeau's avatar Antoine Regimbeau

Cleaner code from review

parent 0e9dd332
Pipeline #318 passed with stage
in 27 minutes and 22 seconds
......@@ -102,28 +102,16 @@ repository_status(${PROJECT_SOURCE_DIR} OTB_GIT_STATUS_MESSAGE)
# Find python stuff
# Version 3 is prefered before 2
set (Python_ADDITIONAL_VERSIONS "3;2")
if ( OTB_WRAP_PYTHON )
find_package( PythonInterp REQUIRED )
if ( ${PYTHON_VERSION_MAJOR} EQUAL 2 )
message (WARNING "Python3 not found. There is no longer support of \
wrapping in python2 in OTB, but it can still be used.")
endif()
# Windows lib has two libs since python 3
# one is python3.lib the other is python35.lib
# we want python35.lib so we need to force it.
if ( (NOT UNIX) AND ${PYTHON_VERSION_MAJOR} EQUAL 3 )
unset( Python_ADDITIONAL_VERSIONS )
find_package ( PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} REQUIRED )
else()
find_package ( PythonLibs ${PYTHON_VERSION_MAJOR} REQUIRED )
endif()
else()
# If NOT OTB_WRAP_PYTHON we still need python for testing but it is okay if
# the find package fail
find_package ( PythonInterp QUIET )
find_package ( PythonLibs ${PYTHON_VERSION_MAJOR} QUIET )
set ( Python_ADDITIONAL_VERSIONS "3;2" )
set ( PythonInterp_FIND_REQUIRED ${OTB_WRAP_PYTHON} )
set ( PythonLibs_FIND_REQUIRED ${OTB_WRAP_PYTHON} )
find_package( PythonInterp )
if ( OTB_WRAP_PYTHON AND ( ${PYTHON_VERSION_MAJOR} EQUAL 2 ) )
message (WARNING "Python3 not found. There is no longer support of \
wrapping in python2 in OTB, but it can still be used.")
endif()
set (Python_ADDITIONAL_VERSIONS "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
find_package ( PythonLibs )
#-----------------------------------------------------------------------------
# Configure the default OTB_DATA_ROOT for the location of OTB Data.
......
......@@ -380,24 +380,16 @@ endforeach()
# -PYTHON_EXECUTABLE
# -PYTHON_INCLUDE_DIR
# -PYTHON_LIBRARY
# -NUMPY_INCLUDE_DIR
set (Python_ADDITIONAL_VERSIONS "3;2")
if ( OTB_WRAP_PYTHON )
find_package( PythonInterp REQUIRED )
if ( ${PYTHON_VERSION_MAJOR} EQUAL 2 )
set ( Python_ADDITIONAL_VERSIONS "3;2" )
set ( PythonInterp_FIND_REQUIRED ${OTB_WRAP_PYTHON} )
set ( PythonLibs_FIND_REQUIRED ${OTB_WRAP_PYTHON} )
find_package( PythonInterp )
if ( OTB_WRAP_PYTHON AND ( ${PYTHON_VERSION_MAJOR} EQUAL 2 ) )
message (WARNING "Python3 not found. There is no longer support of \
wrapping in python2 in OTB, but it can still be used.")
endif()
if ( (NOT UNIX) AND ${PYTHON_VERSION_MAJOR} EQUAL 3 )
unset( Python_ADDITIONAL_VERSIONS )
find_package ( PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} REQUIRED )
else()
find_package ( PythonLibs ${PYTHON_VERSION_MAJOR} REQUIRED )
endif()
else()
find_package( PythonInterp QUIET )
find_package ( PythonLibs ${PYTHON_VERSION_MAJOR} QUIET )
endif()
set (Python_ADDITIONAL_VERSIONS "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
find_package ( PythonLibs )
include(External_otb)
......
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