1
0
Fork 0
mirror of https://github.com/ruby-opencv/ruby-opencv synced 2023-03-27 23:22:12 -04:00

modified extconf.rb for environments that OpenCV is installed in non-default directory

if you install OpenCV like:
  $ cmake -D CMAKE_INSTALL_PREFIX=/path/to/opencvlibrary ./OpenCV-x.y.z
  $ make && make install

You can install Ruby/OpenCV like:
  $ ruby extconf.rb --with-opencv-dir=/path/to/opencvlibrary
  $ make && make install
This commit is contained in:
ser1zw 2011-07-11 00:32:39 +09:00
parent 14dae1e891
commit 052073e20d

View file

@ -15,7 +15,7 @@ require "mkmf"
# extconf.rb --with-opencv-lib=/path/to/opencv/lib # extconf.rb --with-opencv-lib=/path/to/opencv/lib
# extconf.rb --with-opencv-include=/path/to/opencv/include # extconf.rb --with-opencv-include=/path/to/opencv/include
dir_config("opencv", "/usr/local/include/opencv2", "/usr/local/lib") dir_config("opencv", "/usr/local/include", "/usr/local/lib")
if CONFIG["arch"].include?("darwin") if CONFIG["arch"].include?("darwin")
dir_config("ffcall", "/opt/local/include", "/opt/local/lib") dir_config("ffcall", "/opt/local/include", "/opt/local/lib")
else else
@ -23,11 +23,11 @@ else
end end
dir_config("libxml2", "/usr/include", "/usr/lib") dir_config("libxml2", "/usr/include", "/usr/lib")
opencv_headers = ["core/core_c.h", "core/core.hpp", "imgproc/imgproc_c.h", opencv_headers = ["opencv2/core/core_c.h", "opencv2/core/core.hpp", "opencv2/imgproc/imgproc_c.h",
"imgproc/imgproc.hpp", "video/tracking.hpp", "features2d/features2d.hpp", "opencv2/imgproc/imgproc.hpp", "opencv2/video/tracking.hpp", "opencv2/features2d/features2d.hpp",
"flann/flann.hpp", "calib3d/calib3d.hpp", "objdetect/objdetect.hpp", "opencv2/flann/flann.hpp", "opencv2/calib3d/calib3d.hpp", "opencv2/objdetect/objdetect.hpp",
"legacy/compat.hpp", "legacy/legacy.hpp", "highgui/highgui_c.h", "opencv2/legacy/compat.hpp", "opencv2/legacy/legacy.hpp", "opencv2/highgui/highgui_c.h",
"highgui/highgui.hpp"] "opencv2/highgui/highgui.hpp"]
opencv_libraries = ["opencv_calib3d", "opencv_contrib", "opencv_core", "opencv_features2d", opencv_libraries = ["opencv_calib3d", "opencv_contrib", "opencv_core", "opencv_features2d",
"opencv_flann", "opencv_gpu", "opencv_highgui", "opencv_imgproc", "opencv_flann", "opencv_gpu", "opencv_highgui", "opencv_imgproc",