Skip to content

cmake: Only write config.hpp when changed#203

Closed
waywardmonkeys wants to merge 1 commit into
Gecode:release/6.3.0from
waywardmonkeys:cmake-rewrite-config-less
Closed

cmake: Only write config.hpp when changed#203
waywardmonkeys wants to merge 1 commit into
Gecode:release/6.3.0from
waywardmonkeys:cmake-rewrite-config-less

Conversation

@waywardmonkeys

Copy link
Copy Markdown

By using file(CONFIGURE) instead of file(WRITE), the file output will only be written if it has changed. This allows for running cmake to pick up other (possible) changes without triggering a full rebuild as happens when the config.hpp file has changed.

By using `file(CONFIGURE)` instead of `file(WRITE)`, the file
output will only be written if it has changed. This allows for
running `cmake` to pick up other (possible) changes without
triggering a full rebuild as happens when the `config.hpp`
file has changed.
@zayenz zayenz mentioned this pull request Jul 7, 2026
@zayenz

zayenz commented Jul 7, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution, and sorry this stayed open for so long.

I reviewed this against the current main branch and ported the useful part as a fresh commit: CMake now uses file(CONFIGURE ... CONTENT ...) for the generated config.hpp, so repeated configures do not rewrite the file when the contents are unchanged. The changelog entry credits your original PR.

I’m closing this PR as superseded by PR #214. Thank you for the clean build-system improvement.

@zayenz zayenz closed this Jul 7, 2026
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