diff --git a/cmake/TRIQSConfig.cmake.in b/cmake/TRIQSConfig.cmake.in index ac6c4c5b..833290c0 100644 --- a/cmake/TRIQSConfig.cmake.in +++ b/cmake/TRIQSConfig.cmake.in @@ -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} )