Repository navigation
Conversation
0113298 to
840951e
Compare
|
— codex on behalf of Ralf — Compute the prefix from the actual pkg-config install path. I configured and installed this head with CMake 3.28 and Generated by Codex. Ralf has yet to review these findings. |
|
🤖 AI text below 🤖 Confirmed. With Fixed in f4adf6c:
I ran the test locally with CMake 3.25 and 4.5 only. |
…ROOTDIR Fixes item 7 of pybind#6159.
Values such as "." or "./share" gave one ".." too many. Compute the relative path from the normalized pkgconfig install directory instead. Assisted-by: ClaudeCode:claude-fable-5-2
316f221 to
3febb1b
Compare
|
— codex on behalf of Ralf — Use the actual install prefix to compute the path back from Optional test improvement. Add |
Resolve sibling data directories relative to the configured prefix. Cover this layout in the pkg-config regression and escape the arguments of its CMake test target. Assisted-by: Codex:GPT-6
Forward the make program, generator platform, toolset, and toolchain file to the nested configure. Pass CMAKE_INSTALL_DATAROOTDIR as STRING. Add an absolute data directory case, a relocated install, and an includedir check. Assisted-by: ClaudeCode:claude-fable-5-2
|
Fixing up the tests. Then I'll see if we can trim the tests, the new tests could take minutes on some systems, a CMake configure is expensive. There's also an issue with sibling data directories not being relocatable, but focusing on this first. |
Oh, I see. I didn't consider that. |
🤖 AI text below 🤖
The
cmake_path(RELATIVE_PATH ...)branch gave the base directory as the literal stringCMAKE_INSTALL_DATAROOTDIRinstead of its value, so on CMake 3.20 and later the installedpybind11.pchad an emptyprefix=. Also, the.pcfile needs a path relative to${pcfiledir}, not relative to the data root.The
cmake_pathbranch and thewhile()loop are both removed. The prefix is now the relative path from the normalized pkg-config install directory to the install prefix. It usesget_filename_component(... ABSOLUTE BASE_DIR ...)andfile(RELATIVE_PATH ...), which work in CMake 3.15. This also fixesCMAKE_INSTALL_DATAROOTDIRvalues such as.and./share, which the loop got wrong:CMAKE_INSTALL_DATAROOTDIRprefix=.${pcfiledir}/..share,share/,./share${pcfiledir}/../..lib/foo/share${pcfiledir}/../../../..A new
test_build_pkgconfig_prefixtarget (part oftest_cmake_build) installs with each of these values and checks thatprefix=resolves to the install prefix.The CMP0190 fix is now in a separate PR.
Suggested changelog entry:
prefix=value in the installedpybind11.pc, which was empty with CMake 3.20 and later, and wrong for someCMAKE_INSTALL_DATAROOTDIRvalues such as..