Skip to content

cmake: dedupe expressions into local vars in cmake_uninstall.in.cmake#22194

Closed
vszakats wants to merge 4 commits into
curl:masterfrom
vszakats:cm-uninstt-tidy
Closed

cmake: dedupe expressions into local vars in cmake_uninstall.in.cmake#22194
vszakats wants to merge 4 commits into
curl:masterfrom
vszakats:cm-uninstt-tidy

Conversation

@vszakats

@vszakats vszakats commented Jun 26, 2026

Copy link
Copy Markdown
Member

Also: use IN LISTS syntax.

Follow-up to 27e2a47

@github-actions github-actions Bot added the build label Jun 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the CMake uninstall script template (CMake/cmake_uninstall.in.cmake) to reduce repeated expressions and use more idiomatic CMake list iteration, improving readability while preserving behavior.

Changes:

  • Introduces a local _manifest variable for the install_manifest.txt path and reuses it for existence checks and reading.
  • Switches foreach(_file ...) to foreach(_file IN LISTS _files) after converting the manifest content into a semicolon-separated list.
  • Introduces a _target local variable for $ENV{DESTDIR}${_file} to deduplicate repeated path expressions and simplify log/remove statements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vszakats vszakats closed this in b8fa725 Jun 26, 2026
@vszakats vszakats deleted the cm-uninstt-tidy branch June 26, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants