argtable / argtable3

A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options.
http://www.argtable.org
Other
372 stars 65 forks source link

Added CPack packaging and a file for pkg-config. #71

Open KOLANICH opened 3 years ago

KOLANICH commented 11 months ago

@tomghuang

tomghuang commented 11 months ago

Hi @KOLANICH , thanks a lot for your patch. I'm not familiar with CPack, but I'll check what this patch is doing. Besides, could you please let me know the purpose of this patch? I mean, what this patch is trying to do? Thanks.

heitbaum commented 2 months ago

@KOLANICH I just tested your patch as I’m looking to migrate a configure.ac package to allow the use of argtable3 instead of argtable2. The only issue I had was that the built .pc file has Version: 0.0.0.0 instead of 3.2.2

heitbaum commented 2 months ago

Follow-up. libdir and Libs were also missing. Once these were updated, my package was able to link against argtable3

prefix=/usr
includedir=${prefix}/include
libdir=${prefix}/lib

Name: argtable3
Description: ANSI C command-line parsing library
Version: 3.2.2

Libs: -L${libdir} -largtable3_static
Cflags: -I${includedir}
tomghuang commented 2 months ago

@heitbaum : Thanks for the feedback for @KOLANICH 's patch. Could you please teach me what this patch is doing? Do you mean that I need to follow your suggestion to change @KOLANICH 's patch? Thanks.

heitbaum commented 2 months ago

CPack is used (in part) to facilitate the creation of a pkg-config file. https://cmake.org/cmake/help/latest/module/CPack.html

the patch works, it just needs some adjustments, as the currently generated file needs to be “fixed” to match my output above, so that it can be used correctly in a ./configure

$ cat build/argtable3-3.2.2.f25c624/usr/lib/pkgconfig/argtable3.pc 
prefix=/usr
includedir=${prefix}/include

Name: argtable3
Description: ANSI C command-line parsing library
Version: 0.0.0.0
Cflags: -I${includedir}