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

Relative paths in pkg-config file #9

Closed
mdpiper opened this issue Oct 26, 2023 · 2 comments · Fixed by #10
Closed

Relative paths in pkg-config file #9

mdpiper opened this issue Oct 26, 2023 · 2 comments · Fixed by #10

Comments

@mdpiper
Copy link
Member

mdpiper commented Oct 26, 2023

The pkg-config file output from CMake, bmic.pc, has relative paths:

$ cat /Users/mpiper/anaconda3/envs/bmic/lib/pkgconfig/bmic.pc
Name: bmi-c
Description: The Basic Model Interface for C
URL: https://bmi.readthedocs.io
Version: 2.0
Libs: -Llib -lbmic
Cflags: -Iinclude

Absolute paths are needed, otherwise downstream packages can't find bmi.h.

@mdpiper
Copy link
Member Author

mdpiper commented Oct 26, 2023

Rereading the GNUInstallDirs documentation, I see what I did wrong: I need to use the CMAKE_INSTALL_FULL_<dir> variables in this context, not the CMAKE_INSTALL_<dir> variables used in the build process. Doing so gives the expected result:

$ cat /Users/mpiper/anaconda3/envs/bmic/lib/pkgconfig/bmic.pc
Name: bmi-c
Description: The Basic Model Interface for C
URL: https://bmi.readthedocs.io
Version: 2.0
Libs: -L/Users/mpiper/anaconda3/envs/bmic/lib -lbmic
Cflags: -I/Users/mpiper/anaconda3/envs/bmic/include

@mdpiper
Copy link
Member Author

mdpiper commented Oct 26, 2023

(Maybe this is good because the process of writing the issue made me think about what went wrong.)

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

Successfully merging a pull request may close this issue.

1 participant