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

cmake: use FULL install directory variants in pkg-config file #10246

Closed
wants to merge 1 commit into from

Conversation

getchoo
Copy link

@getchoo getchoo commented Jul 13, 2024

Description

Instead of manually prepending the install prefix to CMAKE_INSTALL_<dir> (which may already be an absolute path), we can let cmake do it for us

See https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html#result-variables for documentation about this

Existing Issue(s)

Instead of manually prepending the install prefix to
`CMAKE_INSTALL_<dir>` (which may already be an absolute path), we can
let cmake do it for us
@slouken slouken requested a review from madebr July 13, 2024 02:47
@slouken slouken added this to the 3.2.0 milestone Jul 13, 2024
Copy link
Contributor

@madebr madebr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would re-introduce absolute paths and make a SDL binary package non-relocatable.

@slouken slouken closed this Jul 13, 2024
@OPNA2608
Copy link

Maybe https://github.com/jtojnar/cmake-snips/blob/master/README.md#concatenating-paths-when-building-pkg-config-files should be used to construct these values (or just cmake_path if CMake minimum 3.20 is acceptable). That way:

  • ${prefix} will be kept if the used CMAKE_INSTALL_*DIR variables are relative (which applies to the default values & the majority of build configs and use cases, I imagine), but
  • if the CMAKE_INSTALL_*DIRs are already absolute, then they are taken as-is with the assumption that they're supposed to be non-relocatable

This is what has been accepted in fmtlib, for example: fmtlib/fmt#1657

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.

4 participants