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

Fix cmake path assumptions #213

Merged
merged 1 commit into from
Dec 11, 2020
Merged

Fix cmake path assumptions #213

merged 1 commit into from
Dec 11, 2020

Conversation

r-burns
Copy link
Contributor

@r-burns r-burns commented Sep 26, 2020

Fixes downstream packaging issue NixOS/nixpkgs#90610 (comment)

Paths from GNUInstallDirs are not necessarily relative, in which case
they can't be simply appended to the install prefix in the .pc file.
See https://github.com/jtojnar/cmake-snips#concatenating-paths-when-building-pkg-config-files

Also fixes hardcoded include directory.

@0-wiz-0
Copy link
Member

0-wiz-0 commented Sep 26, 2020

Hm, then perhaps we should use CMAKE_INSTALL_FULL_<dir> in the pkgconfig file instead.

@r-burns
Copy link
Contributor Author

r-burns commented Sep 26, 2020

I think it's preferred to have the .pc files interpolate relative to the installation prefix when applicable - cmake-snips mentions this briefly but doesn't go into the details of why.

@r-burns
Copy link
Contributor Author

r-burns commented Dec 8, 2020

Ping, any more thoughts on this? If I understand correctly, this will work correctly on Windows too. Maybe I should remove or clarify the Windows not supported comment so it isn't misleading?

@0-wiz-0
Copy link
Member

0-wiz-0 commented Dec 10, 2020

I think the correct solution is to change:

SET(bindir \${exec_prefix}/${CMAKE_INSTALL_BINDIR})
SET(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
SET(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})

to

SET(bindir ${CMAKE_FULL_INSTALL_BINDIR})
SET(libdir ${CMAKE_FULL_INSTALL_LIBDIR})
SET(includedir ${CMAKE_FULL_INSTALL_INCLUDEDIR})

Does this work for you?

If not, can you please provide the full cmake invocation?

Paths from GNUInstallDirs are not necessarily relative, in which case
they can't be simply appended to the install prefix in the .pc file.
See https://github.com/jtojnar/cmake-snips#concatenating-paths-when-building-pkg-config-files

Also fixes hardcoded include directory.
@r-burns
Copy link
Contributor Author

r-burns commented Dec 11, 2020

Ok, I think that's a good call, the cmake is much simpler if just using the full path without interpolations is acceptable. Works for me, pushed changes.

@0-wiz-0 0-wiz-0 merged commit 3512014 into nih-at:master Dec 11, 2020
@0-wiz-0
Copy link
Member

0-wiz-0 commented Dec 11, 2020

Thanks!

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 this pull request may close these issues.

3 participants