Created
December 1, 2014 09:45
-
-
Save abhinavjain241/60e5a62272f585a21392 to your computer and use it in GitHub Desktop.
Compile OpenCV C/C++
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/bash | |
echo "compiling $1" | |
if [[ $1 == *.c ]] | |
then | |
gcc -ggdb `pkg-config --cflags opencv` -o `basename $1 .c` $1 `pkg-config --libs opencv`; | |
elif [[ $1 == *.cpp ]] | |
then | |
g++ -ggdb `pkg-config --cflags opencv` -o `basename $1 .cpp` $1 `pkg-config --libs opencv`; | |
else | |
echo "Please compile only .c or .cpp files" | |
fi | |
echo "Output file => ${1%.*}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment