X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=python%2FCMakeLists.txt;h=fc1c3d148aa7ad821a4cfd891121cb188ea6769e;hp=376dae6f45405c2e082982d4b9cda0390c9242b1;hb=07bdc1ea16ac4b38847b773619a7a840a8cd5dd7;hpb=921059828c9a3a1d8f773ce5adb2afc4542f9622 diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 376dae6..fc1c3d1 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,3 +1,9 @@ +# swig_add_library behavior changed in cmake 3.13 to no longer set +# SWIG_MODULE__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 ) @@ -18,8 +24,14 @@ link_directories ( ${CMAKE_CURRENT_BINARY_DIR}/../src ) if ( DOCUMENTATION ) set(CMAKE_SWIG_FLAGS -DDOXYGEN=${DOXYGEN_FOUND}) + # manually add dependency for new cmake / swig versions + set_property(SOURCE ftdi1.i PROPERTY DEPENDS ftdi1_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_add_module ( ftdi1 python ftdi1.i ) swig_link_libraries ( ftdi1 ftdi1 ) if ( LINK_PYTHON_LIBRARY )