Skip to content
Snippets Groups Projects
Commit c85375c3 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Improved git revision management

parent 207ee11f
No related branches found
No related tags found
No related merge requests found
...@@ -38,9 +38,13 @@ get_git_head_revision(GITREV GITHASH) ...@@ -38,9 +38,13 @@ get_git_head_revision(GITREV GITHASH)
git_local_changes(GITHASLOCALCHANGES) git_local_changes(GITHASLOCALCHANGES)
message("git rev ${GITREV} : ${GITHASH} (${GITHASLOCALCHANGES})") message("git rev ${GITREV} : ${GITHASH} (${GITHASLOCALCHANGES})")
file(WRITE "${CMAKE_BINARY_DIR}/git_revision.hpp" "#define GITREV \"${GITREV}\"\n") #file(WRITE "${CMAKE_BINARY_DIR}/git_revision.hpp.in" "#define GITREV \"${GITREV}\"\n")
file(APPEND "${CMAKE_BINARY_DIR}/git_revision.hpp" "#define GITHASH \"${GITHASH}\"\n") #file(APPEND "${CMAKE_BINARY_DIR}/git_revision.hpp.in" "#define GITHASH \"${GITHASH}\"\n")
file(APPEND "${CMAKE_BINARY_DIR}/git_revision.hpp" "#define GITHASLOCALCHANGES \"${GITHASLOCALCHANGES}\"\n") #file(APPEND "${CMAKE_BINARY_DIR}/git_revision.hpp.in" "#define GITHASLOCALCHANGES \"${GITHASLOCALCHANGES}\"\n")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/git_revision.hpp.in" "${CMAKE_CURRENT_BINARY_DIR}/git_revision.hpp")
list(APPEND SOURCES git_revision.hpp)
include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_BINARY_DIR})
......
#define GITREV "@GITREV@"
#define GITHASH "@GITHASH@"
#define GITHASLOCALCHANGES "@GITHASLOCALCHANGES@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment