Skip to content

Instantly share code, notes, and snippets.

@dardo82
Last active June 22, 2019 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dardo82/0b04bd22464fa6283af2b1bae247b672 to your computer and use it in GitHub Desktop.
Save dardo82/0b04bd22464fa6283af2b1bae247b672 to your computer and use it in GitHub Desktop.
Install OCV samples
#!/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