Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could be nice to generate/install pkg-config file #63

Open
Lecrapouille opened this issue Apr 9, 2022 · 3 comments
Open

Could be nice to generate/install pkg-config file #63

Lecrapouille opened this issue Apr 9, 2022 · 3 comments

Comments

@Lecrapouille
Copy link

Lecrapouille commented Apr 9, 2022

I'm testing your project right now.

Could be nice to create a pkg-config file like in:
https://github.com/sebastiandev/zipper/blob/master/zipper.pc.cmakein

Or for Makefile:
https://github.com/Lecrapouille/MyMakefile/blob/master/Makefile.macros#L165
sudo make install will install it:
https://github.com/Lecrapouille/MyMakefile/blob/master/Makefile.macros#L181
https://github.com/Lecrapouille/MyMakefile/blob/master/Makefile.macros#L63
(not sure this is working well for Mac)

So in your readme instead of:

g++ -std=c++11 -I/path/to/header -L/path/to/lib -lipfs-http-client myprog.cc -o myprog

Could be replaced by:

g++ -std=c++11 myprog.cc -o myprog `pkg-config --cflags --libs ipfs-http-client`

In addition in your command -lipfs-http-client is misplaced and -lcurl is missing. The pkg-config will contain the -lcurl code

@melroy89
Copy link
Collaborator

melroy89 commented Jun 4, 2023

I see, thank you for you remarks. Ideally you should use CMake, which interact very well with an existing CMake project.

But I will test if pkg-config config you provided also work, instead of the manual -I .. and -L .., which is indeed old school.

The additional pkg-config file is also a great idea! Thx.

Please, be welcome to add a PR if you wish.

@Lecrapouille
Copy link
Author

@melroy89
Copy link
Collaborator

melroy89 commented Jun 5, 2023

Yes so zipper.pc.cmakein is an input file for the configure_file of CMake, generating the final file. Which is exported to: ${PROJECT_BINARY_DIR}/zipper.pc, so under the CMAKE project binary directory with final name 'zipper.pc'. Configure_file will fill all the @CMAKE_INSTALL_PREFIX@ statement etc. during the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants