refactoring
This commit is contained in:
parent
5931644656
commit
1f31343d36
|
@ -34,7 +34,6 @@ opencv_headers = ["opencv2/core/core_c.h", "opencv2/core/core.hpp", "opencv2/img
|
|||
"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"]
|
||||
|
||||
opencv_headers_opt = ["opencv2/nonfree/nonfree.hpp"]
|
||||
|
||||
opencv_libraries = ["opencv_calib3d", "opencv_contrib", "opencv_core", "opencv_features2d",
|
||||
|
@ -43,49 +42,26 @@ opencv_libraries = ["opencv_calib3d", "opencv_contrib", "opencv_core", "opencv_f
|
|||
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_opt.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)
|
||||
}
|
||||
opencv_libraries_opt.each {|lib|
|
||||
warn "#{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 }
|
||||
opencv_libraries_opt.map! {|lib| lib + suffix }
|
||||
have_library("msvcrt")
|
||||
opencv_libraries.each {|lib|
|
||||
raise "lib#{lib} not found." unless have_library(lib)
|
||||
}
|
||||
opencv_libraries_opt.each {|lib|
|
||||
warn "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)
|
||||
}
|
||||
opencv_libraries_opt.each {|lib|
|
||||
warn "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_opt.each {|header|
|
||||
warn "#{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
|
||||
|
|
Loading…
Reference in New Issue