Commit e3ec1955 authored by Marcus D. Hanwell's avatar Marcus D. Hanwell

ENH: Added check for local hooks in ParaView.

This adds a check for the local hooks in ParaView's source tree. It also
checks and instructs on setting up the VTK local hooks to avoid two
errors in a row for each set of hooks. Instructions are provided for
bypassing the check, and they are automatically skipped when the source
tree is not a git clone, or when CTest is driving the build.
parent 2c08fb92
......@@ -23,3 +23,49 @@ foreach(submodule ${ParaView_Submodules})
CheckGitDirectory("${ParaView_SOURCE_DIR}/${submodule}")
endif()
endforeach()
# Emit a fatal error and inform the user if they have not enabled hooks.
option(ParaView_IGNORE_HOOKS "Should the ParaView hooks check be ignored?" OFF)
option(VTK_IGNORE_HOOKS "Should the VTK hooks check be ignored?" OFF)
if(DEFINED ENV{DASHBOARD_TEST_FROM_CTEST})
set(ParaView_FROM_CTEST TRUE)
endif()
if(NOT VTK_IGNORE_HOOKS AND NOT ParaView_FROM_CTEST AND
EXISTS "${VTK_SOURCE_DIR}/.git/config")
# Now check the VTK local hooks - mostly a convenience to avoid two failures.
if(NOT EXISTS "${VTK_SOURCE_DIR}/.git/hooks/.git/config")
set(VTK_GIT_HOOKS
"cd ${VTK_SOURCE_DIR}/.git/hooks
git init
git pull .. remotes/origin/hooks")
set(VTK_GIT_HOOKS2 "
If you wish to ignore this check for a build set the CMake cache variable
VTK_IGNORE_HOOKS to ON. To ignore this check in all builds either archive
your clone, or create the file ${VTK_SOURCE_DIR}/.git/hooks/.git/config
in your source tree.
")
endif()
endif()
if(NOT ParaView_IGNORE_HOOKS AND NOT ParaView_FROM_CTEST AND
EXISTS "${ParaView_SOURCE_DIR}/.git/config")
if(NOT EXISTS "${ParaView_SOURCE_DIR}/.git/hooks/.git/config")
message(FATAL_ERROR "
Please initialize your local Git hooks, paste the following into a shell:
cd ${ParaView_SOURCE_DIR}/.git/hooks
git init
git pull .. remotes/origin/hooks
${VTK_GIT_HOOKS}
cd ${ParaView_SOURCE_DIR}
See http://www.vtk.org/Wiki/VTK/Git#Hooks for more details.
If you wish to ignore this check for a build set the CMake cache variable
ParaView_IGNORE_HOOKS to ON. To ignore this check in all builds either archive
your clone, or create the file ${ParaView_SOURCE_DIR}/.git/hooks/.git/config
in your source tree.
${VTK_GIT_HOOKS2}")
endif()
endif()
......@@ -232,8 +232,9 @@ SET (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ParaView_CMAKE_DIR})
SET(ParaView_QT_DIR ${ParaView_SOURCE_DIR}/Qt)
SET(PARAVIEW_QT_QMAKE_EXECUTABLE ${QT_QMAKE_EXECUTABLE})
# Check that the Git submodules have been initialized correctly
INCLUDE(ParaViewCheckSubmodules)
# Check that the Git submodules have been initialized correctly, and the local
# Git hooks have been installed.
INCLUDE(ParaViewCheckSourceTree)
INCLUDE(ParaViewMacros)
INCLUDE(ParaViewCommon)
......
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