From 7fc79252fcac6f3fc2627889d3b37445b27e7a69 Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Sun, 4 Feb 2024 17:21:15 +0000 Subject: [PATCH] Add options for external directory --- build-linux.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build-linux.sh b/build-linux.sh index 98421df..ac864e0 100755 --- a/build-linux.sh +++ b/build-linux.sh @@ -2,10 +2,13 @@ set -euo pipefail CONFIG="${1?}" -VERSION="${2?}" +TESSERACT_VERSION="${2?}" +LEPTONICA_VERSION="${3?}" +TESSERACT_DIR="${4-tesseract-$TESSERACT_VERSION}" +LEPTONICA_DIR="${5-leptonica-$LEPTONICA_VERSION}" # configure leptonica -cmake leptonica-$LEPTONICA_VERSION -B "leptonica_build_$CONFIG" \ +cmake $LEPTONICA_DIR -B "leptonica_build_$CONFIG" \ -DCMAKE_INSTALL_PREFIX="release/leptonica/$CONFIG" \ -DCMAKE_BUILD_TYPE="$CONFIG" \ -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \ @@ -25,7 +28,7 @@ cmake --build "leptonica_build_$CONFIG" cmake --install "leptonica_build_$CONFIG" --prefix "release/leptonica/$CONFIG" # configure tesseract -cmake tesseract-$TESSERACT_VERSION -B "tesseract_build_${CONFIG}" \ +cmake $TESSERACT_DIR -B "tesseract_build_${CONFIG}" \ -DCMAKE_INSTALL_PREFIX="release/tesseract/$CONFIG" \ -DCMAKE_BUILD_TYPE="$CONFIG" \ -DBUILD_SHARED_LIBS=OFF \ @@ -45,5 +48,5 @@ cmake --install "tesseract_build_${CONFIG}" --prefix "release/tesseract/$CONFIG" # copy leptonica static libraries to tesseract cp -r "release/leptonica/$CONFIG/lib" "release/tesseract/$CONFIG/" -tar -C "release/tesseract/$CONFIG" -cvf "release/tesseract-linux-$VERSION-$CONFIG.tar.gz" . +tar -C "release/tesseract/$CONFIG" -cvf "release/tesseract-linux-$TESSERACT_VERSION-$CONFIG.tar.gz" .