X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=python%2FCMakeLists.txt;h=494f6ff87806b5bdcce40cd292aa6e9a1fc4770b;hp=376dae6f45405c2e082982d4b9cda0390c9242b1;hb=41871ae234838d2540fc4297295fbec71f57067d;hpb=5b110dec90393f6951624fe9a9e58c9ae9e43127 diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 376dae6..494f6ff 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,3 +1,9 @@ +# swig_add_library behavior changed in cmake 3.13 and SWIG_MODULE__REAL_NAME +# is no longer set by default so set policy to the old behavior. +if(NOT CMAKE_VERSION VERSION_LESS 3.13.0) + 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 )