From 8a00302f772824ab310af3602387760886753add Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Mon, 10 Mar 2025 14:53:44 +0700 Subject: [PATCH] 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. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f7803ec30..7a4918e177 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -271,7 +271,7 @@ foreach (i RANGE ${length}) string(REPLACE "" ";" line "${line}") set(CONFIG_OUT "${CONFIG_OUT}${line}") endforeach () -file(WRITE ${GECODE_BINARY_DIR}/gecode/support/config.hpp +file(CONFIGURE OUTPUT ${GECODE_BINARY_DIR}/gecode/support/config.hpp CONTENT "/* gecode/support/config.hpp. Generated from config.hpp.in by configure. */ /* gecode/support/config.hpp.in. Generated from configure.ac by autoheader. */