1
# Install a pre-commit hook to bootstrap commit hooks.
2
if(EXISTS "${SimpleITK_SOURCE_DIR}/.git/config" AND
3
NOT EXISTS "${SimpleITK_SOURCE_DIR}/.git/hooks/pre-commit")
4
# Silently ignore the error if the hooks directory is read-only.
6
COMMAND ${CMAKE_COMMAND} -E copy ${ITK_SOURCE_DIR}/CMake/pre-commit
7
${ITK_SOURCE_DIR}/.git/hooks/pre-commit
8
OUTPUT_VARIABLE _output
10
RESULT_VARIABLE _result
12
if(_result AND NOT "${_output}" MATCHES "Error copying file")