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

pkg-config file is broken when CMAKE_INSTALL_{INCLUDE,LIB}DIR is absolute #249

Closed
alexshpilkin opened this issue May 16, 2022 · 3 comments · Fixed by #250
Closed

pkg-config file is broken when CMAKE_INSTALL_{INCLUDE,LIB}DIR is absolute #249

alexshpilkin opened this issue May 16, 2022 · 3 comments · Fixed by #250

Comments

@alexshpilkin
Copy link
Contributor

alexshpilkin commented May 16, 2022

As per title: CMakeLists.txt has

set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}")

and so can’t handle absolute paths in CMAKE_INSTALL_{INCLUDE,LIB}DIR. This leads to broken .pc files on NixOS in particular. (Using prefix and not exec_prefix to derive libdir also seems a bit suspect, but is not the problem here.)

See “Concatenating paths when building pkg-config files” for a thorough discussion of the problem and a suggested fix, or KDE’s extra-cmake-modules for a simpler approach.

@recp
Copy link
Owner

recp commented May 16, 2022

Hi @alexshpilkin,

Thanks for reporting this, a PR to fix that would be awesome but I will take a look asap if none

@alexshpilkin
Copy link
Contributor Author

I did not want to promise anything, but I could get around to fixing this in the end :) I’d appreciate it if you double-checked that I didn’t break anything.

@recp
Copy link
Owner

recp commented May 19, 2022

@alexshpilkin many thanks for the fix, it seems ok to me 🚀

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

Successfully merging a pull request may close this issue.

2 participants