Skip to content

pkg-config file is broken when CMAKE_INSTALL_INCLUDEDIR is absolute #282

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

Closed
alexshpilkin opened this issue May 18, 2022 · 4 comments · Fixed by #326
Closed

pkg-config file is broken when CMAKE_INSTALL_INCLUDEDIR is absolute #282

alexshpilkin opened this issue May 18, 2022 · 4 comments · Fixed by #326

Comments

@alexshpilkin
Copy link

As per title: SPIRV-Headers.pc.in has

prefix=@CMAKE_INSTALL_PREFIX@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@

and so can’t handle absolute paths in CMAKE_INSTALL_INCLUDEDIR. This leads to broken .pc files on NixOS in particular.

Morally identical to KhronosGroup/SPIRV-Tools#3905. 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.

@johnkslang
Copy link
Member

Is there a specific way you'd like to see this fixed, or do you have a PR you could propose?

@juan-lunarg
Copy link
Contributor

juan-lunarg commented Mar 14, 2023

CMAKE_INSTALL_INCLUDEDIR shouldn't be an absolute path. Or at least nothing in the CMake docs suggest setting CMAKE_INSTALL_INCLUDEDIR as an absolute path is valid.

@juan-lunarg
Copy link
Contributor

juan-lunarg commented Mar 15, 2023

Sorry turns out I was wrong. I'll make a PR to fix this for spirv-headers and spirv-tools.

Link to CMake docs:
https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html

CMAKE_INSTALL_<dir>

Destination for files of a given type. This value may be passed to the DESTINATION options of install() commands for the corresponding file type. It should typically be a path relative to the installation prefix so that it can be converted to an absolute path in a relocatable way (see CMAKE_INSTALL_FULL_<dir>). However, an absolute path is also allowed.

The main line of focus being:

It should typically be a path relative to the installation prefix so that it can be converted to an absolute path in a relocatable way (see CMAKE_INSTALL_FULL_<dir>). However, an absolute path is also allowed.

@juan-lunarg
Copy link
Contributor

Thanks for reporting this @alexshpilkin sorry for being wrong initially.

This is now fixed and tested as part of the CI process.

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.

3 participants