Skip to content

cmake/ci: enforce install contract for packagers (fail-fast + smoke test)#451

Open
piotrekoo wants to merge 1 commit into3MFConsortium:developfrom
piotrekoo:fix/homebrew-install-layout
Open

cmake/ci: enforce install contract for packagers (fail-fast + smoke test)#451
piotrekoo wants to merge 1 commit into3MFConsortium:developfrom
piotrekoo:fix/homebrew-install-layout

Conversation

@piotrekoo
Copy link

@piotrekoo piotrekoo commented Feb 13, 2026

Fixes #450,

This PR hardens the install contract for downstream packagers (e.g. Homebrew) by validating installation end-to-end instead of relying on manual downstream workarounds.

What changed

  • Keep canonical install rules for:
    • install(TARGETS lib3mf ...)
    • lib3mf.pc
  • Add fail-fast post-build verification that the built lib3mf target file exists:
    • cmake/VerifyTargetFile.cmake
    • invoked via POST_BUILD in CMake.
  • Add packager-oriented install smoke test:
    • CI/install_smoke_test.sh
    • configures with:
      • -DUSE_INCLUDED_ZLIB=OFF
      • -DUSE_INCLUDED_LIBZIP=OFF
      • -DUSE_INCLUDED_SSL=OFF
      • -DLIB3MF_TESTS=OFF
    • runs cmake --install
    • verifies installed artifacts:
      • lib3mf*.so|dylib
      • lib3mf.pc
      • C headers (lib3mf.h, lib3mf_types.h)
    • verifies downstream usability via:
      • pkg-config --cflags --libs lib3mf
      • minimal compile/link test with #include <lib3mf.h>.
  • Add CI job install-linux-packagers-smoke to enforce this contract in upstream CI.
  • Updated install-dir handling to respect GNUInstallDirs defaults unless explicitly overridden by the caller.
  • Updated lib3mf.pc template:
    • moved transitive deps to Libs.private (-lzip -lz)
    • updated Cflags to point to the C API headers in Bindings/C.

Why

Install regressions can reappear if only install rules exist but are not validated after cmake --install.
This PR makes the packager configuration explicitly tested and guaranteed upstream.

@piotrekoo piotrekoo force-pushed the fix/homebrew-install-layout branch from 44fa4b7 to 51867e2 Compare February 15, 2026 11:26
@piotrekoo piotrekoo changed the title cmake: install shared library and C++ headers for packagers cmake: install shared library and C/C++ headers for packagers Feb 15, 2026
@piotrekoo piotrekoo force-pushed the fix/homebrew-install-layout branch 2 times, most recently from 740df9d to cbdd3bc Compare February 15, 2026 16:24
@piotrekoo piotrekoo changed the title cmake: install shared library and C/C++ headers for packagers cmake/ci: enforce install contract for packagers (fail-fast + smoke test) Feb 15, 2026
@piotrekoo piotrekoo force-pushed the fix/homebrew-install-layout branch from cbdd3bc to 0c26902 Compare February 15, 2026 17:36
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