3
0
mirror of https://github.com/triqs/dft_tools synced 2025-01-12 05:58:18 +01:00

Add macro to get git hash for applications

This commit is contained in:
Michel Ferrero 2014-05-24 00:39:41 +02:00
parent b0c969a507
commit 4404fd191b

View File

@ -40,6 +40,17 @@ set(TRIQS_SPHINXBUILD_EXECUTABLE @SPHINXBUILD_EXECUTABLE@)
set(TRIQS_THEMES_PATH @CMAKE_INSTALL_PREFIX@/share/triqs/themes)
set(TRIQS_MATHJAX_PATH @MATHJAX_PATH@)
# Git
set(TRIQS_GIT_EXECUTABLE @GIT_EXECUTABLE@)
macro(triqs_get_git_hash DIR PREFIX)
execute_process(COMMAND @GIT_EXECUTABLE@ rev-parse HEAD
WORKING_DIRECTORY "${DIR}"
RESULT_VARIABLE GIT_RESULT
OUTPUT_VARIABLE "${PREFIX}_GIT_HASH"
ERROR_VARIABLE GIT_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE)
endmacro(triqs_get_git_hash)
# for people who want to quickly add everything TRIQS has detected...
set(TRIQS_LIBRARY_ALL ${TRIQS_LIBRARY} ${TRIQS_LIBRARY_BOOST} ${TRIQS_LIBRARY_PYTHON} ${TRIQS_LIBRARY_MPI} ${TRIQS_LIBRARY_HDF5} ${TRIQS_LIBRARY_LAPACK} ${TRIQS_LIBRARY_FFTW} ${TRIQS_LIBRARY_GMP} ${TRIQS_LIBRARY_GSL} )
set(TRIQS_INCLUDE_ALL ${TRIQS_INCLUDE} ${TRIQS_INCLUDE_BOOST} ${TRIQS_INCLUDE_PYTHON} ${TRIQS_INCLUDE_MPI} ${TRIQS_INCLUDE_HDF5} ${TRIQS_INCLUDE_LAPACK} ${TRIQS_INCLUDE_FFTW} ${TRIQS_INCLUDE_GMP} ${TRIQS_INCLUDE_GSL} )