Switched OpenCV to a 3-component version number.

Epoch is gone; now the version component names in C++ and CMake
are consistent (except REVISION corresponds to PATCH).
pull/1816/head
Roman Donchenko 11 years ago
parent b8c46f4cce
commit 615d6c22d1
  1. 10
      cmake/OpenCVVersion.cmake
  2. 6
      cmake/templates/OpenCVConfig.cmake.in
  3. 8
      doc/conf.py
  4. 2
      modules/androidcamera/src/camera_activity.cpp
  5. 15
      modules/core/include/opencv2/core/version.hpp
  6. 2
      modules/cudacodec/src/ffmpeg_video_source.cpp
  7. 2
      modules/cudacodec/src/video_writer.cpp
  8. 2
      modules/java/android_lib/AndroidManifest.xml
  9. 13
      modules/java/generator/gen_java.py
  10. 4
      platforms/android/libinfo/info.c
  11. 6
      platforms/android/package/AndroidManifest.xml

@ -1,16 +1,12 @@
SET(OPENCV_VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/modules/core/include/opencv2/core/version.hpp")
file(STRINGS "${OPENCV_VERSION_FILE}" OPENCV_VERSION_PARTS REGEX "#define CV_VERSION_[A-Z]+[ ]+" )
string(REGEX REPLACE ".+CV_VERSION_EPOCH[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_MAJOR "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_MAJOR[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_MINOR "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_MINOR[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_PATCH "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_REVISION[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_TWEAK "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_MAJOR[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_MAJOR "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_MINOR[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_MINOR "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_REVISION[ ]+([0-9]+).*" "\\1" OPENCV_VERSION_PATCH "${OPENCV_VERSION_PARTS}")
string(REGEX REPLACE ".+CV_VERSION_STATUS[ ]+\"([^\"]*)\".*" "\\1" OPENCV_VERSION_STATUS "${OPENCV_VERSION_PARTS}")
set(OPENCV_VERSION_PLAIN "${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_VERSION_PATCH}")
if(OPENCV_VERSION_TWEAK GREATER 0)
set(OPENCV_VERSION_PLAIN "${OPENCV_VERSION_PLAIN}.${OPENCV_VERSION_TWEAK}")
endif()
set(OPENCV_VERSION "${OPENCV_VERSION_PLAIN}${OPENCV_VERSION_STATUS}")

@ -24,7 +24,6 @@
# - OpenCV_VERSION_MAJOR : Major version part of OpenCV_VERSION: "@OPENCV_VERSION_MAJOR@"
# - OpenCV_VERSION_MINOR : Minor version part of OpenCV_VERSION: "@OPENCV_VERSION_MINOR@"
# - OpenCV_VERSION_PATCH : Patch version part of OpenCV_VERSION: "@OPENCV_VERSION_PATCH@"
# - OpenCV_VERSION_TWEAK : Tweak version part of OpenCV_VERSION: "@OPENCV_VERSION_TWEAK@"
# - OpenCV_VERSION_STATUS : Development status of this build: "@OPENCV_VERSION_STATUS@"
#
# Advanced variables:
@ -35,6 +34,9 @@
# - OpenCV_USE_MANGLED_PATHS
# - OpenCV_HAVE_ANDROID_CAMERA
#
# Deprecated variables:
# - OpenCV_VERSION_TWEAK : Always "0"
#
# ===================================================================================
set(modules_file_suffix "")
@ -108,7 +110,7 @@ SET(OpenCV_VERSION @OPENCV_VERSION_PLAIN@)
SET(OpenCV_VERSION_MAJOR @OPENCV_VERSION_MAJOR@)
SET(OpenCV_VERSION_MINOR @OPENCV_VERSION_MINOR@)
SET(OpenCV_VERSION_PATCH @OPENCV_VERSION_PATCH@)
SET(OpenCV_VERSION_TWEAK @OPENCV_VERSION_TWEAK@)
SET(OpenCV_VERSION_TWEAK 0)
SET(OpenCV_VERSION_STATUS "@OPENCV_VERSION_STATUS@")
# ====================================================================

@ -61,19 +61,15 @@ copyright = u'2011-2013, opencv dev team'
# built documents.
version_file = open("../modules/core/include/opencv2/core/version.hpp", "rt").read()
version_epoch = re.search("^W*#\W*define\W+CV_VERSION_EPOCH\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
version_major = re.search("^W*#\W*define\W+CV_VERSION_MAJOR\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
version_minor = re.search("^W*#\W*define\W+CV_VERSION_MINOR\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
version_patch = re.search("^W*#\W*define\W+CV_VERSION_REVISION\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
version_status = re.search("^W*#\W*define\W+CV_VERSION_STATUS\W+\"(.*?)\"\W*$", version_file, re.MULTILINE).group(1)
# The short X.Y version.
version = version_epoch + '.' + version_major
version = version_major + '.' + version_minor
# The full version, including alpha/beta/rc tags.
release = version_epoch + '.' + version_major + '.' + version_minor
if version_patch:
release = release + '.' + version_patch
release += version_status
release = version_major + '.' + version_minor + '.' + version_patch + version_status
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

@ -272,7 +272,7 @@ void CameraWrapperConnector::fillListWrapperLibs(const cv::String& folderPath, s
cv::String CameraWrapperConnector::getDefaultPathLibFolder()
{
#define BIN_PACKAGE_NAME(x) "org.opencv.lib_v" CVAUX_STR(CV_VERSION_EPOCH) CVAUX_STR(CV_VERSION_MAJOR) "_" x
#define BIN_PACKAGE_NAME(x) "org.opencv.lib_v" CVAUX_STR(CV_VERSION_MAJOR) CVAUX_STR(CV_VERSION_MINOR) "_" x
const char* const packageList[] = {BIN_PACKAGE_NAME("armv7a"), OPENCV_ENGINE_PACKAGE};
for (size_t i = 0; i < sizeof(packageList)/sizeof(packageList[0]); i++)
{

@ -48,8 +48,7 @@
#ifndef __OPENCV_VERSION_HPP__
#define __OPENCV_VERSION_HPP__
#define CV_VERSION_EPOCH 3
#define CV_VERSION_MAJOR 0
#define CV_VERSION_MAJOR 3
#define CV_VERSION_MINOR 0
#define CV_VERSION_REVISION 0
#define CV_VERSION_STATUS "-dev"
@ -60,15 +59,11 @@
#define CVAUX_STRW_EXP(__A) L#__A
#define CVAUX_STRW(__A) CVAUX_STRW_EXP(__A)
#if CV_VERSION_REVISION
# define CV_VERSION CVAUX_STR(CV_VERSION_EPOCH) "." CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(CV_VERSION_REVISION) CV_VERSION_STATUS
#else
# define CV_VERSION CVAUX_STR(CV_VERSION_EPOCH) "." CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) CV_VERSION_STATUS
#endif
#define CV_VERSION CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(CV_VERSION_REVISION) CV_VERSION_STATUS
/* old style version constants*/
#define CV_MAJOR_VERSION CV_VERSION_EPOCH
#define CV_MINOR_VERSION CV_VERSION_MAJOR
#define CV_SUBMINOR_VERSION CV_VERSION_MINOR
#define CV_MAJOR_VERSION CV_VERSION_MAJOR
#define CV_MINOR_VERSION CV_VERSION_MINOR
#define CV_SUBMINOR_VERSION CV_VERSION_REVISION
#endif

@ -63,7 +63,7 @@ namespace
{
#if defined WIN32 || defined _WIN32
const char* module_name = "opencv_ffmpeg"
CVAUX_STR(CV_VERSION_EPOCH) CVAUX_STR(CV_VERSION_MAJOR) CVAUX_STR(CV_VERSION_MINOR)
CVAUX_STR(CV_VERSION_MAJOR) CVAUX_STR(CV_VERSION_MINOR) CVAUX_STR(CV_VERSION_REVISION)
#if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__)
"_64"
#endif

@ -733,7 +733,7 @@ namespace
{
#if defined(WIN32) || defined(_WIN32)
const char* module_name = "opencv_ffmpeg"
CVAUX_STR(CV_VERSION_EPOCH) CVAUX_STR(CV_VERSION_MAJOR) CVAUX_STR(CV_VERSION_MINOR)
CVAUX_STR(CV_VERSION_MAJOR) CVAUX_STR(CV_VERSION_MINOR) CVAUX_STR(CV_VERSION_REVISION)
#if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__)
"_64"
#endif

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.opencv"
android:versionCode="@OPENCV_VERSION_MAJOR@@OPENCV_VERSION_MINOR@@OPENCV_VERSION_PATCH@@OPENCV_VERSION_TWEAK@"
android:versionCode="@OPENCV_VERSION_MAJOR@@OPENCV_VERSION_MINOR@@OPENCV_VERSION_PATCH@0"
android:versionName="@OPENCV_VERSION@">
<uses-sdk android:minSdkVersion="8" />

@ -628,12 +628,11 @@ func_arg_fix = {
def getLibVersion(version_hpp_path):
version_file = open(version_hpp_path, "rt").read()
epoch = re.search("^W*#\W*define\W+CV_VERSION_EPOCH\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
major = re.search("^W*#\W*define\W+CV_VERSION_MAJOR\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
minor = re.search("^W*#\W*define\W+CV_VERSION_MINOR\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
revision = re.search("^W*#\W*define\W+CV_VERSION_REVISION\W+(\d+)\W*$", version_file, re.MULTILINE).group(1)
status = re.search("^W*#\W*define\W+CV_VERSION_STATUS\W+\"(.*?)\"\W*$", version_file, re.MULTILINE).group(1)
return (epoch, major, minor, revision, status)
return (major, minor, revision, status)
class ConstInfo(object):
def __init__(self, cname, name, val, addedManually=False):
@ -800,16 +799,15 @@ public class %(jc)s {
""" % { 'm' : self.module, 'jc' : jname } )
if class_name == 'Core':
(epoch, major, minor, revision, status) = getLibVersion(
(major, minor, revision, status) = getLibVersion(
(os.path.dirname(__file__) or '.') + '/../../core/include/opencv2/core/version.hpp')
version_str = '.'.join( (epoch, major, minor, revision) ) + status
version_suffix = ''.join( (epoch, major, minor) )
version_str = '.'.join( (major, minor, revision) ) + status
version_suffix = ''.join( (major, minor, revision) )
self.classes[class_name].imports.add("java.lang.String")
self.java_code[class_name]["j_code"].write("""
// these constants are wrapped inside functions to prevent inlining
private static String getVersion() { return "%(v)s"; }
private static String getNativeLibraryName() { return "opencv_java%(vs)s"; }
private static int getVersionEpoch() { return %(ep)s; }
private static int getVersionMajor() { return %(ma)s; }
private static int getVersionMinor() { return %(mi)s; }
private static int getVersionRevision() { return %(re)s; }
@ -817,12 +815,11 @@ public class %(jc)s {
public static final String VERSION = getVersion();
public static final String NATIVE_LIBRARY_NAME = getNativeLibraryName();
public static final int VERSION_EPOCH = getVersionEpoch();
public static final int VERSION_MAJOR = getVersionMajor();
public static final int VERSION_MINOR = getVersionMinor();
public static final int VERSION_REVISION = getVersionRevision();
public static final String VERSION_STATUS = getVersionStatus();
""" % { 'v' : version_str, 'vs' : version_suffix, 'ep' : epoch, 'ma' : major, 'mi' : minor, 're' : revision, 'st': status } )
""" % { 'v' : version_str, 'vs' : version_suffix, 'ma' : major, 'mi' : minor, 're' : revision, 'st': status } )
def add_class(self, decl):

@ -6,8 +6,8 @@ const char* GetRevision(void);
const char* GetLibraryList(void);
JNIEXPORT jstring JNICALL Java_org_opencv_android_StaticHelper_getLibraryList(JNIEnv *, jclass);
#define PACKAGE_NAME "org.opencv.lib_v" CVAUX_STR(CV_VERSION_EPOCH) CVAUX_STR(CV_VERSION_MAJOR) "_" ANDROID_PACKAGE_PLATFORM
#define PACKAGE_REVISION CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(CV_VERSION_REVISION) "." CVAUX_STR(ANDROID_PACKAGE_RELEASE)
#define PACKAGE_NAME "org.opencv.lib_v" CVAUX_STR(CV_VERSION_MAJOR) CVAUX_STR(CV_VERSION_MINOR) "_" ANDROID_PACKAGE_PLATFORM
#define PACKAGE_REVISION CVAUX_STR(CV_VERSION_REVISION) "." CVAUX_STR(ANDROID_PACKAGE_RELEASE)
const char* GetPackageName(void)
{

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.opencv.lib_v@OPENCV_VERSION_MAJOR@@OPENCV_VERSION_MINOR@_@ANDROID_PACKAGE_PLATFORM@"
android:versionCode="@OPENCV_VERSION_PATCH@@OPENCV_VERSION_TWEAK@@ANDROID_PACKAGE_RELEASE@"
android:versionName="@OPENCV_VERSION_PATCH@.@OPENCV_VERSION_TWEAK@.@ANDROID_PACKAGE_RELEASE@" >
android:versionCode="@OPENCV_VERSION_PATCH@0@ANDROID_PACKAGE_RELEASE@"
android:versionName="@OPENCV_VERSION_PATCH@.@ANDROID_PACKAGE_RELEASE@" >
<uses-sdk android:minSdkVersion="@ANDROID_SDK_VERSION@" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
@ -12,4 +12,4 @@
android:label="@string/app_name" >
</application>
</manifest>
</manifest>

Loading…
Cancel
Save