X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=python%2FCMakeLists.txt;h=4f758d5c4cc794ef00a288fad18d928948f402a3;hp=376dae6f45405c2e082982d4b9cda0390c9242b1;hb=bd825872f55f060073b25f53c589d22db70cf338;hpb=921059828c9a3a1d8f773ce5adb2afc4542f9622 diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 376dae6..4f758d5 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 ) @@ -19,7 +25,11 @@ link_directories ( ${CMAKE_CURRENT_BINARY_DIR}/../src ) if ( DOCUMENTATION ) set(CMAKE_SWIG_FLAGS -DDOXYGEN=${DOXYGEN_FOUND}) endif() -swig_add_module ( ftdi1 python ftdi1.i ) +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 ) if ( LINK_PYTHON_LIBRARY )