libftdi Archives

Subject: Re: CMake/Swig updates for Fedora Rawhide

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Richard Shaw <hobbes1069@xxxxxxxxx>
Date: Mon, 18 Feb 2019 20:24:16 +0100
Hello Richard,

thanks for the patch! I've taken it as basis and refined it a bit further.

Some comments:

You wrote on Sun, Feb 17, 2019 at 09:02:38AM -0600:
> $ cat libftdi-cmake_swig.patch
> --- 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)
> +

this needs a CMAKE_VERSION guard since CMP0078 exists in cmake 3.13+ only.

>  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)

I've dropped this part. Fedora uses the outdated libftdi 1.3,
the cmake files were improved in the 1.4 release a lot.

I've spotted this in there:

   add_dependencies( ${SWIG_MODULE_ftdi1_REAL_NAME} doc_i )


so I guess it should already be ok?

>    endif()
> -  swig_add_module ( ftdi1 python ftdi1.i )
> +  swig_add_library ( ftdi1 LANGUAGE python SOURCES ftdi1.i )
>    swig_link_libraries ( ftdi1 ftdi1 )

I've also added a cmake version guard here since swig_add_library()
was added in cmake 3.8.

The updated patch can be found on the "cmake-swig-updates" branch.
Here's the final patch, I've kept your authorship:
http://developer.intra2net.com/git/?p=libftdi;a=commit;h=f49ee0d141e6a3f467c9054916d2f8876ae22587


Can you test the "cmake-swig-updates" branch on Fedora rawhide?

I was about to cut a release for libftdi 1.5, so it would be
nice to know if it still compiles on Fedora rawhide. My own
workstation runs F29 and it compiles fine there.

If the patch works for you, I'll merge it to master.

Cheers,
Thomas

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

Current Thread