This should speed up incremental rebuilds after cmake runs.
# Avoid triggering a (full) rebuild by touching the files if they did not really change
configure_file("${CMAKE_HOME_DIRECTORY}/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h.generated" @ONLY IMMEDIATE)
+configure_file("${CMAKE_HOME_DIRECTORY}/src/simgrid/version.h.in" "${CMAKE_BINARY_DIR}/src/simgrid/version.h.generated" @ONLY IMMEDIATE)
configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid/config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated" @ONLY IMMEDIATE)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/internal_config.h.generated ${CMAKE_BINARY_DIR}/src/internal_config.h)
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/simgrid/version.h.generated ${CMAKE_BINARY_DIR}/src/simgrid/version.h)
execute_process(COMMAND ${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)
#define SIMGRID_VERSION_MAJOR @SIMGRID_VERSION_MAJOR@
#define SIMGRID_VERSION_MINOR @SIMGRID_VERSION_MINOR@
#define SIMGRID_VERSION_PATCH @SIMGRID_VERSION_PATCH@
-#define SIMGRID_GIT_VERSION "@GIT_VERSION@"
#define SIMGRID_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
SG_BEGIN_DECL()
--- /dev/null
+/* src/simgrid/version.h - internal versionning info */
+
+/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef SIMGRID_VERSION_H
+#define SIMGRID_VERSION_H
+
+#define SIMGRID_GIT_VERSION "@GIT_VERSION@"
+
+#endif /* SIMGRID_PUBLIC_CONFIG_H */
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/sg_config.hpp"
#include "src/internal_config.h"
+#include "src/simgrid/version.h"
#include "src/surf/HostImpl.hpp"
#include "src/surf/xml/platf.hpp"
#include "surf/surf.hpp"
set(source_of_generated_headers
include/simgrid/config.h.in
src/internal_config.h.in
+ src/simgrid/version.h.in
include/smpi/mpif.h.in)
### depend of some variables setted upper