Skip to content

Commit

Permalink
Merge pull request #4405 from vicentebolea/update-adios2-config
Browse files Browse the repository at this point in the history
cmake: refactor generate-adios2-config.sh
  • Loading branch information
vicentebolea authored Dec 7, 2024
2 parents 0548102 + d1bd757 commit a366efc
Showing 1 changed file with 9 additions and 11 deletions.
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

0 comments on commit a366efc

Please sign in to comment.