From d545c70d780f8efba5289f89cc56342009998728 Mon Sep 17 00:00:00 2001 From: Vicente Bolea Date: Wed, 18 Oct 2023 10:18:18 -0400 Subject: [PATCH] Fix destdir install test (#3850) * Fix usage of DESTDIR for absolute paths * Update cmake/install/post/generate-adios2-config.sh.in --------- Co-authored-by: Tilman Dannert (cherry picked from commit 861ccb7a6a3293b251f8e1ed5125f69d66c705de) --- cmake/install/post/generate-adios2-config.sh.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/install/post/generate-adios2-config.sh.in b/cmake/install/post/generate-adios2-config.sh.in index 18ce48ca73..9b3376883d 100755 --- a/cmake/install/post/generate-adios2-config.sh.in +++ b/cmake/install/post/generate-adios2-config.sh.in @@ -64,6 +64,12 @@ if [ "${1:0:1}" != "/" ] then # Convert relative paths to absolute based on DESTDIR PREFIX="${DESTDIR:-$(pwd)}/$1" +else + # check if the PREFIX directory exists and prepend DESTDIR if not + if [ ! -d "${PREFIX}" ] + then + PREFIX="${DESTDIR}$1" + fi fi shift