libftdi1/libftdi1-1.4-cmake_swig.patch

22 lines
780 B
Diff

--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -1,3 +1,7 @@
+# swig_add_module is deprecated and SWIG_MODULE_<target>_REAL_NAME is no
+# longer set by default so set policy to the old behavior.
+cmake_policy(SET CMP0078 OLD)
+
option ( PYTHON_BINDINGS "Build python bindings via swig" ON )
option ( LINK_PYTHON_LIBRARY "Link against python libraries" ON )
@@ -24,8 +28,9 @@ if ( SWIG_FOUND AND PYTHONLIBS_FOUND AND
if ( DOCUMENTATION AND DOXYGEN_FOUND )
set(CMAKE_SWIG_FLAGS -DDOXYGEN=${DOXYGEN_FOUND})
+ set_property(SOURCE ftdi1.i PROPERTY DEPENDS ftdi1_doc.i)
endif()
- swig_add_module ( ftdi1 python ftdi1.i )
+ swig_add_library ( ftdi1 LANGUAGE python SOURCES ftdi1.i )
swig_link_libraries ( ftdi1 ftdi1 )
if ( LINK_PYTHON_LIBRARY )