1# Install a pre-commit hook to bootstrap commit hooks.
2if(EXISTS "${VTK_SOURCE_DIR}/.git/config" AND
3    NOT EXISTS "${VTK_SOURCE_DIR}/.git/hooks/pre-commit")
4  # Silently ignore the error if the hooks directory is read-only.
5  execute_process(
6    COMMAND ${CMAKE_COMMAND} -E copy ${VTK_SOURCE_DIR}/CMake/pre-commit
7                                     ${VTK_SOURCE_DIR}/.git/hooks/pre-commit
8    OUTPUT_VARIABLE _output
9    ERROR_VARIABLE  _output
10    RESULT_VARIABLE _result
11    )
12  if(_result AND NOT "${_output}" MATCHES "Error copying file")
13    message("${_output}")
14  endif()
15endif()
16