1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
#!/bin/sh
#
#
# KIM-API: An API for interatomic models
# Copyright (c) 2013--2022, Regents of the University of Minnesota.
# All rights reserved.
#
# Contributors:
# Ryan S. Elliott
# Yaser Afshar
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
#
# Release: This file is part of the kim-api.git repository.
#
# Ensure that this script is sourced, not executed
BASENAME_SOURCE=`basename -- "$0" 2> /dev/null`
if test -n "${ZSH_VERSION}"; then
if test $options[posixargzero] != "on"; then
setopt posixargzero
BASENAME_SOURCE=`basename -- "$0" 2> /dev/null`
setopt posixargzero
fi
fi
if test x"${BASENAME_SOURCE}" = x"@PROJECT_NAME@-activate"; then
(>&2 printf "\nError:\t@PROJECT_NAME@-activate must be sourced.\n"
printf "\tRun 'source @PROJECT_NAME@-activate' not "
printf "'@PROJECT_NAME@-activate'.\n\n")
exit 1
fi
if test -n "${ORIGIN}"; then
OLD_KIM_ORIGIN="${ORIGIN}"
fi
if test -n "${ZSH_VERSION}"; then
ORIGIN=$(cd "$(dirname "${(%):-%x}")" && pwd)
else
# Get ORIGIN location of this script:
SOURCE="${BASH_SOURCE[0]}"
# https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself
if command -v readlink >/dev/null 2>&1; then
while test -h "$SOURCE"; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
fi
ORIGIN="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
fi
export PATH="${ORIGIN}:${PATH}"
if test -n "${PKG_CONFIG_PATH+x}"; then export PKG_CONFIG_PATH=":${PKG_CONFIG_PATH}"; fi
_libdir_rel=$(cd "@_libdir_rel@" && pwd)
export PKG_CONFIG_PATH=${_libdir_rel}/pkgconfig${PKG_CONFIG_PATH}
unset _libdir_rel
_installdir_rel=$(cd "@_installdir_rel@" && pwd)
export @KIM_API_ENVIRONMENT_CMAKE_PREFIX_DIR@=${_installdir_rel}
unset _installdir_rel
if test -n "${ZSH_VERSION}"; then
source "@_zshcompdir_rel@/_@PROJECT_NAME@-collections-management"
else
source "@_bashcompdir_rel@/@PROJECT_NAME@-collections-management.bash"
fi
if test -n "${OLD_KIM_ORIGIN}"; then
ORIGIN="${OLD_KIM_ORIGIN}"
unset OLD_KIM_ORIGIN
else
unset ORIGIN
fi
|