Skip to content

Ignore the CPack staging directory in the CMake template - #4948

Merged
dooleydevin merged 1 commit into
github:mainfrom
SSuva4:ignore-cpack-staging
Nov 24, 2026
Merged

dooleydevin merged 1 commit into
github:mainfrom
SSuva4:ignore-cpack-staging

Conversation

@SSuva4

@SSuva4 SSuva4 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Link to the application or project's homepage

CPack (CMake)

Reasons for making this change

CPack stages package contents under _CPack_Packages/. When the packaging directory is inside the working tree, Git can list a second copy of the files being packaged as untracked. This rule ignores the staging directory at any depth while keeping packaging configuration files visible.

Verified with git check-ignore against the updated template: staging paths at the root and under build/ are ignored. CMakeLists.txt, packaging/CPackConfig.cmake, and a regular file named _CPack_Packages remain visible.

Links to documentation supporting these rule changes

CPack generator source defining the staging path and CPACK_PACKAGE_DIRECTORY documentation.

Merge and Approval Steps

@SSuva4
SSuva4 requested a review from a team as a code owner November 24, 2026 19:14
Copilot AI adaptive review requested due to automatic review settings November 24, 2026 19:14

Copilot AI 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.

🟢 Approval recommended

The review identifies no active issues, and the change cleanly targets CPack staging directories while preserving similarly named files and packaging configuration.

No open issues 🎉

What changed in this PR

Updates the CMake gitignore template to exclude CPack’s generated staging directories at any depth while keeping similarly named files and packaging configuration visible.

Changes:

  • Added _CPack_Packages/ as a directory-only ignore rule.
  • Preserved visibility for regular files named _CPack_Packages and other packaging files.
File Description
CMake.gitignore Adds a directory-only ignore rule for CPack staging directories at any depth.

Review effort: Lite (adaptive)

@dooleydevin dooleydevin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good! Thank you for the contribution!

@dooleydevin
dooleydevin merged commit 5e329a2 into github:main Nov 24, 2026
2 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.

3 participants