feat(cmake): install/export + pkg-config for find_package support + ADR-0028 (M7.4)#57
Merged
Merged
Conversation
…DR-0028 (M7.4) Closes ROADMAP item 7.4 — Phase 1 distribution (ADR-0004 §5). - ADR-0028 records the install/packaging layout decision. - CMake install/export: PBR_MEMORY_POOL_INSTALL option (default PROJECT_IS_TOP_LEVEL) gates install(TARGETS ... EXPORT) + install(EXPORT ... NAMESPACE pbr::), the full it/d4np/memorypool/ header tree, a relocatable package config (configure_package_config_file + SameMajorVersion version file), a pkg-config pbr-memory-pool.pc, and LICENSE under share/doc/. - EXPORT_NAME memory_pool makes the installed imported target pbr::memory_pool, identical to the in-build alias — one link line for vendored and installed consumers alike. - release.yml packages via `cmake --install` instead of hand-copying, fixing a latent bug where four of the seven public headers and the package config were missing from release tarballs. - Docs: ROADMAP 7.4, ADR index, README "Install and consume", CHANGELOG. Verified end-to-end locally (MSVC 19.51 + Ninja): configure -> build -> cmake --install to a staging prefix, then a separate consumer project did find_package(pbr_memory_pool CONFIG REQUIRED) + linked pbr::memory_pool and ran (consumer OK: got=7 block_size=64). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes ROADMAP item 7.4 — Phase 1 distribution (ADR-0004 §5). Adds CMake install/export rules and a pkg-config file so consumers can
find_package(pbr_memory_pool CONFIG REQUIRED)and linkpbr::memory_pool, and switches the release packaging tocmake --installso Release tarballs are complete,find_package-ready install trees.Motivation
The target already declared
$<INSTALL_INTERFACE:include>but there were noinstall()rules — the library could only be vendored. ADR-0004 §5 Phase 1 requiresfind_packagesupport and installable Release artifacts. A latent bug reinforced this:release.ymlhand-copied only 3 of the 7 public headers and shipped no package config, so the "install the artifacts from a Release" claim was untrue.Changes
SameMajorVersioncompatibility, the install gate, and pkg-config (with its documented configure-time-prefix limitation).CMakeLists.txt+cmake/*.in):PBR_MEMORY_POOL_INSTALLoption (defaultPROJECT_IS_TOP_LEVEL) gatesinstall(TARGETS … EXPORT), the fullit/d4np/memorypool/header tree, the package config + version file, the pkg-config.pc, andLICENSE.EXPORT_NAME memory_poolso the installed imported target ispbr::memory_pool— identical to the in-build alias. Onetarget_link_libraries(app pbr::memory_pool)line works whether the consumer vendors viaadd_subdirectory/FetchContentor links an installed package.release.ymlpackages viacmake --installinstead of hand-copying — fixes the missing-headers / missing-config bug; tarballs are now complete install trees.Design Patterns
Verification
clang-tidyclean on the diff — no C/C++ source changed (CMake + YAML + Markdown only).cmake --installto a staging prefix; a separate project then didfind_package(pbr_memory_pool CONFIG REQUIRED)+ linkedpbr::memory_pool, built, and ran (consumer OK: got=7 block_size=64). The installed targets file declaresadd_library(pbr::memory_pool STATIC IMPORTED); the.pccarries the correct prefix/libdir/version.Documentation Impact
Added (M7.4)+Changed (M7.4).