X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d1181eb8d2c8e9b1d3250fb78cba6b67769eecee..98aaf6c28dde5365ca65b9b18182042f45867e70:/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 1276c4d157..9b3995b14f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -630,12 +630,18 @@ endif() ### Generate the required headers and scripts ############################################# -configure_file("${CMAKE_HOME_DIRECTORY}/tools/cmake/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h" @ONLY IMMEDIATE) -configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid_config.h" @ONLY IMMEDIATE) +# Avoid triggering a (full) rebuild by touching the files if they did not really change +configure_file("${CMAKE_HOME_DIRECTORY}/tools/cmake/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h.generated" @ONLY IMMEDIATE) +configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid_config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated" @ONLY IMMEDIATE) +exec_program("${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/internal_config.h.generated ${CMAKE_BINARY_DIR}/src/internal_config.h") +exec_program("${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated ${CMAKE_BINARY_DIR}/include/simgrid_config.h") +file(REMOVE ${CMAKE_BINARY_DIR}/src/internal_config.h.generated) +file(REMOVE ${CMAKE_BINARY_DIR}/include/simgrid_config.h.generated) # We need two versions of the SMPI scripts because they contain the path to the library # so, it depends of whether SimGrid is installed, or run from the sources (during the build) -file(READ ${CMAKE_HOME_DIRECTORY}/src/smpi/smpitools.sh SMPITOOLS_SH) # Definitions shared amongst all scripts, inlined in each of them + +file(READ ${CMAKE_HOME_DIRECTORY}/src/smpi/smpitools.sh SMPITOOLS_SH) # Definitions shared amongst all SMPI scripts, inlined in each of them ### SMPI script used when simgrid is installed set(exec_prefix ${CMAKE_INSTALL_PREFIX})