KhronosGroup / KhronosGroup/OpenXR-SDK-Source

pkg-config file is broken when CMAKE_INSTALL_LIBDIR is absolute

Open
#305 1 comment 0 reactions 0 assignees View on GitHub
synced to gitlab
Dominant language
Python
Stars
825
Forks
306
Avg merge
1d 23h
Merged PRs (30d)
1

Description

As per title: `src/loader/openxr.pc.in` has
```
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
```
and so can’t handle absolute paths in `CMAKE_INSTALL_LIBDIR`. This leads to broken .pc files on NixOS in particular.

See “[Concatenating paths when building pkg-config files](https://github.com/jtojnar/cmake-snips#concatenating-paths-when-building-pkg-config-files)” for a thorough discussion of the problem and a suggested fix, or [KDE’s extra-cmake-modules](https://invent.kde.org/frameworks/extra-cmake-modules/-/blob/master/modules/ECMGeneratePkgConfigFile.cmake#L166) for a simpler approach.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/loader/openxr.pc.in and review how its CMAKE_INSTALL_LIBDIR value is combined with exec_prefix. Read the linked CMake path discussion or KDE's ECMGeneratePkgConfigFile.cmake for comparison. Done means generated .pc files remain valid when CMAKE_INSTALL_LIBDIR is absolute, including the NixOS case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.