Skip to content

Detect CMake is used as subproject - #4994

Open
jlee303 wants to merge 1 commit into
devfrom
detect-cmake-subproject
Open

jlee303 wants to merge 1 commit into
devfrom
detect-cmake-subproject

Conversation

@jlee303

@jlee303 jlee303 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What and why

  • Address Detect when CMake is used as a subproject #3468, add ZSTD_IS_SUBPROJECT flag, which automatically detects unless caller sets explcitly
  • When set to true, Zstd skips creating clean-all and uninstall avoiding collision with parent project targets
  • Added CI check

Checklist

  • I searched open pull requests and issues: this problem is not already being addressed.
  • Bug fix: it comes with a reproducer or a test that fails without the fix.
  • Performance change: numbers from repeated runs are included, with CPU, compiler, flags and data.
    A gain in one configuration is not a general gain: see the Performance section of CONTRIBUTING.md.
  • I stated below whether AI or other automated tools were used.

Tools used

  • Used codex to verify implementation

@meta-cla meta-cla Bot added the CLA Signed label Nov 18, 2026

@Cyan4973 Cyan4973 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minor: ZSTD_IS_SUBPROJECT is not documented, and cmake -LH does not list it, since it is a normal variable rather than a cache option. A line in the FetchContent section of build/cmake/README.md would help, for example: set ZSTD_IS_SUBPROJECT before add_subdirectory() or FetchContent_MakeAvailable() to override the detection.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants