From feed6cf0d74e30e26008916618172e2afba5a378 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 12 Jan 2017 13:25:04 +0100 Subject: [PATCH] make the propaganda useful (and thus desirable) to the users --- CMakeLists.txt | 2 ++ include/simgrid_config.h.in | 2 ++ src/surf/surf_interface.cpp | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e41ea66331..62b507d507 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -660,6 +660,8 @@ if(EXISTS ${CMAKE_HOME_DIRECTORY}/.git/) endif() elseif(EXISTS ${CMAKE_HOME_DIRECTORY}/.gitversion) FILE(STRINGS ${CMAKE_HOME_DIRECTORY}/.gitversion GIT_VERSION) +else() + set(GIT_VERSION "none, release version") endif() ### Generate the required headers and scripts diff --git a/include/simgrid_config.h.in b/include/simgrid_config.h.in index b9726b9c3d..0d0cd0db1a 100644 --- a/include/simgrid_config.h.in +++ b/include/simgrid_config.h.in @@ -14,6 +14,8 @@ #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() /** Retrieves the version numbers of the used dynamic library (so, DLL or dynlib), while diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 7c3d2d5ad0..45ccea0f66 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -284,7 +284,8 @@ void sg_version_get(int* ver_major, int* ver_minor, int* ver_patch) void sg_version() { - std::printf("This program was linked against %s\n", SIMGRID_VERSION_STRING); + std::printf("This program was linked against %s (git: %s), found in %s.\n", + SIMGRID_VERSION_STRING, SIMGRID_GIT_VERSION, SIMGRID_INSTALL_PREFIX); #if HAVE_MC std::printf(" Model-checking support compiled in.\n"); -- 2.20.1