Last active
June 22, 2019 02:16
-
-
Save dardo82/0b04bd22464fa6283af2b1bae247b672 to your computer and use it in GitHub Desktop.
Install OCV samples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
PMS="macports"; PKG="opencv"; DIR="samples/cpp"; BIN="$1" | |
sudo port install $PKG; sudo port fetch $PKG; sudo port extract $PKG | |
MPP=$(man -w $PMS.conf); prefix=$(zegrep -m1 '^/' $MPP) | |
cd ${$(eval grep 'cache$' ${$(zegrep -m1 $PMS'\\&.conf$' $MPP)/\\&/} | cut -f2)%/*}/*$PKG*/*$PKG*/*/*$PKG*/$DIR | |
sudo g++ $(pkg-config --cflags --libs $PKG) $BIN.cpp -o $BIN | |
sudo cp $BIN /usr/local/bin; sudo port clean $PKG; sudo port reclaim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment