From 1f0035d2af696c576a995eb764bd4639ebd2558d Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Thu, 1 Sep 2011 14:39:26 +0000 Subject: [PATCH] Fixed native_camera library build for Androids having version in x.x format --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe7c08d7c3..365c434e50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1106,8 +1106,11 @@ Set this variable to path to your Android sources to compile libnative_camera_rx.x.x.so for your Android") SET(BUILD_ANDROID_CAMERA_WRAPPER OFF) if (ANDROID_SOURCE_TREE) - FILE(STRINGS "${ANDROID_SOURCE_TREE}/development/sdk/platform_source.properties" ANDROID_VERSION REGEX "Platform\\.Version=[0-9]+\\.[0-9]+\\.[0-9]+" ) - string(REGEX REPLACE "Platform\\.Version=([0-9]+\\.[0-9]+\\.[0-9]+)" "\\1" ANDROID_VERSION "${ANDROID_VERSION}") + FILE(STRINGS "${ANDROID_SOURCE_TREE}/development/sdk/platform_source.properties" ANDROID_VERSION REGEX "Platform\\.Version=[0-9]+\\.[0-9]+(\\.[0-9]+)?" ) + string(REGEX REPLACE "Platform\\.Version=([0-9]+\\.[0-9]+(\\.[0-9]+)?)" "\\1" ANDROID_VERSION "${ANDROID_VERSION}") + if (ANDROID_VERSION MATCHES "^[0-9]+\\.[0-9]+$") + SET(ANDROID_VERSION "${ANDROID_VERSION}.0") + endif() if(NOT "${ANDROID_VERSION}" STREQUAL "") SET(BUILD_ANDROID_CAMERA_WRAPPER ON) endif()