Sources compliation issues with Python

Hi everybody,

I have got some issues to compile OTB from sources at OTB configuration step. With OTB_WRAP_PYTHON set to ON or OFF the OTB-configure-err.log show me the same incomplete message :

CMake Error at CMakeLists.txt:108 (if):
   if given arguments:

     "OTB_WRAP_PYTHON" "AND" "(" "EQUAL" "2" ")" 
 Unknown arguments specified

Has anyone ever had the same problem?

Thanks!

Hi Cypal,
Yes, that is a bug. You do not have python install on your system, and it is not well handled. To fix this issue here is what you can do: in CMakeLists.txt remove line 108 to 111. And set OTB_WRAP_PYTHON to OFF. Do not hesitate if you have other issue, it is a use case we do not test!

Antoine

PS: if you are on a develop version I will push a fix quickly.

Hi Antoine,

I have Python working and cmake detect it. But “no matter”, comment this lines make the compilation works.

I still aware for the develop version fix :wink:
Thank you!

That is weird though… If python is detected I have no idea why you do not have a PYTHON_VERSION_MAJOR… Can you try to add a line after the find_package( PythonInterp )? something like:

message( "PYTHON_VERSION_STRING= ${PYTHON_VERSION_STRING}")
message( "PYTHON_VERSION_MAJOR= ${PYTHON_VERSION_MAJOR}")

What is the CMake version you are using?