diff --git a/scripts/linux/archlinux/install_dependencies.sh b/scripts/linux/archlinux/install_dependencies.sh index bfa236627f9..3d54fdbfe9b 100755 --- a/scripts/linux/archlinux/install_dependencies.sh +++ b/scripts/linux/archlinux/install_dependencies.sh @@ -18,8 +18,12 @@ if [ $exit_code != 0 ]; then exit $exit_code fi +# get the root directory of this script +ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + # Update addon_config.mk files to use OpenCV 3 or 4 depending on what's installed addons_dir="$(readlink -f "$ROOT/../../../addons")" + $(pkg-config opencv4 --exists) exit_code=$? if [ $exit_code != 0 ]; then @@ -29,4 +33,4 @@ else echo "Updating ofxOpenCV to use openCV4" sed -i -E 's/ADDON_PKG_CONFIG_LIBRARIES =(.*)opencv\s/ADDON_PKG_CONFIG_LIBRARIES =\1opencv4 /g' "$addons_dir/ofxOpenCv/addon_config.mk" sed -i -E 's/ADDON_PKG_CONFIG_LIBRARIES =(.*)opencv$/ADDON_PKG_CONFIG_LIBRARIES =\1opencv4/g' "$addons_dir/ofxOpenCv/addon_config.mk" -fi \ No newline at end of file +fi