Skip to content

Preserve absolute install directories in pkg-config metadata - #1096

Open
fhgffy wants to merge 1 commit into
leethomason:masterfrom
fhgffy:fix/pkgconfig-absolute-install-dirs
Open

fhgffy wants to merge 1 commit into
leethomason:masterfrom
fhgffy:fix/pkgconfig-absolute-install-dirs

Conversation

@fhgffy

@fhgffy fhgffy commented Oct 5, 2026

Copy link
Copy Markdown

With absolute CMAKE_INSTALL_LIBDIR or CMAKE_INSTALL_INCLUDEDIR, CMake installs tinyxml2 to the requested location, but tinyxml2.pc prepends the install prefix again. A downstream pkg-config consumer then fails to find the installed header or library.

Keep absolute install directories unchanged and retain ${prefix} / ${exec_prefix} for relative directories. Add a metadata regression test and an absolute-directory configuration to the existing CI matrix.

Validated on master 8224e427b655b83dae5e2298f1e6919523a78737, Linux x86_64, GCC 14.2.0, CMake 3.31.6 and pkg-config 1.8.1:

  • The regression fails on the original source for absolute include, absolute lib and both-absolute layouts. Default and custom relative layouts pass.
  • Fixed pkg-config consumers compile, link and run in all five layouts for static/shared Release builds, plus both-absolute static/shared Debug builds.
  • Original and fixed upstream tests and installed find_package tests pass in static/shared Debug/Release. Each xmltest run reports 528 passed, zero failed.
  • Independent review additionally checked compiler wrappers, staged installs with DESTDIR / PKG_CONFIG_SYSROOT_DIR, and prefix overrides.

Windows, macOS and CMake 3.15 were not run locally. The existing CI matrix covers those environments; remote CI has not run for this patch.

This branch has not been deployed

No deployments
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.

1 participant