#!/bin/sh CMAKE_COMMAND="@CMAKE_COMMAND@" VTK_SOURCE_DIR="@VTK_SOURCE_DIR@" VTK_BINARY_DIR="@VTK_BINARY_DIR@" CMAKE_INSTALL_PREFIX="@CMAKE_INSTALL_PREFIX@" CMAKE_MAKE_PROGRAM="@CMAKE_MAKE_PROGRAM@" VTK_INSTALL_LIB_DIR="@VTK_INSTALL_LIB_DIR@" SOURCE_DIR="${VTK_SOURCE_DIR}/Common/Testing/Install" BINARY_DIR="${VTK_BINARY_DIR}/Common/Testing/Install" trap cleanup 1 2 3 6 cleanup() { ( cd "${VTK_BINARY_DIR}" if [ -d "bin-InstallTestTemp" ]; then mv "bin-InstallTestTemp" "bin" fi ) exit 1 } install() { echo "Erasing ${CMAKE_INSTALL_PREFIX}" && ([ ! -d "${CMAKE_INSTALL_PREFIX}" ] || rm -rf "${CMAKE_INSTALL_PREFIX}") && mkdir -p "${CMAKE_INSTALL_PREFIX}" && echo "Running make install" && ( cd "${VTK_BINARY_DIR}" && "${CMAKE_MAKE_PROGRAM}" install ) } setup() { echo "Entering ${BINARY_DIR}" && cd "${BINARY_DIR}" } write_cache() { install || return 1 setup || return 1 echo "Writing CMakeCache.txt" ( cat > CMakeCache.txt <