Skip to content

Commit 8a00302

Browse files
cmake: Only write config.hpp when 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.
1 parent f7f0d7c commit 8a00302

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ foreach (i RANGE ${length})
271271
string(REPLACE "<semi>" ";" line "${line}")
272272
set(CONFIG_OUT "${CONFIG_OUT}${line}")
273273
endforeach ()
274-
file(WRITE ${GECODE_BINARY_DIR}/gecode/support/config.hpp
274+
file(CONFIGURE OUTPUT ${GECODE_BINARY_DIR}/gecode/support/config.hpp CONTENT
275275
"/* gecode/support/config.hpp. Generated from config.hpp.in by configure. */
276276
/* gecode/support/config.hpp.in. Generated from configure.ac by autoheader. */
277277

0 commit comments

Comments
 (0)