Commit b1cb5625 authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

FIXED git info should use the given source directory

parent 2049c877
......@@ -6,38 +6,38 @@
#!
#! Usage:
#! \code
#! get_git_info(dir)
#! get_git_info(PATH_TO_SOURCE_DIR)
#! \endcode
#!
#! \inparam dir (required) input directory path
#! \inparam PATH_TO_SOURCE_DIR (required) input source directory path
#!
macro(get_git_info dir)
macro(get_git_info PATH_TO_SOURCE_DIR)
execute_process(COMMAND ${GIT_EXECUTABLE} rev-list HEAD --count
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${PATH_TO_SOURCE_DIR}
OUTPUT_VARIABLE CAMITK_GIT_COMMIT_COUNT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${PATH_TO_SOURCE_DIR}
OUTPUT_VARIABLE CAMITK_GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${PATH_TO_SOURCE_DIR}
OUTPUT_VARIABLE CAMITK_GIT_ABBREVIATED_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%H
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${PATH_TO_SOURCE_DIR}
OUTPUT_VARIABLE CAMITK_GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%cd
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${PATH_TO_SOURCE_DIR}
OUTPUT_VARIABLE CAMITK_GIT_COMMITER_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
......@@ -50,4 +50,4 @@ macro(get_git_info dir)
set(CAMITK_GIT_ABBREVIATED_HASH "unknown")
endif()
endmacro()
\ No newline at end of file
endmacro()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment