Removed hard-coded version from integration test. (#9335)
[platform/upstream/opencv.git] / platforms / maven / opencv / scripts / functions
1 #!/bin/bash
2 ###############################################################
3 #
4 # Defines some common functions.
5 #
6 # Kerry Billingham <contact [At] AvionicEngineers.{com]>
7 #
8 ##############################################################
9 majorHashDefine="#define CV_VERSION_MAJOR"
10 minorHashDefine="#define CV_VERSION_MINOR"
11 revisionHashDefine="#define CV_VERSION_REVISION"
12 statusHashDefine="#define CV_VERSION_STATUS"
13 versionHeader="../../../../modules/core/include/opencv2/core/version.hpp"
14
15 function extract_version() {
16     minorVersion=$(grep "${minorHashDefine}" $versionHeader | grep -o ".$")
17     majorVersion=$(grep "${majorHashDefine}" $versionHeader | grep -o ".$")
18     revision=$(grep "${revisionHashDefine}" $versionHeader | grep -o ".$")
19
20     REPLY="${majorVersion}.${minorVersion}.${revision}"
21 }