Skip to content

Commit

Permalink
Correct handling of OpenCV path.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Kamenev committed Oct 14, 2015
1 parent bb62af7 commit a0e60f6
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ have_cub=no
cub_path=
cub_check=cub/cub.cuh

have_opencv=no
opencv_path=
opencv_check=include/opencv2/opencv.hpp

mathlib=

# List from best to worst choice
Expand All @@ -46,6 +50,7 @@ default_cudas="cuda-7.5 cuda-7.0 cuda-6.5"
default_kaldis="kaldi-trunk"
default_gdks="."
default_cubs="cub-1.4.1"
default_opencvs="opencv-3.0.0"

function default_paths ()
{
Expand Down Expand Up @@ -111,6 +116,11 @@ function find_cub ()
find_dir "$default_cubs" "$cub_check"
}

function find_opencv ()
{
find_dir "$default_opencvs" "$opencv_check"
}

function is_hardlinked ()
{
r=no
Expand Down Expand Up @@ -158,6 +168,7 @@ function show_help ()
echo " --with-mkl[=directory] $(show_default $(find_mkl))"
echo " --with-buildtype=(debug|release) $(show_default $default_buildtype)"
echo " --with-kaldi[=directory] $(show_default $(find_kaldi))"
echo " --with-opencv[=directory] $(show_default $(find_opencv))"
echo "Libraries search path:"
for head in $(default_paths)
do
Expand Down Expand Up @@ -346,6 +357,28 @@ do
fi
fi
;;
--with-opencv*)
have_opencv=yes
if test x$optarg = x
then
opencv_path=$(find_opencv)
if test x$opencv_path = x
then
echo "Cannot find OpenCV directory."
echo "Please specify a value for --with-opencv"
echo "OpenCV can be downloaded from http://opencv.org/downloads.html, install instructions http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation"
exit 1
fi
else
if test $(check_dir $optarg $opencv_check) = yes
then
opencv_path=$optarg
else
echo "Invalid OpenCV directory $optarg"
exit 1
fi
fi
;;
*)
echo Invalid option $key
show_help
Expand Down Expand Up @@ -439,6 +472,10 @@ fi
if test x$kaldi_path != x ; then
echo KALDI_PATH=$kaldi_path >> $config
fi
if test x$opencv_path != x ; then
echo Found OpenCV at $opencv_path
echo OPENCV_PATH=$opencv_path >> $config
fi

# If we are not in the configure directory, generate a trampoline Makefile
makefile=$build_top/Makefile
Expand Down

0 comments on commit a0e60f6

Please sign in to comment.