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

Merge branch 'fix/issues-33_opencv_gpulib_not_found' into develop

This commit is contained in:
ser1zw 2014-03-29 20:37:41 +09:00
commit 24383dc608
3 changed files with 23 additions and 27 deletions

View file

@ -33,44 +33,35 @@ opencv_headers = ["opencv2/core/core_c.h", "opencv2/core/core.hpp", "opencv2/img
"opencv2/imgproc/imgproc.hpp", "opencv2/video/tracking.hpp", "opencv2/features2d/features2d.hpp", "opencv2/imgproc/imgproc.hpp", "opencv2/video/tracking.hpp", "opencv2/features2d/features2d.hpp",
"opencv2/flann/flann.hpp", "opencv2/calib3d/calib3d.hpp", "opencv2/objdetect/objdetect.hpp", "opencv2/flann/flann.hpp", "opencv2/calib3d/calib3d.hpp", "opencv2/objdetect/objdetect.hpp",
"opencv2/legacy/compat.hpp", "opencv2/legacy/legacy.hpp", "opencv2/highgui/highgui_c.h", "opencv2/legacy/compat.hpp", "opencv2/legacy/legacy.hpp", "opencv2/highgui/highgui_c.h",
"opencv2/highgui/highgui.hpp", "opencv2/photo/photo.hpp", "opencv2/nonfree/nonfree.hpp"] "opencv2/highgui/highgui.hpp", "opencv2/photo/photo.hpp"]
opencv_headers_opt = ["opencv2/nonfree/nonfree.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_highgui", "opencv_imgproc", "opencv_legacy",
"opencv_legacy", "opencv_ml", "opencv_objdetect", "opencv_video", "opencv_ml", "opencv_objdetect", "opencv_video", "opencv_photo"]
"opencv_photo", "opencv_nonfree"] opencv_libraries_opt = ["opencv_gpu", "opencv_nonfree"]
puts ">> Check the required libraries..." puts ">> Check the required libraries..."
case CONFIG["arch"] if $mswin or $mingw
when /mswin32/
suffix = cv_version_suffix(incdir) suffix = cv_version_suffix(incdir)
opencv_libraries.map! {|lib| lib + suffix } opencv_libraries.map! { |lib| lib + suffix }
opencv_libraries_opt.map! { |lib| lib + suffix }
have_library("msvcrt") have_library("msvcrt")
opencv_libraries.each {|lib| if $mswin
raise "#{lib}.lib not found." unless have_library(lib) $CFLAGS << ' /EHsc'
} CONFIG['CXXFLAGS'] << ' /EHsc'
$CFLAGS << ' /EHsc' end
CONFIG['CXXFLAGS'] << ' /EHsc'
when /mingw32/
suffix = cv_version_suffix(incdir)
opencv_libraries.map! {|lib| lib + suffix }
have_library("msvcrt")
opencv_libraries.each {|lib|
raise "lib#{lib} not found." unless have_library(lib)
}
else else
opencv_libraries.each {|lib|
raise "lib#{lib} not found." unless have_library(lib)
}
have_library("stdc++") have_library("stdc++")
end end
opencv_libraries.each { |lib| raise "#{lib} not found." unless have_library(lib) }
opencv_libraries_opt.each { |lib| warn "#{lib} not found." unless have_library(lib) }
# Check the required headers # Check the required headers
puts ">> Check the required headers..." puts ">> Check the required headers..."
opencv_headers.each {|header| opencv_headers.each { |header| raise "#{header} not found." unless have_header(header) }
raise "#{header} not found." unless have_header(header) opencv_headers_opt.each { |header| warn "#{header} not found." unless have_header(header) }
}
have_header("stdarg.h") have_header("stdarg.h")
if $warnflags if $warnflags

View file

@ -771,6 +771,8 @@ extern "C" {
*/ */
#endif #endif
#ifdef HAVE_OPENCV2_NONFREE_NONFREE_HPP
cv::initModule_nonfree(); cv::initModule_nonfree();
#endif
} }
} }

View file

@ -62,7 +62,6 @@ extern "C" {
#include "opencv2/video/tracking.hpp" #include "opencv2/video/tracking.hpp"
#include "opencv2/video/background_segm.hpp" #include "opencv2/video/background_segm.hpp"
#include "opencv2/features2d/features2d.hpp" #include "opencv2/features2d/features2d.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include "opencv2/flann/flann.hpp" #include "opencv2/flann/flann.hpp"
#include "opencv2/calib3d/calib3d.hpp" #include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/objdetect/objdetect.hpp" #include "opencv2/objdetect/objdetect.hpp"
@ -79,6 +78,10 @@ extern "C" {
#include "opencv2/ml/ml.hpp" #include "opencv2/ml/ml.hpp"
#endif #endif
#ifdef HAVE_OPENCV2_NONFREE_NONFREE_HPP
#include "opencv2/nonfree/nonfree.hpp"
#endif
// Ruby/OpenCV headers // Ruby/OpenCV headers
#include "cvutils.h" #include "cvutils.h"
#include "cverror.h" #include "cverror.h"