From: Michel Zou Date: Tue, 21 Aug 2012 08:00:34 +0000 (+0200) Subject: Avoid to link python libs on debian X-Git-Tag: v1.0rc1~22 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=1f38932a151adc247afa50708c8e5a8c65afda63 Avoid to link python libs on debian --- diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt index 28061a6..7abf655 100644 --- a/bindings/CMakeLists.txt +++ b/bindings/CMakeLists.txt @@ -10,8 +10,14 @@ if(PYTHON_BINDINGS AND SWIG_FOUND AND PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND) INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../src) - SWIG_ADD_MODULE(ftdi1 python ftdi1.i) - SWIG_LINK_LIBRARIES(ftdi1 ftdi1 ${PYTHON_LIBRARIES}) + swig_add_module ( ftdi1 python ftdi1.i ) + swig_link_libraries ( ftdi1 ftdi1 ) + + # do not link python modules on debian + # http://www.debian.org/doc/packaging-manuals/python-policy/ch-module_packages.html + if ( NOT EXISTS "/etc/debian_version" ) + swig_link_libraries ( ftdi1 ${PYTHON_LIBRARIES} ) + endif () execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print '%d.%d' % ( sys.version_info[0], sys.version_info[1] )" OUTPUT_VARIABLE PYTHON_VERSION