ReadStat icon indicating copy to clipboard operation
ReadStat copied to clipboard

[Feature Request]: Support for PkgConfig

Open amirmasoudabdol opened this issue 3 years ago • 0 comments

I'm wondering if there is a way to add support for pkg-config. This is in fact not a lot of work, and it can even be done manually after the installation but it is usually handled by the ./configure or make command. The format is very simple, and I already have a version that is working for me. The only thing that needs to be changed here is the prefix that can easily be set by the configurator.

prefix=/opt/homebrew/Cellar/readstat/1.1.7
libdir=${prefix}/lib
includedir=${prefix}/include

Name: readstat
Description: A command line tool (and C library) for converting SAS, Stata, and SPSS files
Version: 1.1.7
Libs: -L${libdir} -lreadstat
Cflags: -I${includedir}

This file usually sits in the lib/pkgconfig and it is named readstats.pc. If exists, most Unix-like systems can found it, and therefore link to it much easier. Even CMake can use this configuration, and simplifies the process of integrating the ReadStat to C/C++ projects.

❯ pkg-config --libs readstat
-L/opt/homebrew/Cellar/readstat/1.1.7/lib -lreadstat

❯ pkg-config --cflags readstat
-I/opt/homebrew/Cellar/readstat/1.1.7/include

I did not attempt to add this to your build system since I am aware that build system is a delicate thing, but if you point me to where you would like it to end up, I can try adding it, and make a PR for it.

amirmasoudabdol avatar Nov 01 '21 08:11 amirmasoudabdol