libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v1.5-54-g7676fb5

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 11 Jun 2025 09:01:09 +0200 (CEST)
The branch, master has been updated
       via  7676fb59ecd9fac9e5ea39439905c923ee7ee8c9 (commit)
      from  cfaec73e0a5ad9d05d62f1f5c393ab1c59ba771b (commit)


- Log -----------------------------------------------------------------
commit 7676fb59ecd9fac9e5ea39439905c923ee7ee8c9
Author: Yegor Yefremov <yegorslists@xxxxxxxxxxxxxx>
Date:   Thu Apr 10 12:45:10 2025 +0200

    python/CMakeLists.txt: rework policy CMP0078
    
    Switch to a new behaviour and use the pyftdi1 target directly.

-----------------------------------------------------------------------

Summary of changes:
 python/CMakeLists.txt |   24 +++++++-----------------
 1 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 9358419..0708851 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -1,9 +1,3 @@
-# swig_add_library behavior changed in cmake 3.13 to no longer set
-# SWIG_MODULE_<target>_REAL_NAME, so restore the old behavior.
-if ( POLICY CMP0078 )
-  cmake_policy( SET CMP0078 OLD )
-endif ()
-
 # workaround for cmake bug #0013449
 if ( NOT DEFINED CMAKE_FIND_ROOT_PATH OR NOT CMAKE_VERSION VERSION_LESS 3.0.0 )
   find_package ( SWIG REQUIRED )
@@ -27,20 +21,16 @@ if ( DOCUMENTATION )
   # manually add dependency for new cmake / swig versions
   set_property(SOURCE ftdi1.i PROPERTY DEPENDS doc_i)
 endif()
-if(NOT CMAKE_VERSION VERSION_LESS 3.8.0)
-  swig_add_library ( ftdi1 LANGUAGE python SOURCES ftdi1.i )
-else ()
-  swig_add_module ( ftdi1 python ftdi1.i )
-endif()
-swig_link_libraries ( ftdi1 ftdi1 )
+swig_add_library ( pyftdi1 LANGUAGE python SOURCES ftdi1.i )
+swig_link_libraries ( pyftdi1 ftdi1 )
 
 if ( LINK_PYTHON_LIBRARY )
-  swig_link_libraries ( ftdi1 ${PYTHON_LIBRARIES} )
+  swig_link_libraries ( pyftdi1 ${PYTHON_LIBRARIES} )
 elseif( APPLE )
-  set_target_properties ( ${SWIG_MODULE_ftdi1_REAL_NAME} PROPERTIES LINK_FLAGS 
"-undefined dynamic_lookup" )
+  set_target_properties ( pyftdi1 PROPERTIES LINK_FLAGS "-undefined 
dynamic_lookup" )
 endif ()
 
-set_target_properties ( ${SWIG_MODULE_ftdi1_REAL_NAME} PROPERTIES NO_SONAME ON 
)
+set_target_properties ( pyftdi1 PROPERTIES NO_SONAME ON )
 
 execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; print( 
sysconfig.get_path( 'platlib', vars={'platbase': '${CMAKE_INSTALL_PREFIX}'} ) )"
                   OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH
@@ -52,7 +42,7 @@ file ( RELATIVE_PATH _REL_PYTHON_MODULE_PATH 
${CMAKE_INSTALL_PREFIX} ${_ABS_PYTH
 set ( PYTHON_MODULE_PATH ${_REL_PYTHON_MODULE_PATH} )
 
 install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/ftdi1.py DESTINATION 
${PYTHON_MODULE_PATH} )
-install ( TARGETS ${SWIG_MODULE_ftdi1_REAL_NAME} LIBRARY DESTINATION 
${PYTHON_MODULE_PATH} )
+install ( TARGETS pyftdi1 LIBRARY DESTINATION ${PYTHON_MODULE_PATH} )
 
 if ( DOCUMENTATION )
   # Run doxygen to only generate the xml
@@ -75,7 +65,7 @@ if ( DOCUMENTATION )
     COMMENT "Python API bindings documentation"
     DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ftdi1_doc.i
   )
-  add_dependencies( ${SWIG_MODULE_ftdi1_REAL_NAME} doc_i )
+  add_dependencies( pyftdi1 doc_i )
 
 endif ( DOCUMENTATION )
 


hooks/post-receive
-- 
A library to talk to FTDI chips

--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • A library to talk to FTDI chips branch, master, updated. v1.5-54-g7676fb5, libftdi-git <=