Skip to content

Install CMake package exports and pkg-config metadata - #23

Merged
d-torrance merged 2 commits into
Macaulay2:masterfrom
dimpase:install-cmake-package
Sep 18, 2026
Merged

d-torrance merged 2 commits into
Macaulay2:masterfrom
dimpase:install-cmake-package

Conversation

@dimpase

@dimpase dimpase commented Sep 17, 2026 •

Copy link
Copy Markdown

CMake builds currently install the library and headers but no package configuration, exported target, or pkg-config metadata. This prevents consumers from using find_package(memtailor CONFIG) directly and makes distribution packaging require extra installation fixes.

This change installs memtailorConfig.cmake, version metadata, and the memtailor::memtailor target using GNUInstallDirs. The target supplies include paths, C++17, Threads, and the installed library's ABI-affecting MEMT_DEBUG setting, including when the consumer uses a different build configuration. Shared libraries use the existing Autotools SONAME/version. CMake also installs memtailor.pc, including debug flags, and the README documents building and consuming the package.

The existing Linux/macOS CI gains relocated install-and-consume checks for shared/static and Release/Debug builds. The consumer deliberately requests C++11 to check that the exported C++17 requirement upgrades it. CTest is enabled at the project root so a normal root-level test invocation discovers the unit tests. Autotools distribution metadata includes the new CMake templates and consumer fixture.

Local Gentoo validation:

  • All 26 unit tests pass in each shared/static × Release/Debug configuration.
  • All four relocated installed consumers pass; Release consumers of Debug libraries inherit MEMT_DEBUG.
  • The updated CMake-based Gentoo ebuild builds and stages installation with tests enabled and disabled.
  • Separate consumers work through the installed CMake target, pkg-config, and M2's existing FindMemtailor.cmake.
  • Workflow lint passes. Full M2 was not rebuilt.

The Gentoo ebuild carries the CMake changes as a patch against v1.4 until an upstream release includes them. It is maintained outside this repository.

🤖 gpt-6-astra worked on this 🤖

dimpase and others added 2 commits September 17, 2026 15:36
Export memtailor::memtailor with C++17, Threads and the installed debug ABI setting. Use GNUInstallDirs and the Autotools SONAME, and test relocated shared/static installations in CI.

Co-authored-by: Codex <noreply@openai.com>
Ubuntu does not search lib64 by default; let GNUInstallDirs select the platform library directory for prefix-based discovery.

Co-authored-by: Codex <noreply@openai.com>

@dimpase dimpase left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. @d-torrance - can you have a look?

@d-torrance d-torrance left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@d-torrance
d-torrance merged commit 0a2afc3 into Macaulay2:master Sep 18, 2026
4 checks passed
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.

2 participants