Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: refactor generate-adios2-config.sh #4405

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions cmake/install/post/generate-adios2-config.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
unset MAKEFLAGS
unset MAKE

declare PREFIX

function make_target_flags() {
local tgt=$1
sleep 1
Expand Down Expand Up @@ -58,21 +60,17 @@ function prefixify() {
echo "$@" | sed "s|${PREFIX}|\${ADIOS2_PREFIX}|g"
}

PREFIX="$1"
###########################################################################
# Main
arg_prefix="$1"

if [ "${1:0:1}" != "/" ]
# Prefix should be an absolute path, but if it's not, make it absolute
if [ "${arg_prefix:0:1}" != "/" ]
then
# Convert relative paths to absolute based on DESTDIR
PREFIX="${DESTDIR:-$(pwd)}/$1"
else
# Check if the DESTDIR directory exists and prepend it to PREFIX
if [ -d "${DESTDIR}" ]
then
PREFIX="${DESTDIR}$1"
fi
PREFIX="$PWD/$arg_prefix"
fi

shift
PREFIX="${DESTDIR}${arg_prefix}"

CMAKE="@CMAKE_COMMAND@"
SOURCE_DIR="@ADIOS2_SOURCE_DIR@/cmake/install/post/adios2-config-dummy"
Expand Down
Loading