diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt index 3f69743f..54801bd1 100644 --- a/desktop_version/CMakeLists.txt +++ b/desktop_version/CMakeLists.txt @@ -16,6 +16,26 @@ SET(GOG OFF CACHE BOOL "Use the GOG API") IF(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") SET(STEAM ON) SET(GOG ON) +ELSE() + # Get interim commit and date of commit + FIND_PACKAGE(Git) + IF(GIT_FOUND) + EXECUTE_PROCESS( + COMMAND "${GIT_EXECUTABLE}" log -1 --format=%h + OUTPUT_VARIABLE INTERIM_COMMIT + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + ADD_DEFINITIONS(-DINTERIM_COMMIT="${INTERIM_COMMIT}") + + EXECUTE_PROCESS( + COMMAND "${GIT_EXECUTABLE}" log -1 --format=%cs + OUTPUT_VARIABLE COMMIT_DATE + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + ADD_DEFINITIONS(-DCOMMIT_DATE="${COMMIT_DATE}") + ENDIF() ENDIF() # Set standard to C++98/C++03 diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index 4a85d4d2..796e52da 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -40,6 +40,12 @@ void menurender() graphics.drawsprite((160 - 96) + 5 * 32, temp, 23, tr, tg, tb); #if defined(MAKEANDPLAY) graphics.Print(-1,temp+35," MAKE AND PLAY EDITION",tr, tg, tb, true); +#endif +#ifdef COMMIT_DATE + graphics.Print( 310 - (10*8), 210, COMMIT_DATE, tr/2, tg/2, tb/2); +#endif +#ifdef INTERIM_COMMIT + graphics.Print( 310 - (8*8), 220, INTERIM_COMMIT, tr/2, tg/2, tb/2); #endif graphics.Print( 310 - (4*8), 230, "v2.3", tr/2, tg/2, tb/2);