Skip to content

Commit

Permalink
cmake: refactor generate-adios2-config.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
vicentebolea committed Nov 18, 2024
1 parent 3edaecb commit 49b34b3
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 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,22 +60,15 @@ function prefixify() {
echo "$@" | sed "s|${PREFIX}|\${ADIOS2_PREFIX}|g"
}

PREFIX="$1"
ARG_PREFIX="$1"

if [ "${1:0:1}" != "/" ]
if [ "${ARG_PREFIX:0:1}" != "/" ] && [ -z "$DESTDIR" ]
then
# Convert relative paths to absolute based on DESTDIR
PREFIX="${DESTDIR:-$(pwd)}/$1"
PREFIX="$PWD/$ARG_PREFIX"
else
# Check if the DESTDIR directory exists and prepend it to PREFIX
if [ -d "${DESTDIR}" ]
then
PREFIX="${DESTDIR}$1"
fi
PREFIX="$DESTDIR/$ARG_PREFIX"
fi

shift

CMAKE="@CMAKE_COMMAND@"
SOURCE_DIR="@ADIOS2_SOURCE_DIR@/cmake/install/post/adios2-config-dummy"
BUILD_DIR=$(mktemp -d)
Expand Down

0 comments on commit 49b34b3

Please sign in to comment.