Hi all, On Fri, 05 Jun 2015 21:40:42 -0300, Lisandro Damián Nicanor Pérez Meyer wrote: > The attached patch fixes this but... there is yet another problem further on > with some python stuff.
The attached patch fixes problems with the python stuff. -- Dmitry Shachnev
Description: fix sip library detection The old algorithm used hard-coded library names and thus could not detect our multi-arched name. . Instead of that, just import sip from Python script and use the __file__ property to find the library. Author: Dmitry Shachnev <mity...@debian.org> Forwarded: no Last-Update: 2015-06-13 --- a/cmake/FindSIP.cmake +++ b/cmake/FindSIP.cmake @@ -69,6 +69,7 @@ ELSE(SIP_VERSION) STRING(REGEX REPLACE ".*\nsip_bin:([^\n]+).*$" "\\1" SIP_EXECUTABLE ${sip_config}) STRING(REGEX REPLACE ".*\ndefault_sip_dir:([^\n]+).*$" "\\1" SIP_DEFAULT_SIP_DIR ${sip_config}) STRING(REGEX REPLACE ".*\nsip_inc_dir:([^\n]+).*$" "\\1" SIP_INCLUDE_DIR ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_library:([^\n]+).*$" "\\1" SIP_LIBRARIES ${sip_config}) SET(SIP_FOUND TRUE) ENDIF(sip_config) @@ -100,12 +101,6 @@ IF(NOT SIP_VERSION) SET(OLD_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}" CACHE INTERNAL "") SET(CMAKE_FIND_LIBRARY_PREFIXES "") - FIND_LIBRARY(SIP_LIBRARIES - NAMES sip libsip - PATHS ${SIP_POSSIBLE_LIB_DIRS} ${PYTHON_SITE_PACKAGES} - PATH_SUFFIXES lib dlls - DOC "SIP module") - SET(CMAKE_FIND_LIBRARY_PREFIXES "${OLD_CMAKE_FIND_LIBRARY_PREFIXES}") # (c) Try to find the sip executable: @@ -134,27 +129,6 @@ IF(NOT SIP_VERSION) STRING(REGEX REPLACE "define SIP_VERSION_STR[ \t]+\"([^\"]*)\"" "\\1" SIP_VERSION_STR "${SIP_VERSION_STR}") ENDIF(NOT SIP_VERSION) -IF(NOT SIP_LIBRARIES) - # Try to find the sip library: - EXECUTE_PROCESS ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" - OUTPUT_VARIABLE PYTHON_SITE_PACKAGES - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - # Use the path to the python installation as a hint for finding sip - GET_FILENAME_COMPONENT(SIP_POSSIBLE_LIB_DIRS "${PYTHON_LIBRARIES}" PATH) - LIST(APPEND SIP_POSSIBLE_LIB_DIRS "/usr/lib/pyshared/python${PYTHON_VERSION}") - - SET(OLD_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}" CACHE INTERNAL "") - SET(CMAKE_FIND_LIBRARY_PREFIXES "") - FIND_LIBRARY(SIP_LIBRARIES - NAMES sip libsip - PATHS ${SIP_POSSIBLE_LIB_DIRS} ${PYTHON_SITE_PACKAGES} - PATH_SUFFIXES lib dlls - DOC "SIP module") - SET(CMAKE_FIND_LIBRARY_PREFIXES "${OLD_CMAKE_FIND_LIBRARY_PREFIXES}") -ENDIF() - INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(SIP DEFAULT_MSG SIP_EXECUTABLE --- a/cmake/FindSIP.py +++ b/cmake/FindSIP.py @@ -13,3 +13,6 @@ print("sip_version_str:%s" % sipcfg.sip_ print("sip_bin:%s" % sipcfg.sip_bin) print("default_sip_dir:%s" % sipcfg.default_sip_dir) print("sip_inc_dir:%s" % sipcfg.sip_inc_dir) + +import sip +print("sip_library:%s" % sip.__file__)
signature.asc
Description: OpenPGP digital signature