MESSAGE(SEND_ERROR "python-config executable not found, but python is required.")
ENDIF()
EXECUTE_PROCESS(COMMAND ${PYTHON_CONFIG_EXECUTABLE} --prefix OUTPUT_VARIABLE python_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
- SET(PYTHON_INCLUDE_DIR ${python_prefix}/include/python2.7)
- SET(PYTHON_LIBRARY ${python_prefix}/lib/libpython2.7${CMAKE_SHARED_LIBRARY_SUFFIX})
- SET(PYTHON_MAJOR_VERSION 2)
- SET(PYTHON_MINOR_VERSION 7)
+ SET(PYTHON_INCLUDE_DIR ${python_prefix}/include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
+ SET(PYTHON_LIBRARY ${python_prefix}/lib/libpython${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}${CMAKE_SHARED_LIBRARY_SUFFIX})
+ SET(PYTHON_MAJOR_VERSION ${PYTHON_VERSION_MAJOR})
+ SET(PYTHON_MINOR_VERSION ${PYTHON_VERSION_MINOR})
MESSAGE(STATUS "Python libraries: ${PYTHON_LIBRARY}")
MESSAGE(STATUS "Python include dir: ${PYTHON_INCLUDE_DIR}")
ENDIF()