linux-usb-gadgets / libusbgx

C library encapsulating the Linux kernel USB gadget configfs userspace API functionality
GNU General Public License v2.0
216 stars 72 forks source link

Adding FindUsbgx.cmake script with exports as CMake support file #31

Closed studiofuga closed 3 years ago

studiofuga commented 6 years ago

The attached file is useful for use with CMake, since it checks for the library and exports the proper module Usbgx::Usbgx.

It should be installed in ${LIBDIR}/cmake/Usbgx. Hope it helps.

FindUsbgx.cmake.txt

kopasiak commented 6 years ago

Nice one! How about adding this to repository and creating a suitable makefile target?

studiofuga commented 6 years ago

I'm not very familiar with autotools. But I'll try. Thanks.

kopasiak commented 6 years ago

No worries, probably no one apart from autotools' authors is a master in this. You can take a look how tests were added to the autotools to see how make conditional installation and headers installation for how to actually install a file with autotools;)

BTW. Please close this issue when you create a pull request

studiofuga commented 6 years ago

Should I add an additional config option and a conditional test? Perhaps it can always be installed as for the pkgconfig file.

kopasiak commented 6 years ago

Well... yeah let's install it always. If there is anyone who is annoyed with that he will submit a patch;)

studiofuga commented 6 years ago

Well, I almost did it but I'm unable to fix the following issue:

I created a proper LibUsbgxConfig.cmake.in file that should generate LibUsbgxConfig.cmake and it makes use of @libdir@ and @includedir@ variables, but they expands to ${prefix}/include and this cannot work. I need fully expanded variables.

Do you know how to do this? Thanks

kopasiak commented 6 years ago

@pszewczyk you have some nice experience with autotools. Do you have any idea where the problem comes from?

kopasiak commented 6 years ago

BTW to simplify the debugging you can push the WIP code as pull request

studiofuga commented 6 years ago

Ok I'll do

pabs3 commented 3 years ago

@studiofuga did you get the chance to reformat this as a pull request?

studiofuga commented 3 years ago

hi @pabs3 , my changes were already included in the project, see commit 664b7e6fe7f8269a774101d7625dd0a82c8aadd3 . I'm not using the library in the project anymore so I can't tell if they work or not.

pabs3 commented 3 years ago

@studiofuga I see, thanks for the info. I'm going to close this then, presumably it works and if it doesn't then someone will likely file a new issue about it.