diff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake index 819bfb05..54febfb2 100644 --- a/cmake/FindPython.cmake +++ b/cmake/FindPython.cmake @@ -104,13 +104,14 @@ mark_as_advanced(PYTHON_SITE_PKG) #EXEC_PYTHON_SCRIPT ("import string; from distutils.sysconfig import * ;print string.join(get_config_vars('VERSION'))" PYTHON_VERSION_MAJOR_MINOR) EXEC_PYTHON_SCRIPT ("import string; from distutils.sysconfig import *; print '%s/config' % get_python_lib(0,1)" PYTHON_LIBRARY_BASE_PATH) EXEC_PYTHON_SCRIPT ("import string; from distutils.sysconfig import *; print 'libpython%s' % string.join(get_config_vars('VERSION'))" PYTHON_LIBRARY_BASE_FILE) + set( PYTHON_LIBRARY_SEARCH_PATH ${PYTHON_LIBRARY_BASE_PATH} /usr/lib/python2.7/config-x86_64-linux-gnu/) IF(BUILD_SHARED_LIBS) - FIND_FILE(PYTHON_LIBRARY NAMES "${PYTHON_LIBRARY_BASE_FILE}.so" PATHS ${PYTHON_LIBRARY_BASE_PATH}) + FIND_FILE(PYTHON_LIBRARY NAMES "${PYTHON_LIBRARY_BASE_FILE}.so" PATHS ${PYTHON_LIBRARY_SEARCH_PATH}) IF(NOT PYTHON_LIBRARY) - FIND_FILE(PYTHON_LIBRARY NAMES "${PYTHON_LIBRARY_BASE_FILE}.a" PATHS ${PYTHON_LIBRARY_BASE_PATH}) + FIND_FILE(PYTHON_LIBRARY NAMES "${PYTHON_LIBRARY_BASE_FILE}.a" PATHS ${PYTHON_LIBRARY_SEARCH_PATH}) ENDIF(NOT PYTHON_LIBRARY) ELSE(BUILD_SHARED_LIBS) - FIND_FILE(PYTHON_LIBRARY NAMES "${PYTHON_LIBRARY_BASE_FILE}.a" PATHS ${PYTHON_LIBRARY_BASE_PATH}) + FIND_FILE(PYTHON_LIBRARY NAMES "${PYTHON_LIBRARY_BASE_FILE}.a" PATHS ${PYTHON_LIBRARY_SEARCH_PATH}) ENDIF(BUILD_SHARED_LIBS) MESSAGE(STATUS "PYTHON_LIBRARY = ${PYTHON_LIBRARY}" ) mark_as_advanced(PYTHON_LIBRARY)