popt
popt copied to clipboard
Adding way to fetch version of library
There is no way to find out the library version programmatically. Could we improve it?
It's a bit late add version info, it should have happened years ago. I see people might want to detect version 1.19 and apply a different logic or something
Maybe two new defines should be added to popt.h:
- POPT_VERSION
- POPT_REVISION
It's a bit late add version info, it should have happened years ago.
yes :-)
I see people might want to detect version 1.19 and apply a different logic or something
My use case is Perl module Alien::libpopt (https://metacpan.org/pod/Alien::libpopt) which is going to detect the version. In the case of pkg-config, there is a way how to do it, but on other installations, it's not possible.
Maybe two new defines should be added to popt.h:
- POPT_VERSION
- POPT_REVISION
Should be fine.
Well the .pc files let the build system know about app/lib version, libraries usually include version info in the headers so that the code knows what to do
The .pc version is not accessible to C/C++ code unless it's passed as a definition -DPOPT_xxx=xxx by the build system (i.e. cmake)
I have some changes that look ok to me... I'll probably open a PR...