Skip to content

Install only public headers, not build2 metafiles - #47

Merged
gistrec merged 1 commit into
masterfrom
fix/install-only-public-headers
Jul 9, 2026
Merged

Install only public headers, not build2 metafiles#47
gistrec merged 1 commit into
masterfrom
fix/install-only-public-headers

Conversation

@gistrec

@gistrec gistrec commented Jul 8, 2026

Copy link
Copy Markdown
Owner

What

cmake --install and meson install were leaking the build2 buildfile metafiles into the consumer's system include path.

  • CMakeLists.txtinstall(DIRECTORY include/ ...) copied the tree wholesale, dropping both include/buildfile and include/geo/buildfile under <prefix>/include/.
  • meson.buildinstall_subdir('include/geo', ...) did the same for include/geo/buildfile.

The build2 build itself never installs these (its hxx{*}: install = include/geo/ rule only ships headers) — only the CMake and Meson rules did.

Fix

  • CMake: restrict to FILES_MATCHING PATTERN "*.hpp".
  • Meson: add exclude_files: ['buildfile'] to install_subdir.

The build2 metafiles stay in the repo untouched — they're required source for the cppget.org package. Header-only change, no version bump, no release.

Verification

Installed both to a throwaway prefix; each now ships exactly the eight public headers and nothing else:

geo/bounds.hpp
geo/detail/math.hpp
geo/encoding.hpp
geo/geo.hpp
geo/latlng.hpp
geo/poly.hpp
geo/spherical.hpp
geo/version.hpp

find <prefix> -name buildfile → empty for both CMake and Meson. Does not affect the WrapDB consumption path, which pulls headers via the include dir and never runs meson install.

CMake's install(DIRECTORY include/) and Meson's install_subdir both
copied the include tree wholesale, dropping the build2 buildfile
metafiles (include/buildfile, include/geo/buildfile) into the
consumer's system include path. The build2 build itself never installs
them -- only these two rules did.

Restrict the CMake rule to FILES_MATCHING PATTERN "*.hpp" and add
exclude_files: ['buildfile'] to the Meson install_subdir. Both now
install exactly the eight public headers (detail/ preserved) and
nothing else. The build2 metafiles stay in the repo untouched;
header-only, no version change.
@gistrec
gistrec merged commit 69a1f84 into master Jul 9, 2026
13 checks passed
@gistrec
gistrec deleted the fix/install-only-public-headers branch July 9, 2026 14:26
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