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:
commit
24383dc608
3 changed files with 23 additions and 27 deletions
|
@ -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/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/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_flann", "opencv_gpu", "opencv_highgui", "opencv_imgproc",
|
||||
"opencv_legacy", "opencv_ml", "opencv_objdetect", "opencv_video",
|
||||
"opencv_photo", "opencv_nonfree"]
|
||||
|
||||
"opencv_flann", "opencv_highgui", "opencv_imgproc", "opencv_legacy",
|
||||
"opencv_ml", "opencv_objdetect", "opencv_video", "opencv_photo"]
|
||||
opencv_libraries_opt = ["opencv_gpu", "opencv_nonfree"]
|
||||
|
||||
puts ">> Check the required libraries..."
|
||||
case CONFIG["arch"]
|
||||
when /mswin32/
|
||||
if $mswin or $mingw
|
||||
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")
|
||||
opencv_libraries.each {|lib|
|
||||
raise "#{lib}.lib not found." unless have_library(lib)
|
||||
}
|
||||
$CFLAGS << ' /EHsc'
|
||||
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)
|
||||
}
|
||||
if $mswin
|
||||
$CFLAGS << ' /EHsc'
|
||||
CONFIG['CXXFLAGS'] << ' /EHsc'
|
||||
end
|
||||
else
|
||||
opencv_libraries.each {|lib|
|
||||
raise "lib#{lib} not found." unless have_library(lib)
|
||||
}
|
||||
have_library("stdc++")
|
||||
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
|
||||
puts ">> Check the required headers..."
|
||||
opencv_headers.each {|header|
|
||||
raise "#{header} not found." unless have_header(header)
|
||||
}
|
||||
opencv_headers.each { |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")
|
||||
|
||||
if $warnflags
|
||||
|
|
|
@ -771,6 +771,8 @@ extern "C" {
|
|||
*/
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENCV2_NONFREE_NONFREE_HPP
|
||||
cv::initModule_nonfree();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,6 @@ extern "C" {
|
|||
#include "opencv2/video/tracking.hpp"
|
||||
#include "opencv2/video/background_segm.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "opencv2/nonfree/nonfree.hpp"
|
||||
#include "opencv2/flann/flann.hpp"
|
||||
#include "opencv2/calib3d/calib3d.hpp"
|
||||
#include "opencv2/objdetect/objdetect.hpp"
|
||||
|
@ -79,6 +78,10 @@ extern "C" {
|
|||
#include "opencv2/ml/ml.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENCV2_NONFREE_NONFREE_HPP
|
||||
#include "opencv2/nonfree/nonfree.hpp"
|
||||
#endif
|
||||
|
||||
// Ruby/OpenCV headers
|
||||
#include "cvutils.h"
|
||||
#include "cverror.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue