Top Level Namespace
Defined Under Namespace
Modules: OpenCV
Instance Method Summary collapse
Instance Method Details
#cv_version_suffix(incdir) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'ext/opencv/extconf.rb', line 4 def cv_version_suffix(incdir) major, minor, subminor = nil, nil, nil open("#{incdir}/opencv2/core/version.hpp", 'r') { |f| f.read.lines.each { |line| major = $1.to_s if line =~ /\A#define\s+(?:CV_VERSION_EPOCH|CV_MAJOR_VERSION)\s+(\d+)\s*\Z/ minor = $1.to_s if line =~ /\A#define\s+(?:CV_VERSION_MAJOR|CV_MINOR_VERSION)\s+(\d+)\s*\Z/ subminor = $1.to_s if line =~ /\A#define\s+(?:CV_VERSION_MINOR|CV_SUBMINOR_VERSION)\s+(\d+)\s*\Z/ } } major + minor + subminor end |