libftdi Archives

Subject: RE: LibFTDIConfig.cmake support

From: xantares 09 <xantares09@xxxxxxxxxxx>
To: <libftdi@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 23 Jan 2013 07:33:24 +0000


> Date: Wed, 23 Jan 2013 07:09:42 +0800
> Subject: Re: LibFTDIConfig.cmake support
> From: xiaofanc@xxxxxxxxx
> To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
>
> On Wed, Jan 23, 2013 at 3:41 AM, Thomas Jarosch
> <thomas.jarosch@xxxxxxxxxxxxx> wrote:
> > On 01/21/2013 03:51 PM, xantares 09 wrote:
> >> I added a LibFTDIConfig.cmake file which allows to detect libftdi from another cmake project (an example is included):
> >> https://github.com/xantares/libftdi/commit/db0517ed6b687956e0ec4e1247521bd26271c987
> >
> > hmm, I still don't get the advantage compared to pkgconfig.
> >
> > Or will it help f.e. building on Windows?
> > I don't think it's possible without mingw, is it?
>
> I am not so sure if it will help building under Windows.
> Under Windows and MinGW, usually we need to
> specify the location of libusb/libftdi etc anyway without
> pkg-config. Or we can use something like pkg-config-lite.
> ( http://sourceforge.net/projects/pkgconfiglite/ )
>
> On the other hand, adding the LibFTDIConfig.cmake
> does not hurt either since it might be useful in
> other cases.
>
> --
> Xiaofan
>
> --
> libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
> To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
>

Hi,
Yes, it's the same spirit as pkgconfig, and it's aimed at being used from cmake.
It's very neat, look at the example: it's just 3 lines of code to add includes and link to libftdi/libusb from another cmake project.

It could work for windows too, but as paths are not standard and dev packages are less common it's less obvious.
On linux cmake finds automatically a package from command "find_package" if an XXXconfig.cmake lies in /usr/lib/cmake/XXX, else we need to pass "-DLibFTDI_DIR=/libftdi/install/path" to cmake.
It may be cool to include it in a "devel" package so as for others to detect it without the burden of having to write a findXXX.cmake module (like libdfit does for USB1 :).

M.











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


Current Thread