set_revision_number.cmake 611 Bytes
Newer Older
1
2
3
4
5
6
7
8
# get the result of svnrevision of ${dir} directory, and configure file
# with ${file_in} to ${file_out}
# file of pylmgc90

# It is not included in a CMakeLists.txt to be able to run
# the command as an input script so that is up to date
# when typing 'make'

9
if(GIT_EXECUTABLE)
10
  execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir ${dir}/.git --work-tree=${dir} rev-parse HEAD
11
12
13
                  OUTPUT_VARIABLE git_revision
                  OUTPUT_STRIP_TRAILING_WHITESPACE
                 )
14
else(GIT_EXECUTABLE)
15
  set(git_revision "unknown")
16
endif(GIT_EXECUTABLE)
17
18
19

configure_file(${file_in} ${file_out})