Merge branch 2.4
Conflicts: android/service/engine/AndroidManifest.xml - use file from 2.4 modules/contrib/src/detection_based_tracker.cpp - move #include <pthread.h> as in 2.4 modules/java/android_test/src/org/opencv/test/OpenCVTestRunner.java - use file from 2.4
This commit is contained in:
commit
7f542e391a
1
3rdparty/libjasper/CMakeLists.txt
vendored
1
3rdparty/libjasper/CMakeLists.txt
vendored
@ -24,6 +24,7 @@ if(WIN32 AND NOT MINGW)
|
||||
endif(WIN32 AND NOT MINGW)
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes -Wmissing-declarations -Wunused -Wshadow -Wsign-compare)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005
|
||||
|
||||
if(UNIX)
|
||||
|
1
3rdparty/libjpeg/CMakeLists.txt
vendored
1
3rdparty/libjpeg/CMakeLists.txt
vendored
@ -26,6 +26,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
endif()
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align -Wshadow -Wunused)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
|
||||
|
||||
set_target_properties(${JPEG_LIBRARY}
|
||||
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
|
||||
|
1
3rdparty/libtiff/CMakeLists.txt
vendored
1
3rdparty/libtiff/CMakeLists.txt
vendored
@ -89,6 +89,7 @@ endif(WIN32)
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-prototypes -Wmissing-declarations -Wundef -Wunused -Wsign-compare
|
||||
-Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations -Wunused-parameter)
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4018 /wd4100 /wd4127 /wd4311 /wd4701 /wd4706) # vs2005
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4244) # vs2008
|
||||
|
29
3rdparty/tbb/CMakeLists.txt
vendored
29
3rdparty/tbb/CMakeLists.txt
vendored
@ -5,40 +5,46 @@ endif()
|
||||
|
||||
project(tbb)
|
||||
|
||||
# 4.1 - works fine
|
||||
set(tbb_ver "tbb41_20120718oss")
|
||||
set(tbb_url "http://threadingbuildingblocks.org/uploads/77/188/4.1/tbb41_20120718oss_src.tgz")
|
||||
set(tbb_md5 "31b9ec300f3d09da2504d5d882788dd4")
|
||||
# 4.1 update 1 - works fine
|
||||
set(tbb_ver "tbb41_20121003oss")
|
||||
set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20121003oss_src.tgz")
|
||||
set(tbb_md5 "2a684fefb855d2d0318d1ef09afa75ff")
|
||||
set(tbb_version_file "version_string.ver")
|
||||
|
||||
# 4.1 - works fine
|
||||
#set(tbb_ver "tbb41_20120718oss")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb41_20120718oss_src.tgz")
|
||||
#set(tbb_md5 "31b9ec300f3d09da2504d5d882788dd4")
|
||||
#set(tbb_version_file "version_string.ver")
|
||||
|
||||
# 4.0 update 5 - works fine
|
||||
#set(tbb_ver "tbb40_20120613oss")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/uploads/77/187/4.0%20update%205/tbb40_20120613oss_src.tgz")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb40_20120613oss_src.tgz")
|
||||
#set(tbb_md5 "da01ed74944ec5950cfae3476901a172")
|
||||
#set(tbb_version_file "version_string.ver")
|
||||
|
||||
# 4.0 update 4 - works fine
|
||||
#set(tbb_ver "tbb40_20120408oss")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/uploads/77/185/4.0%20update%204/tbb40_20120408oss_src.tgz")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb40_20120408oss_src.tgz")
|
||||
#set(tbb_md5 "734b356da7fe0ed308741f3e6018251e")
|
||||
#set(tbb_version_file "version_string.ver")
|
||||
|
||||
# 4.0 update 3 - build broken
|
||||
#set(tbb_ver "tbb40_20120201oss")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/uploads/77/182/4.0%20update%203/tbb40_20120201oss_src.tgz")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb40_20120201oss_src.tgz")
|
||||
#set(tbb_md5 "4669e7d4adee018de7a7b8b972987218")
|
||||
#set(tbb_version_file "version_string.tmp")
|
||||
|
||||
# 4.0 update 2 - works fine
|
||||
#set(tbb_ver "tbb40_20111130oss")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/uploads/77/180/4.0%20update%202/tbb40_20111130oss_src.tgz")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb40_20111130oss_src.tgz")
|
||||
#set(tbb_md5 "1e6926b21e865e79772119cd44fc3ad8")
|
||||
#set(tbb_version_file "version_string.tmp")
|
||||
#set(tbb_need_GENERIC_DWORD_LOAD_STORE TRUE)
|
||||
|
||||
# 4.0 update 1 - works fine
|
||||
#set(tbb_ver "tbb40_20111003oss")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/uploads/77/177/4.0%20update%201/tbb40_20111003oss_src.tgz")
|
||||
#set(tbb_url "http://threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb40_20111003oss_src.tgz")
|
||||
#set(tbb_md5 "7b5d94eb35a563b29ef402e0fd8f15c9")
|
||||
#set(tbb_version_file "version_string.tmp")
|
||||
#set(tbb_need_GENERIC_DWORD_LOAD_STORE TRUE)
|
||||
@ -123,6 +129,11 @@ add_definitions(-D__TBB_DYNAMIC_LOAD_ENABLED=0 #required
|
||||
-DDO_ITT_NOTIFY=0 #it seems that we don't need these notifications
|
||||
)
|
||||
|
||||
if(ANDROID_COMPILER_IS_CLANG)
|
||||
add_definitions(-D__TBB_GCC_BUILTIN_ATOMICS_PRESENT=1)
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-prototypes)
|
||||
endif()
|
||||
|
||||
if(tbb_need_GENERIC_DWORD_LOAD_STORE)
|
||||
#needed by TBB 4.0 update 1,2; fixed in TBB 4.0 update 3 but it has 2 new problems
|
||||
add_definitions(-D__TBB_USE_GENERIC_DWORD_LOAD_STORE=1)
|
||||
|
@ -1,7 +1,37 @@
|
||||
# Copyright (c) 2010-2011, Ethan Rublee
|
||||
# Copyright (c) 2011-2012, Andrey Kamaev
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
#
|
||||
# 3. The name of the copyright holders may be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Android CMake toolchain file, for use with the Android NDK r5-r8
|
||||
# Requires cmake 2.6.3 or newer (2.8.5 or newer is recommended).
|
||||
# See home page: http://code.google.com/p/android-cmake/
|
||||
# See home page: https://github.com/taka-no-me/android-cmake
|
||||
#
|
||||
# The file is mantained by the OpenCV project. The latest version can be get at
|
||||
# http://code.opencv.org/projects/opencv/repository/revisions/master/changes/android/android.toolchain.cmake
|
||||
@ -64,6 +94,20 @@
|
||||
# ANDROID_NATIVE_API_LEVEL=android-8 - level of Android API compile for.
|
||||
# Option is read-only when standalone toolchain is used.
|
||||
#
|
||||
# ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.6 - the name of compiler
|
||||
# toolchain to be used. The list of possible values depends on the NDK
|
||||
# version. For NDK r8c the possible values are:
|
||||
#
|
||||
# * arm-linux-androideabi-4.4.3
|
||||
# * arm-linux-androideabi-4.6
|
||||
# * arm-linux-androideabi-clang3.1
|
||||
# * mipsel-linux-android-4.4.3
|
||||
# * mipsel-linux-android-4.6
|
||||
# * mipsel-linux-android-clang3.1
|
||||
# * x86-4.4.3
|
||||
# * x86-4.6
|
||||
# * x86-clang3.1
|
||||
#
|
||||
# ANDROID_FORCE_ARM_BUILD=OFF - set ON to generate 32-bit ARM instructions
|
||||
# instead of Thumb. Is not available for "x86" (inapplicable) and
|
||||
# "armeabi-v6 with VFP" (is forced to be ON) ABIs.
|
||||
@ -147,13 +191,9 @@
|
||||
# under the ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}
|
||||
# (depending on the target ABI). This is convenient for Android packaging.
|
||||
#
|
||||
# Authors:
|
||||
# Ethan Rublee ethan.ruble@gmail.com
|
||||
# Andrey Kamaev andrey.kamaev@itseez.com
|
||||
#
|
||||
# Change Log:
|
||||
# - initial version December 2010
|
||||
# - modified April 2011
|
||||
# - April 2011
|
||||
# [+] added possibility to build with NDK (without standalone toolchain)
|
||||
# [+] support cross-compilation on Windows (native, no cygwin support)
|
||||
# [+] added compiler option to force "char" type to be signed
|
||||
@ -164,13 +204,13 @@
|
||||
# [+] EXECUTABLE_OUTPUT_PATH is set by toolchain (required on Windows)
|
||||
# [~] Fixed bug with ANDROID_API_LEVEL variable
|
||||
# [~] turn off SWIG search if it is not found first time
|
||||
# - modified May 2011
|
||||
# - May 2011
|
||||
# [~] ANDROID_LEVEL is renamed to ANDROID_API_LEVEL
|
||||
# [+] ANDROID_API_LEVEL is detected by toolchain if not specified
|
||||
# [~] added guard to prevent changing of output directories on the first
|
||||
# cmake pass
|
||||
# [~] toolchain exits with error if ARM_TARGET is not recognized
|
||||
# - modified June 2011
|
||||
# - June 2011
|
||||
# [~] default NDK path is updated for version r5c
|
||||
# [+] variable CMAKE_SYSTEM_PROCESSOR is set based on ARM_TARGET
|
||||
# [~] toolchain install directory is added to linker paths
|
||||
@ -178,13 +218,13 @@
|
||||
# [+] added macro find_host_package, find_host_program to search
|
||||
# packages/programs on the host system
|
||||
# [~] fixed path to STL library
|
||||
# - modified July 2011
|
||||
# - July 2011
|
||||
# [~] fixed options caching
|
||||
# [~] search for all supported NDK versions
|
||||
# [~] allowed spaces in NDK path
|
||||
# - modified September 2011
|
||||
# - September 2011
|
||||
# [~] updated for NDK r6b
|
||||
# - modified November 2011
|
||||
# - November 2011
|
||||
# [*] rewritten for NDK r7
|
||||
# [+] x86 toolchain support (experimental)
|
||||
# [+] added "armeabi-v6 with VFP" ABI for ARMv6 processors.
|
||||
@ -197,37 +237,37 @@
|
||||
# [~] ARM_TARGET is renamed to ANDROID_ABI
|
||||
# [~] ARMEABI_NDK_NAME is renamed to ANDROID_NDK_ABI_NAME
|
||||
# [~] ANDROID_API_LEVEL is renamed to ANDROID_NATIVE_API_LEVEL
|
||||
# - modified January 2012
|
||||
# - January 2012
|
||||
# [+] added stlport_static support (experimental)
|
||||
# [+] added special check for cygwin
|
||||
# [+] filtered out hidden files (starting with .) while globbing inside NDK
|
||||
# [+] automatically applied GLESv2 linkage fix for NDK revisions 5-6
|
||||
# [+] added ANDROID_GET_ABI_RAWNAME to get NDK ABI names by CMake flags
|
||||
# - modified February 2012
|
||||
# - February 2012
|
||||
# [+] updated for NDK r7b
|
||||
# [~] fixed cmake try_compile() command
|
||||
# [~] Fix for missing install_name_tool on OS X
|
||||
# - modified March 2012
|
||||
# - March 2012
|
||||
# [~] fixed incorrect C compiler flags
|
||||
# [~] fixed CMAKE_SYSTEM_PROCESSOR change on ANDROID_ABI change
|
||||
# [+] improved toolchain loading speed
|
||||
# [+] added assembler language support (.S)
|
||||
# [+] allowed preset search paths and extra search suffixes
|
||||
# - modified April 2012
|
||||
# - April 2012
|
||||
# [+] updated for NDK r7c
|
||||
# [~] fixed most of problems with compiler/linker flags and caching
|
||||
# [+] added option ANDROID_FUNCTION_LEVEL_LINKING
|
||||
# - modified May 2012
|
||||
# - May 2012
|
||||
# [+] updated for NDK r8
|
||||
# [+] added mips architecture support
|
||||
# - modified August 2012
|
||||
# - August 2012
|
||||
# [+] updated for NDK r8b
|
||||
# [~] all intermediate files generated by toolchain are moved to CMakeFiles
|
||||
# [~] libstdc++ and libsupc are removed from explicit link libraries
|
||||
# [+] added CCache support (via NDK_CCACHE environment or cmake variable)
|
||||
# [+] added gold linker support for NDK r8b
|
||||
# [~] fixed mips linker flags for NDK r8b
|
||||
# - modified September 2012
|
||||
# - September 2012
|
||||
# [+] added NDK release name detection (see ANDROID_NDK_RELEASE)
|
||||
# [+] added support for all C++ runtimes from NDK
|
||||
# (system, gabi++, stlport, gnustl)
|
||||
@ -235,8 +275,11 @@
|
||||
# [~] use gold linker as default if available (NDK r8b)
|
||||
# [~] globally turned off rpath
|
||||
# [~] compiler options are aligned with NDK r8b
|
||||
# - modified October 2012
|
||||
# - October 2012
|
||||
# [~] fixed C++ linking: explicitly link with math library (OpenCV #2426)
|
||||
# - November 2012
|
||||
# [+] updated for NDK r8c
|
||||
# [+] added support for clang compiler
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
cmake_minimum_required( VERSION 2.6.3 )
|
||||
@ -259,7 +302,7 @@ set( CMAKE_SYSTEM_VERSION 1 )
|
||||
# rpath makes low sence for Android
|
||||
set( CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." )
|
||||
|
||||
set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
|
||||
set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
|
||||
if(NOT DEFINED ANDROID_NDK_SEARCH_PATHS)
|
||||
if( CMAKE_HOST_WIN32 )
|
||||
file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
|
||||
@ -367,8 +410,8 @@ endmacro()
|
||||
|
||||
macro( __DETECT_TOOLCHAIN_MACHINE_NAME _var _root )
|
||||
if( EXISTS "${_root}" )
|
||||
file( GLOB __gccExePath "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
|
||||
__LIST_FILTER( __gccExePath "bin/[.].*-gcc${TOOL_OS_SUFFIX}$" )
|
||||
file( GLOB __gccExePath RELATIVE "${_root}/bin/" "${_root}/bin/*-gcc${TOOL_OS_SUFFIX}" )
|
||||
__LIST_FILTER( __gccExePath "^[.].*" )
|
||||
list( LENGTH __gccExePath __gccExePathsCount )
|
||||
if( NOT __gccExePathsCount EQUAL 1 AND NOT _CMAKE_IN_TRY_COMPILE )
|
||||
message( WARNING "Could not determine machine name for compiler from ${_root}" )
|
||||
@ -506,55 +549,73 @@ if( BUILD_WITH_STANDALONE_TOOLCHAIN )
|
||||
elseif( __availableToolchainMachines MATCHES mipsel )
|
||||
set( __availableToolchainArchs "mipsel" )
|
||||
endif()
|
||||
if( ANDROID_COMPILER_VERSION )
|
||||
# do not run gcc every time because it is relatevely expencive
|
||||
set( __availableToolchainCompilerVersions "${ANDROID_COMPILER_VERSION}" )
|
||||
else()
|
||||
execute_process( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" --version
|
||||
OUTPUT_VARIABLE __availableToolchainCompilerVersions OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9]+)?" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )
|
||||
execute_process( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" -dumpversion
|
||||
OUTPUT_VARIABLE __availableToolchainCompilerVersions OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9]+)?" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )
|
||||
if( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/bin/clang${TOOL_OS_SUFFIX}" )
|
||||
list( APPEND __availableToolchains "standalone-clang" )
|
||||
list( APPEND __availableToolchainMachines ${__availableToolchainMachines} )
|
||||
list( APPEND __availableToolchainArchs ${__availableToolchainArchs} )
|
||||
list( APPEND __availableToolchainCompilerVersions ${__availableToolchainCompilerVersions} )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
macro( __GLOB_NDK_TOOLCHAINS __availableToolchainsVar )
|
||||
foreach( __toolchain ${${__availableToolchainsVar}} )
|
||||
if( "${__toolchain}" MATCHES "-clang3[.][0-9]$" AND NOT EXISTS "${ANDROID_NDK}/toolchains/${__toolchain}/prebuilt/" )
|
||||
string( REGEX REPLACE "-clang3[.][0-9]$" "-4.6" __gcc_toolchain "${__toolchain}" )
|
||||
else()
|
||||
set( __gcc_toolchain "${__toolchain}" )
|
||||
endif()
|
||||
__DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK}/toolchains/${__gcc_toolchain}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
|
||||
if( __machine )
|
||||
string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9]+)?$" __version "${__gcc_toolchain}" )
|
||||
string( REGEX MATCH "^[^-]+" __arch "${__gcc_toolchain}" )
|
||||
list( APPEND __availableToolchainMachines "${__machine}" )
|
||||
list( APPEND __availableToolchainArchs "${__arch}" )
|
||||
list( APPEND __availableToolchainCompilerVersions "${__version}" )
|
||||
else()
|
||||
list( REMOVE_ITEM ${__availableToolchainsVar} "${__toolchain}" )
|
||||
endif()
|
||||
unset( __gcc_toolchain )
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# get all the details about NDK
|
||||
if( BUILD_WITH_ANDROID_NDK )
|
||||
file( GLOB ANDROID_SUPPORTED_NATIVE_API_LEVELS RELATIVE "${ANDROID_NDK}/platforms" "${ANDROID_NDK}/platforms/android-*" )
|
||||
string( REPLACE "android-" "" ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_SUPPORTED_NATIVE_API_LEVELS}" )
|
||||
file( GLOB __availableToolchains RELATIVE "${ANDROID_NDK}/toolchains" "${ANDROID_NDK}/toolchains/*" )
|
||||
__LIST_FILTER( __availableToolchains "^[.]" )
|
||||
set( __availableToolchains "" )
|
||||
set( __availableToolchainMachines "" )
|
||||
set( __availableToolchainArchs "" )
|
||||
set( __availableToolchainCompilerVersions "" )
|
||||
foreach( __toolchain ${__availableToolchains} )
|
||||
__DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK}/toolchains/${__toolchain}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
|
||||
if( __machine )
|
||||
string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9]+)?$" __version "${__toolchain}" )
|
||||
string( REGEX MATCH "^[^-]+" __arch "${__toolchain}" )
|
||||
list( APPEND __availableToolchainMachines "${__machine}" )
|
||||
list( APPEND __availableToolchainArchs "${__arch}" )
|
||||
list( APPEND __availableToolchainCompilerVersions "${__version}" )
|
||||
else()
|
||||
list( REMOVE_ITEM __availableToolchains "${__toolchain}" )
|
||||
endif()
|
||||
endforeach()
|
||||
if( ANDROID_TOOLCHAIN_NAME AND EXISTS "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/" )
|
||||
# do not go through all toolchains if we know the name
|
||||
set( __availableToolchains "${ANDROID_TOOLCHAIN_NAME}" )
|
||||
__GLOB_NDK_TOOLCHAINS( __availableToolchains )
|
||||
endif()
|
||||
if( NOT __availableToolchains )
|
||||
message( FATAL_ERROR "Could not any working toolchain in the NDK. Probably your Android NDK is broken." )
|
||||
file( GLOB __availableToolchains RELATIVE "${ANDROID_NDK}/toolchains" "${ANDROID_NDK}/toolchains/*" )
|
||||
__LIST_FILTER( __availableToolchains "^[.]" )
|
||||
__LIST_FILTER( __availableToolchains "llvm" )
|
||||
__GLOB_NDK_TOOLCHAINS( __availableToolchains )
|
||||
endif()
|
||||
if( NOT __availableToolchains )
|
||||
message( FATAL_ERROR "Could not find any working toolchain in the NDK. Probably your Android NDK is broken." )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# build list of available ABIs
|
||||
set( ANDROID_SUPPORTED_ABIS "" )
|
||||
set( __uniqToolchainArchNames ${__availableToolchainArchs} )
|
||||
list( REMOVE_DUPLICATES __uniqToolchainArchNames )
|
||||
list( SORT __uniqToolchainArchNames )
|
||||
foreach( __arch ${__uniqToolchainArchNames} )
|
||||
list( APPEND ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${__arch}} )
|
||||
endforeach()
|
||||
unset( __uniqToolchainArchNames )
|
||||
if( NOT ANDROID_SUPPORTED_ABIS )
|
||||
set( ANDROID_SUPPORTED_ABIS "" )
|
||||
set( __uniqToolchainArchNames ${__availableToolchainArchs} )
|
||||
list( REMOVE_DUPLICATES __uniqToolchainArchNames )
|
||||
list( SORT __uniqToolchainArchNames )
|
||||
foreach( __arch ${__uniqToolchainArchNames} )
|
||||
list( APPEND ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${__arch}} )
|
||||
endforeach()
|
||||
unset( __uniqToolchainArchNames )
|
||||
if( NOT ANDROID_SUPPORTED_ABIS )
|
||||
message( FATAL_ERROR "No one of known Android ABIs is supported by this cmake toolchain." )
|
||||
endif()
|
||||
message( FATAL_ERROR "No one of known Android ABIs is supported by this cmake toolchain." )
|
||||
endif()
|
||||
|
||||
# choose target ABI
|
||||
@ -569,33 +630,34 @@ if( __androidAbiIdx EQUAL -1 )
|
||||
endif()
|
||||
unset( __androidAbiIdx )
|
||||
|
||||
# remember target ABI
|
||||
set( ANDROID_ABI "${ANDROID_ABI}" CACHE STRING "The target ABI for Android. If arm, then armeabi-v7a is recommended for hardware floating point." FORCE )
|
||||
|
||||
# set target ABI options
|
||||
if( ANDROID_ABI STREQUAL "x86" )
|
||||
set( X86 true )
|
||||
set( ANDROID_NDK_ABI_NAME "x86" )
|
||||
set( ANDROID_ARCH_NAME "x86" )
|
||||
set( ANDROID_ARCH_FULLNAME "x86" )
|
||||
set( ANDROID_LLVM_TRIPLE "i686-none-linux-android" )
|
||||
set( CMAKE_SYSTEM_PROCESSOR "i686" )
|
||||
elseif( ANDROID_ABI STREQUAL "mips" )
|
||||
set( MIPS true )
|
||||
set( ANDROID_NDK_ABI_NAME "mips" )
|
||||
set( ANDROID_ARCH_NAME "mips" )
|
||||
set( ANDROID_ARCH_FULLNAME "mipsel" )
|
||||
set( ANDROID_LLVM_TRIPLE "mipsel-none-linux-android" )
|
||||
set( CMAKE_SYSTEM_PROCESSOR "mips" )
|
||||
elseif( ANDROID_ABI STREQUAL "armeabi" )
|
||||
set( ARMEABI true )
|
||||
set( ANDROID_NDK_ABI_NAME "armeabi" )
|
||||
set( ANDROID_ARCH_NAME "arm" )
|
||||
set( ANDROID_ARCH_FULLNAME "arm" )
|
||||
set( ANDROID_LLVM_TRIPLE "armv5te-none-linux-androideabi" )
|
||||
set( CMAKE_SYSTEM_PROCESSOR "armv5te" )
|
||||
elseif( ANDROID_ABI STREQUAL "armeabi-v6 with VFP" )
|
||||
set( ARMEABI_V6 true )
|
||||
set( ANDROID_NDK_ABI_NAME "armeabi" )
|
||||
set( ANDROID_ARCH_NAME "arm" )
|
||||
set( ANDROID_ARCH_FULLNAME "arm" )
|
||||
set( ANDROID_LLVM_TRIPLE "armv5te-none-linux-androideabi" )
|
||||
set( CMAKE_SYSTEM_PROCESSOR "armv6" )
|
||||
# need always fallback to older platform
|
||||
set( ARMEABI true )
|
||||
@ -604,12 +666,14 @@ elseif( ANDROID_ABI STREQUAL "armeabi-v7a")
|
||||
set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
|
||||
set( ANDROID_ARCH_NAME "arm" )
|
||||
set( ANDROID_ARCH_FULLNAME "arm" )
|
||||
set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
|
||||
set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
|
||||
elseif( ANDROID_ABI STREQUAL "armeabi-v7a with VFPV3" )
|
||||
set( ARMEABI_V7A true )
|
||||
set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
|
||||
set( ANDROID_ARCH_NAME "arm" )
|
||||
set( ANDROID_ARCH_FULLNAME "arm" )
|
||||
set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
|
||||
set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
|
||||
set( VFPV3 true )
|
||||
elseif( ANDROID_ABI STREQUAL "armeabi-v7a with NEON" )
|
||||
@ -617,6 +681,7 @@ elseif( ANDROID_ABI STREQUAL "armeabi-v7a with NEON" )
|
||||
set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
|
||||
set( ANDROID_ARCH_NAME "arm" )
|
||||
set( ANDROID_ARCH_FULLNAME "arm" )
|
||||
set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
|
||||
set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
|
||||
set( VFPV3 true )
|
||||
set( NEON true )
|
||||
@ -630,12 +695,6 @@ if( CMAKE_BINARY_DIR AND EXISTS "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMa
|
||||
file( APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake" "SET(CMAKE_SYSTEM_PROCESSOR \"${CMAKE_SYSTEM_PROCESSOR}\")\n" )
|
||||
endif()
|
||||
|
||||
set( ANDROID_SUPPORTED_ABIS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME}} CACHE INTERNAL "ANDROID_ABI can be changed only to one of these ABIs. Changing to any other ABI requires to reset cmake cache." FORCE )
|
||||
if( CMAKE_VERSION VERSION_GREATER "2.8" )
|
||||
list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME} )
|
||||
set_property( CACHE ANDROID_ABI PROPERTY STRINGS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME}} )
|
||||
endif()
|
||||
|
||||
if( ANDROID_ARCH_NAME STREQUAL "arm" AND NOT ARMEABI_V6 )
|
||||
__INIT_VARIABLE( ANDROID_FORCE_ARM_BUILD OBSOLETE_FORCE_ARM VALUES OFF )
|
||||
set( ANDROID_FORCE_ARM_BUILD ${ANDROID_FORCE_ARM_BUILD} CACHE BOOL "Use 32-bit ARM instructions instead of Thumb-1" FORCE )
|
||||
@ -648,11 +707,15 @@ endif()
|
||||
if( ANDROID_TOOLCHAIN_NAME )
|
||||
list( FIND __availableToolchains "${ANDROID_TOOLCHAIN_NAME}" __toolchainIdx )
|
||||
if( __toolchainIdx EQUAL -1 )
|
||||
message( FATAL_ERROR "Previously selected toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is missing. You need to remove CMakeCache.txt and rerun cmake manually to change the toolchain" )
|
||||
list( SORT __availableToolchains )
|
||||
string( REPLACE ";" "\n * " toolchains_list "${__availableToolchains}" )
|
||||
set( toolchains_list " * ${toolchains_list}")
|
||||
message( FATAL_ERROR "Specified toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is missing in your NDK or broken. Please verify that your NDK is working or select another compiler toolchain.
|
||||
To configure the toolchain set CMake variable ANDROID_TOOLCHAIN_NAME to one of the following values:\n${toolchains_list}\n" )
|
||||
endif()
|
||||
list( GET __availableToolchainArchs ${__toolchainIdx} __toolchainArch )
|
||||
if( NOT __toolchainArch STREQUAL ANDROID_ARCH_FULLNAME )
|
||||
message( SEND_ERROR "Previously selected toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is not able to compile binaries for the \"${ANDROID_ARCH_NAME}\" platform." )
|
||||
message( SEND_ERROR "Selected toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is not able to compile binaries for the \"${ANDROID_ARCH_NAME}\" platform." )
|
||||
endif()
|
||||
else()
|
||||
set( __toolchainIdx -1 )
|
||||
@ -681,8 +744,7 @@ endif()
|
||||
list( GET __availableToolchains ${__toolchainIdx} ANDROID_TOOLCHAIN_NAME )
|
||||
list( GET __availableToolchainMachines ${__toolchainIdx} ANDROID_TOOLCHAIN_MACHINE_NAME )
|
||||
list( GET __availableToolchainCompilerVersions ${__toolchainIdx} ANDROID_COMPILER_VERSION )
|
||||
set( ANDROID_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" CACHE INTERNAL "Name of toolchain used" FORCE )
|
||||
set( ANDROID_COMPILER_VERSION "${ANDROID_COMPILER_VERSION}" CACHE INTERNAL "compiler version from selected toolchain" FORCE )
|
||||
|
||||
unset( __toolchainIdx )
|
||||
unset( __availableToolchains )
|
||||
unset( __availableToolchainMachines )
|
||||
@ -692,37 +754,35 @@ unset( __availableToolchainCompilerVersions )
|
||||
# choose native API level
|
||||
__INIT_VARIABLE( ANDROID_NATIVE_API_LEVEL ENV_ANDROID_NATIVE_API_LEVEL ANDROID_API_LEVEL ENV_ANDROID_API_LEVEL ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME} ANDROID_DEFAULT_NDK_API_LEVEL )
|
||||
string( REGEX MATCH "[0-9]+" ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" )
|
||||
# TODO: filter out unsupported levels
|
||||
# validate
|
||||
list( FIND ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_NATIVE_API_LEVEL}" __levelIdx )
|
||||
if( __levelIdx EQUAL -1 )
|
||||
message( SEND_ERROR "Specified Android native API level (${ANDROID_NATIVE_API_LEVEL}) is not supported by your NDK/toolchain." )
|
||||
else()
|
||||
if( BUILD_WITH_ANDROID_NDK )
|
||||
__DETECT_NATIVE_API_LEVEL( __realApiLevel "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h" )
|
||||
if( NOT __realApiLevel EQUAL ANDROID_NATIVE_API_LEVEL )
|
||||
message( SEND_ERROR "Specified Android API level (${ANDROID_NATIVE_API_LEVEL}) does not match to the level found (${__realApiLevel}). Probably your copy of NDK is broken." )
|
||||
endif()
|
||||
unset( __realApiLevel )
|
||||
endif()
|
||||
set( ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" CACHE STRING "Android API level for native code" FORCE )
|
||||
if( CMAKE_VERSION VERSION_GREATER "2.8" )
|
||||
list( SORT ANDROID_SUPPORTED_NATIVE_API_LEVELS )
|
||||
set_property( CACHE ANDROID_NATIVE_API_LEVEL PROPERTY STRINGS ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )
|
||||
endif()
|
||||
endif()
|
||||
unset( __levelIdx )
|
||||
if( BUILD_WITH_ANDROID_NDK )
|
||||
__DETECT_NATIVE_API_LEVEL( __realApiLevel "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h" )
|
||||
if( NOT __realApiLevel EQUAL ANDROID_NATIVE_API_LEVEL )
|
||||
message( SEND_ERROR "Specified Android API level (${ANDROID_NATIVE_API_LEVEL}) does not match to the level found (${__realApiLevel}). Probably your copy of NDK is broken." )
|
||||
endif()
|
||||
unset( __realApiLevel )
|
||||
endif()
|
||||
set( ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" CACHE STRING "Android API level for native code" FORCE )
|
||||
|
||||
|
||||
# remember target ABI
|
||||
set( ANDROID_ABI "${ANDROID_ABI}" CACHE STRING "The target ABI for Android. If arm, then armeabi-v7a is recommended for hardware floating point." FORCE )
|
||||
if( CMAKE_VERSION VERSION_GREATER "2.8" )
|
||||
list( SORT ANDROID_SUPPORTED_NATIVE_API_LEVELS )
|
||||
set_property( CACHE ANDROID_NATIVE_API_LEVEL PROPERTY STRINGS ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )
|
||||
list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME} )
|
||||
set_property( CACHE ANDROID_ABI PROPERTY STRINGS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME}} )
|
||||
endif()
|
||||
|
||||
# setup output directories
|
||||
set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "root for library output, set this to change where android libs are installed to" )
|
||||
set( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )
|
||||
|
||||
if(NOT _CMAKE_IN_TRY_COMPILE)
|
||||
if( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" )
|
||||
set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for applications" )
|
||||
else()
|
||||
set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin" CACHE PATH "Output directory for applications" )
|
||||
endif()
|
||||
set( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "path for android libs" )
|
||||
endif()
|
||||
|
||||
# runtime choice (STL, rtti, exceptions)
|
||||
if( NOT ANDROID_STL )
|
||||
@ -800,9 +860,84 @@ See https://android.googlesource.com/platform/development.git f907f4f9d4e56ccc80
|
||||
" )
|
||||
endif()
|
||||
|
||||
|
||||
# setup paths and STL for standalone toolchain
|
||||
if( BUILD_WITH_STANDALONE_TOOLCHAIN )
|
||||
set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" )
|
||||
set( ANDROID_CLANG_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" )
|
||||
set( ANDROID_SYSROOT "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot" )
|
||||
|
||||
if( NOT ANDROID_STL STREQUAL "none" )
|
||||
set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}" )
|
||||
if( ARMEABI_V7A AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}/bits" )
|
||||
list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}" )
|
||||
elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb/bits" )
|
||||
list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb" )
|
||||
else()
|
||||
list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" )
|
||||
endif()
|
||||
# always search static GNU STL to get the location of libsupc++.a
|
||||
if( ARMEABI_V7A AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb" )
|
||||
elseif( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libstdc++.a" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}" )
|
||||
elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libstdc++.a" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb" )
|
||||
elseif( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libstdc++.a" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" )
|
||||
endif()
|
||||
if( __libstl )
|
||||
set( __libsupcxx "${__libstl}/libsupc++.a" )
|
||||
set( __libstl "${__libstl}/libstdc++.a" )
|
||||
endif()
|
||||
if( NOT EXISTS "${__libsupcxx}" )
|
||||
message( FATAL_ERROR "The required libstdsupc++.a is missing in your standalone toolchain.
|
||||
Usually it happens because of bug in make-standalone-toolchain.sh script from NDK r7, r7b and r7c.
|
||||
You need to either upgrade to newer NDK or manually copy
|
||||
$ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a
|
||||
to
|
||||
${__libsupcxx}
|
||||
" )
|
||||
endif()
|
||||
if( ANDROID_STL STREQUAL "gnustl_shared" )
|
||||
if( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" )
|
||||
elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so" )
|
||||
elseif( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" )
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# clang
|
||||
if( "${ANDROID_TOOLCHAIN_NAME}" STREQUAL "standalone-clang" )
|
||||
set( ANDROID_COMPILER_IS_CLANG 1 )
|
||||
execute_process( COMMAND "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/clang${TOOL_OS_SUFFIX}" --version OUTPUT_VARIABLE ANDROID_CLANG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE )
|
||||
string( REGEX MATCH "[0-9]+[.][0-9]+" ANDROID_CLANG_VERSION "${ANDROID_CLANG_VERSION}")
|
||||
elseif( "${ANDROID_TOOLCHAIN_NAME}" MATCHES "-clang3[.][0-9]?$" )
|
||||
string( REGEX MATCH "3[.][0-9]$" ANDROID_CLANG_VERSION "${ANDROID_TOOLCHAIN_NAME}")
|
||||
string( REGEX REPLACE "-clang${ANDROID_CLANG_VERSION}$" "-4.6" ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" )
|
||||
if( NOT EXISTS "${ANDROID_NDK}/toolchains/llvm-${ANDROID_CLANG_VERSION}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}/bin/clang${TOOL_OS_SUFFIX}" )
|
||||
message( FATAL_ERROR "Could not find the " )
|
||||
endif()
|
||||
set( ANDROID_COMPILER_IS_CLANG 1 )
|
||||
set( ANDROID_CLANG_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/llvm-${ANDROID_CLANG_VERSION}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
|
||||
else()
|
||||
set( ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" )
|
||||
unset( ANDROID_COMPILER_IS_CLANG CACHE )
|
||||
endif()
|
||||
|
||||
string( REPLACE "." "" _clang_name "clang${ANDROID_CLANG_VERSION}" )
|
||||
if( NOT EXISTS "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" )
|
||||
set( _clang_name "clang" )
|
||||
endif()
|
||||
|
||||
|
||||
# setup paths and STL for NDK
|
||||
if( BUILD_WITH_ANDROID_NDK )
|
||||
set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
|
||||
set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_GCC_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
|
||||
set( ANDROID_SYSROOT "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}" )
|
||||
|
||||
if( ANDROID_STL STREQUAL "none" )
|
||||
@ -874,54 +1009,6 @@ if( BUILD_WITH_ANDROID_NDK )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# setup paths and STL for standalone toolchain
|
||||
if( BUILD_WITH_STANDALONE_TOOLCHAIN )
|
||||
set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_STANDALONE_TOOLCHAIN}" )
|
||||
set( ANDROID_SYSROOT "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot" )
|
||||
|
||||
if( NOT ANDROID_STL STREQUAL "none" )
|
||||
set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}" )
|
||||
if( ARMEABI_V7A AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}/bits" )
|
||||
list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}" )
|
||||
elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb/bits" )
|
||||
list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb" )
|
||||
else()
|
||||
list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" )
|
||||
endif()
|
||||
# always search static GNU STL to get the location of libsupc++.a
|
||||
if( ARMEABI_V7A AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb/libstdc++.a" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/thumb" )
|
||||
elseif( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libstdc++.a" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}" )
|
||||
elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libstdc++.a" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb" )
|
||||
elseif( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libstdc++.a" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib" )
|
||||
endif()
|
||||
if( __libstl )
|
||||
set( __libsupcxx "${__libstl}/libsupc++.a" )
|
||||
set( __libstl "${__libstl}/libstdc++.a" )
|
||||
endif()
|
||||
if( NOT EXISTS "${__libsupcxx}" )
|
||||
message( FATAL_ERROR "The required libstdsupc++.a is missing in your standalone toolchain.
|
||||
Usually it happens because of bug in make-standalone-toolchain.sh script from NDK r7, r7b and r7c.
|
||||
You need to either upgrade to newer NDK or manually copy
|
||||
$ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/libs/${ANDROID_NDK_ABI_NAME}/libsupc++.a
|
||||
to
|
||||
${__libsupcxx}
|
||||
" )
|
||||
endif()
|
||||
if( ANDROID_STL STREQUAL "gnustl_shared" )
|
||||
if( ARMEABI_V7A AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/${CMAKE_SYSTEM_PROCESSOR}/libgnustl_shared.so" )
|
||||
elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/thumb/libgnustl_shared.so" )
|
||||
elseif( EXISTS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" )
|
||||
set( __libstl "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/lib/libgnustl_shared.so" )
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# case of shared STL linkage
|
||||
if( ANDROID_STL MATCHES "shared" AND DEFINED __libstl )
|
||||
@ -937,6 +1024,7 @@ if( ANDROID_STL MATCHES "shared" AND DEFINED __libstl )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# ccache support
|
||||
__INIT_VARIABLE( _ndk_ccache NDK_CCACHE ENV_NDK_CCACHE )
|
||||
if( _ndk_ccache )
|
||||
@ -946,16 +1034,27 @@ else()
|
||||
endif()
|
||||
unset( _ndk_ccache )
|
||||
|
||||
|
||||
# setup the cross-compiler
|
||||
if( NOT CMAKE_C_COMPILER )
|
||||
if( NDK_CCACHE )
|
||||
set( CMAKE_C_COMPILER "${NDK_CCACHE}" CACHE PATH "ccache as C compiler" )
|
||||
set( CMAKE_CXX_COMPILER "${NDK_CCACHE}" CACHE PATH "ccache as C++ compiler" )
|
||||
set( CMAKE_C_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "gcc")
|
||||
set( CMAKE_CXX_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "g++")
|
||||
if( ANDROID_COMPILER_IS_CLANG )
|
||||
set( CMAKE_C_COMPILER_ARG1 "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" CACHE PATH "C compiler")
|
||||
set( CMAKE_CXX_COMPILER_ARG1 "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler")
|
||||
else()
|
||||
set( CMAKE_C_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "C compiler")
|
||||
set( CMAKE_CXX_COMPILER_ARG1 "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler")
|
||||
endif()
|
||||
else()
|
||||
set( CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "gcc" )
|
||||
set( CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "g++" )
|
||||
if( ANDROID_COMPILER_IS_CLANG )
|
||||
set( CMAKE_C_COMPILER "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}${TOOL_OS_SUFFIX}" CACHE PATH "C compiler")
|
||||
set( CMAKE_CXX_COMPILER "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/${_clang_name}++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler")
|
||||
else()
|
||||
set( CMAKE_C_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "C compiler" )
|
||||
set( CMAKE_CXX_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++${TOOL_OS_SUFFIX}" CACHE PATH "C++ compiler" )
|
||||
endif()
|
||||
endif()
|
||||
set( CMAKE_ASM_COMPILER "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-gcc${TOOL_OS_SUFFIX}" CACHE PATH "assembler" )
|
||||
set( CMAKE_STRIP "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-strip${TOOL_OS_SUFFIX}" CACHE PATH "strip" )
|
||||
@ -982,15 +1081,22 @@ endif()
|
||||
# Force set compilers because standard identification works badly for us
|
||||
include( CMakeForceCompiler )
|
||||
CMAKE_FORCE_C_COMPILER( "${CMAKE_C_COMPILER}" GNU )
|
||||
if( ANDROID_COMPILER_IS_CLANG )
|
||||
set( CMAKE_C_COMPILER_ID Clang)
|
||||
endif()
|
||||
set( CMAKE_C_PLATFORM_ID Linux )
|
||||
set( CMAKE_C_SIZEOF_DATA_PTR 4 )
|
||||
set( CMAKE_C_HAS_ISYSROOT 1 )
|
||||
set( CMAKE_C_COMPILER_ABI ELF )
|
||||
CMAKE_FORCE_CXX_COMPILER( "${CMAKE_CXX_COMPILER}" GNU )
|
||||
if( ANDROID_COMPILER_IS_CLANG )
|
||||
set( CMAKE_CXX_COMPILER_ID Clang)
|
||||
endif()
|
||||
set( CMAKE_CXX_PLATFORM_ID Linux )
|
||||
set( CMAKE_CXX_SIZEOF_DATA_PTR 4 )
|
||||
set( CMAKE_CXX_HAS_ISYSROOT 1 )
|
||||
set( CMAKE_CXX_COMPILER_ABI ELF )
|
||||
set( CMAKE_CXX_SOURCE_FILE_EXTENSIONS cc cp cxx cpp CPP c++ C )
|
||||
# force ASM compiler (required for CMake < 2.8.5)
|
||||
set( CMAKE_ASM_COMPILER_ID_RUN TRUE )
|
||||
set( CMAKE_ASM_COMPILER_ID GNU )
|
||||
@ -1056,10 +1162,10 @@ if( ARMEABI_V7A )
|
||||
elseif( VFPV3 )
|
||||
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3" )
|
||||
else()
|
||||
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfp" )
|
||||
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfpv3-d16" )
|
||||
endif()
|
||||
elseif( ARMEABI_V6 )
|
||||
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv6 -mfloat-abi=softfp -mfpu=vfp" )
|
||||
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv6 -mfloat-abi=softfp -mfpu=vfp" ) # vfp == vfpv2
|
||||
elseif( ARMEABI )
|
||||
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv5te -mtune=xscale -msoft-float" )
|
||||
endif()
|
||||
@ -1148,17 +1254,25 @@ if( ANDROID_FUNCTION_LEVEL_LINKING )
|
||||
set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--gc-sections" )
|
||||
endif()
|
||||
|
||||
if( ANDROID_GOLD_LINKER AND CMAKE_HOST_UNIX AND (ARMEABI OR ARMEABI_V7A OR X86) AND ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" )
|
||||
set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold" )
|
||||
elseif( ANDROID_NDK_RELEASE STREQUAL "r8b" AND ARMEABI AND ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" AND NOT _CMAKE_IN_TRY_COMPILE )
|
||||
message( WARNING "The default bfd linker from arm GCC 4.6 toolchain can fail with 'unresolvable R_ARM_THM_CALL relocation' error message. See https://code.google.com/p/android/issues/detail?id=35342
|
||||
if( ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" )
|
||||
if( ANDROID_GOLD_LINKER AND (CMAKE_HOST_UNIX OR ANDROID_NDK_RELEASE STRGREATER "r8b") AND (ARMEABI OR ARMEABI_V7A OR X86) )
|
||||
set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold" )
|
||||
elseif( ANDROID_NDK_RELEASE STREQUAL "r8c")
|
||||
set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=bfd" )
|
||||
elseif( ANDROID_NDK_RELEASE STREQUAL "r8b" AND ARMEABI AND NOT _CMAKE_IN_TRY_COMPILE )
|
||||
message( WARNING "The default bfd linker from arm GCC 4.6 toolchain can fail with 'unresolvable R_ARM_THM_CALL relocation' error message. See https://code.google.com/p/android/issues/detail?id=35342
|
||||
On Linux and OS X host platform you can workaround this problem using gold linker (default).
|
||||
Rerun cmake with -DANDROID_GOLD_LINKER=ON option.
|
||||
Rerun cmake with -DANDROID_GOLD_LINKER=ON option in case of problems.
|
||||
" )
|
||||
endif()
|
||||
endif()
|
||||
endif() # version 4.6
|
||||
|
||||
if( ANDROID_NOEXECSTACK )
|
||||
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Wa,--noexecstack" )
|
||||
if( ANDROID_COMPILER_IS_CLANG )
|
||||
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Xclang -mnoexecstack" )
|
||||
else()
|
||||
set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Wa,--noexecstack" )
|
||||
endif()
|
||||
set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-z,noexecstack" )
|
||||
endif()
|
||||
|
||||
@ -1166,6 +1280,22 @@ if( ANDROID_RELRO )
|
||||
set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now" )
|
||||
endif()
|
||||
|
||||
if( ANDROID_COMPILER_IS_CLANG )
|
||||
set( ANDROID_CXX_FLAGS "-Qunused-arguments ${ANDROID_CXX_FLAGS}" )
|
||||
if( ARMEABI_V7A AND NOT ANDROID_FORCE_ARM_BUILD )
|
||||
set( ANDROID_CXX_FLAGS_RELEASE "-target thumbv7-none-linux-androideabi ${ANDROID_CXX_FLAGS_RELEASE}" )
|
||||
set( ANDROID_CXX_FLAGS_DEBUG "-target ${ANDROID_LLVM_TRIPLE} ${ANDROID_CXX_FLAGS_DEBUG}" )
|
||||
else()
|
||||
set( ANDROID_CXX_FLAGS "-target ${ANDROID_LLVM_TRIPLE} ${ANDROID_CXX_FLAGS}" )
|
||||
endif()
|
||||
if( BUILD_WITH_ANDROID_NDK )
|
||||
if(ANDROID_ARCH_NAME STREQUAL "arm" )
|
||||
set( ANDROID_CXX_FLAGS "-isystem ${ANDROID_CLANG_TOOLCHAIN_ROOT}/lib/clang/${ANDROID_CLANG_VERSION}/include ${ANDROID_CXX_FLAGS}" )
|
||||
endif()
|
||||
set( ANDROID_CXX_FLAGS "-gcc-toolchain ${ANDROID_TOOLCHAIN_ROOT} ${ANDROID_CXX_FLAGS}" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# cache flags
|
||||
set( CMAKE_CXX_FLAGS "" CACHE STRING "c++ flags" )
|
||||
set( CMAKE_C_FLAGS "" CACHE STRING "c flags" )
|
||||
@ -1189,9 +1319,9 @@ set( CMAKE_MODULE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FL
|
||||
set( CMAKE_EXE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
|
||||
|
||||
if( MIPS AND BUILD_WITH_ANDROID_NDK AND ANDROID_NDK_RELEASE STREQUAL "r8" )
|
||||
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_SHARED_LINKER_FLAGS}" )
|
||||
set( CMAKE_MODULE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_MODULE_LINKER_FLAGS}" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/mipself.x ${CMAKE_EXE_LINKER_FLAGS}" )
|
||||
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_SHARED_LINKER_FLAGS}" )
|
||||
set( CMAKE_MODULE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_MODULE_LINKER_FLAGS}" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.x ${CMAKE_EXE_LINKER_FLAGS}" )
|
||||
endif()
|
||||
|
||||
# configure rtti
|
||||
@ -1218,6 +1348,19 @@ endif()
|
||||
include_directories( SYSTEM "${ANDROID_SYSROOT}/usr/include" ${ANDROID_STL_INCLUDE_DIRS} )
|
||||
link_directories( "${CMAKE_INSTALL_PREFIX}/libs/${ANDROID_NDK_ABI_NAME}" )
|
||||
|
||||
# setup output directories
|
||||
set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "root for library output, set this to change where android libs are installed to" )
|
||||
set( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )
|
||||
|
||||
if(NOT _CMAKE_IN_TRY_COMPILE)
|
||||
if( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" )
|
||||
set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for applications" )
|
||||
else()
|
||||
set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin" CACHE PATH "Output directory for applications" )
|
||||
endif()
|
||||
set( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "path for android libs" )
|
||||
endif()
|
||||
|
||||
# set these global flags for cmake client scripts to change behavior
|
||||
set( ANDROID True )
|
||||
set( BUILD_ANDROID True )
|
||||
@ -1335,7 +1478,7 @@ endif()
|
||||
# Variables controlling behavior or set by cmake toolchain:
|
||||
# ANDROID_ABI : "armeabi-v7a" (default), "armeabi", "armeabi-v7a with NEON", "armeabi-v7a with VFPV3", "armeabi-v6 with VFP", "x86", "mips"
|
||||
# ANDROID_NATIVE_API_LEVEL : 3,4,5,8,9,14 (depends on NDK version)
|
||||
# ANDROID_SET_OBSOLETE_VARIABLES : ON/OFF
|
||||
# ANDROID_STL : gnustl_static/gnustl_shared/stlport_static/stlport_shared/gabi++_static/gabi++_shared/system_re/system/none
|
||||
# ANDROID_FORBID_SYGWIN : ON/OFF
|
||||
# ANDROID_NO_UNDEFINED : ON/OFF
|
||||
# ANDROID_SO_UNDEFINED : OFF/ON (default depends on NDK version)
|
||||
@ -1343,16 +1486,15 @@ endif()
|
||||
# ANDROID_GOLD_LINKER : ON/OFF
|
||||
# ANDROID_NOEXECSTACK : ON/OFF
|
||||
# ANDROID_RELRO : ON/OFF
|
||||
# Variables that takes effect only at first run:
|
||||
# ANDROID_FORCE_ARM_BUILD : ON/OFF
|
||||
# ANDROID_STL : gnustl_static/gnustl_shared/stlport_static/stlport_shared/gabi++_static/gabi++_shared/system_re/system/none
|
||||
# ANDROID_STL_FORCE_FEATURES : ON/OFF
|
||||
# LIBRARY_OUTPUT_PATH_ROOT : <any valid path>
|
||||
# NDK_CCACHE : <path to your ccache executable>
|
||||
# ANDROID_SET_OBSOLETE_VARIABLES : ON/OFF
|
||||
# Can be set only at the first run:
|
||||
# ANDROID_NDK
|
||||
# ANDROID_STANDALONE_TOOLCHAIN
|
||||
# ANDROID_TOOLCHAIN_NAME : "arm-linux-androideabi-4.4.3" or "arm-linux-androideabi-4.6" or "mipsel-linux-android-4.4.3" or "mipsel-linux-android-4.6" or "x86-4.4.3" or "x86-4.6"
|
||||
# ANDROID_TOOLCHAIN_NAME : the NDK name of compiler toolchain
|
||||
# LIBRARY_OUTPUT_PATH_ROOT : <any valid path>
|
||||
# NDK_CCACHE : <path to your ccache executable>
|
||||
# Obsolete:
|
||||
# ANDROID_API_LEVEL : superseded by ANDROID_NATIVE_API_LEVEL
|
||||
# ARM_TARGET : superseded by ANDROID_ABI
|
||||
@ -1375,10 +1517,11 @@ endif()
|
||||
# BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used
|
||||
# ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform
|
||||
# ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86" or "mips" depending on ANDROID_ABI
|
||||
# ANDROID_NDK_RELEASE : one of r5, r5b, r5c, r6, r6b, r7, r7b, r7c, r8, r8b; set only for NDK
|
||||
# ANDROID_NDK_RELEASE : one of r5, r5b, r5c, r6, r6b, r7, r7b, r7c, r8, r8b, r8c; set only for NDK
|
||||
# ANDROID_ARCH_NAME : "arm" or "x86" or "mips" depending on ANDROID_ABI
|
||||
# ANDROID_SYSROOT : path to the compiler sysroot
|
||||
# TOOL_OS_SUFFIX : "" or ".exe" depending on host platform
|
||||
# ANDROID_COMPILER_IS_CLANG : TRUE if clang compiler is used
|
||||
# Obsolete:
|
||||
# ARMEABI_NDK_NAME : superseded by ANDROID_NDK_ABI_NAME
|
||||
#
|
||||
@ -1388,10 +1531,13 @@ endif()
|
||||
# ANDROID_SUPPORTED_ABIS : list of currently allowed values for ANDROID_ABI
|
||||
# ANDROID_TOOLCHAIN_MACHINE_NAME : "arm-linux-androideabi", "arm-eabi" or "i686-android-linux"
|
||||
# ANDROID_TOOLCHAIN_ROOT : path to the top level of toolchain (standalone or placed inside NDK)
|
||||
# ANDROID_CLANG_TOOLCHAIN_ROOT : path to clang tools
|
||||
# ANDROID_SUPPORTED_NATIVE_API_LEVELS : list of native API levels found inside NDK
|
||||
# ANDROID_STL_INCLUDE_DIRS : stl include paths
|
||||
# ANDROID_RTTI : if rtti is enabled by the runtime
|
||||
# ANDROID_EXCEPTIONS : if exceptions are enabled by the runtime
|
||||
# ANDROID_GCC_TOOLCHAIN_NAME : read-only, differs from ANDROID_TOOLCHAIN_NAME only if clang is used
|
||||
# ANDROID_CLANG_VERSION : version of clang compiler if clang is used
|
||||
#
|
||||
# Defaults:
|
||||
# ANDROID_DEFAULT_NDK_API_LEVEL
|
||||
|
@ -35,5 +35,5 @@ set_target_properties(${the_module} PROPERTIES
|
||||
INSTALL_NAME_DIR lib
|
||||
)
|
||||
|
||||
get_filename_component(lib_name "opencv_info" NAME)
|
||||
install(FILES "${LIBRARY_OUTPUT_PATH}/${lib_name}" DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
|
||||
get_filename_component(lib_name "libopencv_info.so" NAME)
|
||||
install(FILES "${LIBRARY_OUTPUT_PATH}/${lib_name}" DESTINATION ${OPENCV_LIB_INSTALL_PATH} COMPONENT main)
|
||||
|
@ -4,5 +4,5 @@ cd `dirname $0`/..
|
||||
mkdir -p build_service
|
||||
cd build_service
|
||||
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=../android.toolchain.cmake -DANDROID_STL=stlport_static -DANDROID_STL_FORCE_FEATURES=OFF -DBUILD_ANDROID_SERVICE=ON -DANDROID_SOURCE_TREE=~/Projects/AndroidSource/ServiceStub/ $@ ../..
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=../android.toolchain.cmake -DANDROID_TOOLCHAIN_NAME="arm-linux-androideabi-4.4.3" -DANDROID_STL=stlport_static -DANDROID_STL_FORCE_FEATURES=OFF -DBUILD_ANDROID_SERVICE=ON -DANDROID_SOURCE_TREE=~/Projects/AndroidSource/ServiceStub/ $@ ../..
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.opencv.engine"
|
||||
android:versionCode="20@ANDROID_PLATFORM_VERSION_CODE@"
|
||||
android:versionName="2.0" >
|
||||
android:versionCode="22@ANDROID_PLATFORM_VERSION_CODE@"
|
||||
android:versionName="2.2" >
|
||||
|
||||
<uses-sdk android:minSdkVersion="8" />
|
||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
|
||||
|
@ -35,7 +35,7 @@ LOCAL_MODULE := libOpenCVEngine
|
||||
|
||||
LOCAL_LDLIBS += -lz -lbinder -llog -lutils
|
||||
|
||||
LOCAL_LDFLAGS += -Wl,-allow-shlib-undefine
|
||||
LOCAL_LDFLAGS += -Wl,-allow-shlib-undefined
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@ -74,7 +74,6 @@ LOCAL_CFLAGS += -D__SUPPORT_MIPS
|
||||
LOCAL_MODULE := libOpenCVEngine_jni
|
||||
|
||||
LOCAL_LDLIBS += -lz -lbinder -llog -lutils -landroid_runtime
|
||||
|
||||
LOCAL_SHARED_LIBRARIES = libOpenCVEngine
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
@ -83,4 +82,4 @@ include $(BUILD_SHARED_LIBRARY)
|
||||
# Native test application
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
include $(LOCAL_PATH)/Tests/Tests.mk
|
||||
#include $(LOCAL_PATH)/Tests/Tests.mk
|
@ -2,4 +2,5 @@ APP_ABI := armeabi x86 mips
|
||||
APP_PLATFORM := android-8
|
||||
APP_STL := stlport_static
|
||||
APP_CPPFLAGS := -fno-rtti -fno-exceptions
|
||||
NDK_TOOLCHAIN_VERSION=4.4.3
|
||||
#APP_OPTIM := debug
|
@ -36,7 +36,7 @@ LOCAL_CFLAGS += -D__SUPPORT_TEGRA3
|
||||
LOCAL_CFLAGS += -D__SUPPORT_MIPS
|
||||
#LOCAL_CFLAGS += -D__SUPPORT_ARMEABI_FEATURES
|
||||
|
||||
LOCAL_LDFLAGS = -Wl,-allow-shlib-undefined
|
||||
#LOCAL_LDFLAGS = -Wl,-allow-shlib-undefined
|
||||
|
||||
LOCAL_MODULE := OpenCVEngineTestApp
|
||||
|
||||
|
@ -54,7 +54,7 @@ endif()
|
||||
# Detect GNU version:
|
||||
# ----------------------------------------------------------------------------
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
|
||||
OUTPUT_VARIABLE CMAKE_OPENCV_GCC_VERSION_FULL
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
|
@ -71,6 +71,12 @@ if(ANDROID)
|
||||
endforeach()
|
||||
string(REPLACE "opencv_" "" OPENCV_MODULES_CONFIGMAKE "${OPENCV_MODULES_CONFIGMAKE}")
|
||||
|
||||
# prepare 3rd-party component list without TBB for armeabi and mips platforms. TBB is useless there.
|
||||
set(OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE})
|
||||
foreach(mod ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB})
|
||||
string(REPLACE "tbb" "" OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB "${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB}")
|
||||
endforeach()
|
||||
|
||||
if(BUILD_FAT_JAVA_LIB)
|
||||
set(OPENCV_LIBS_CONFIGMAKE java)
|
||||
else()
|
||||
|
@ -29,8 +29,22 @@ ifeq ($(OPENCV_LIB_TYPE),SHARED)
|
||||
OPENCV_3RDPARTY_COMPONENTS:=
|
||||
OPENCV_EXTRA_COMPONENTS:=
|
||||
else
|
||||
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
|
||||
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
|
||||
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE@
|
||||
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi)
|
||||
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB@
|
||||
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),mips)
|
||||
OPENCV_3RDPARTY_COMPONENTS:=@OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE_NO_TBB@
|
||||
OPENCV_EXTRA_COMPONENTS:=@OPENCV_EXTRA_COMPONENTS_CONFIGMAKE@
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq (${OPENCV_CAMERA_MODULES},on)
|
||||
|
@ -583,7 +583,7 @@ namespace cv
|
||||
virtual ~StereoVar();
|
||||
|
||||
//! the stereo correspondence operator that computes disparity map for the specified rectified stereo pair
|
||||
CV_WRAP_AS(compute) virtual void operator()(const Mat& left, const Mat& right, Mat& disp);
|
||||
CV_WRAP_AS(compute) virtual void operator()(const Mat& left, const Mat& right, CV_OUT Mat& disp);
|
||||
|
||||
CV_PROP_RW int levels;
|
||||
CV_PROP_RW double pyrScale;
|
||||
|
@ -1,6 +1,8 @@
|
||||
#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)
|
||||
#include "opencv2/contrib/detection_based_tracker.hpp"
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#if defined(DEBUG) || defined(_DEBUG)
|
||||
#undef DEBUGLOGS
|
||||
#define DEBUGLOGS 1
|
||||
@ -12,7 +14,6 @@
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <android/log.h>
|
||||
#include <pthread.h>
|
||||
#define LOG_TAG "OBJECT_DETECTOR"
|
||||
#define LOGD0(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
|
||||
#define LOGI0(...) ((void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
|
||||
|
@ -204,11 +204,11 @@ CV_EXPORTS ErrorCallback redirectError( ErrorCallback errCallback,
|
||||
#ifdef __GNUC__
|
||||
#define CV_Error( code, msg ) cv::error( cv::Exception(code, msg, __func__, __FILE__, __LINE__) )
|
||||
#define CV_Error_( code, args ) cv::error( cv::Exception(code, cv::format args, __func__, __FILE__, __LINE__) )
|
||||
#define CV_Assert( expr ) if((expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, __func__, __FILE__, __LINE__) )
|
||||
#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, __func__, __FILE__, __LINE__) )
|
||||
#else
|
||||
#define CV_Error( code, msg ) cv::error( cv::Exception(code, msg, "", __FILE__, __LINE__) )
|
||||
#define CV_Error_( code, args ) cv::error( cv::Exception(code, cv::format args, "", __FILE__, __LINE__) )
|
||||
#define CV_Assert( expr ) if((expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, "", __FILE__, __LINE__) )
|
||||
#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, "", __FILE__, __LINE__) )
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
@ -56,7 +56,7 @@
|
||||
#define CV_XADD(addr,delta) _InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(addr)), delta)
|
||||
#elif defined __GNUC__
|
||||
|
||||
#if defined __clang__ && __clang_major__ >= 3
|
||||
#if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__
|
||||
#ifdef __ATOMIC_SEQ_CST
|
||||
#define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), (delta), __ATOMIC_SEQ_CST)
|
||||
#else
|
||||
|
@ -1,5 +0,0 @@
|
||||
#Wed Jun 29 04:36:40 MSD 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
@ -1,5 +1,4 @@
|
||||
#Wed Jun 29 04:36:40 MSD 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
@ -4,6 +4,9 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import junit.framework.Assert;
|
||||
|
||||
import org.opencv.android.BaseLoaderCallback;
|
||||
import org.opencv.android.LoaderCallbackInterface;
|
||||
import org.opencv.android.OpenCVLoader;
|
||||
import org.opencv.android.Utils;
|
||||
import org.opencv.core.Mat;
|
||||
|
||||
@ -20,8 +23,7 @@ import android.util.Log;
|
||||
|
||||
public class OpenCVTestRunner extends InstrumentationTestRunner {
|
||||
|
||||
static { System.loadLibrary("opencv_java"); }
|
||||
|
||||
private static final long MANAGER_TIMEOUT = 3000;
|
||||
public static String LENA_PATH;
|
||||
public static String CHESS_PATH;
|
||||
public static String LBPCASCADE_FRONTALFACE_PATH;
|
||||
@ -30,6 +32,26 @@ public class OpenCVTestRunner extends InstrumentationTestRunner {
|
||||
private AndroidTestRunner androidTestRunner;
|
||||
private static String TAG = "opencv_test_java";
|
||||
|
||||
private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(getContext()) {
|
||||
|
||||
@Override
|
||||
public void onManagerConnected(int status) {
|
||||
switch (status) {
|
||||
case LoaderCallbackInterface.SUCCESS:
|
||||
{
|
||||
Log("OpenCV loaded successfully");
|
||||
synchronized (this) {
|
||||
notify();
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
{
|
||||
super.onManagerConnected(status);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public static String getTempFileName(String extension)
|
||||
{
|
||||
File cache = context.getCacheDir();
|
||||
@ -56,6 +78,25 @@ public class OpenCVTestRunner extends InstrumentationTestRunner {
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
// try to load internal libs
|
||||
if (!OpenCVLoader.initDebug()) {
|
||||
// There is no internal OpenCV libs
|
||||
// Using OpenCV Manager for initialization;
|
||||
|
||||
Log("Internal OpenCV library not found. Using OpenCV Manager for initialization");
|
||||
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, getContext(), mLoaderCallback);
|
||||
|
||||
synchronized (this) {
|
||||
try {
|
||||
wait(MANAGER_TIMEOUT);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Log("OpenCV library found inside test package. Using it!");
|
||||
}
|
||||
|
||||
context = getContext();
|
||||
Assert.assertTrue("Context can't be 'null'", context != null);
|
||||
LENA_PATH = Utils.exportResource(context, R.drawable.lena);
|
||||
@ -69,8 +110,6 @@ public class OpenCVTestRunner extends InstrumentationTestRunner {
|
||||
//List<TestCase> testCases = androidTestRunner.getTestCases();
|
||||
//Collections.shuffle(testCases); //shuffle the tests order
|
||||
|
||||
// Note: VideoCapture tests turned off by flag field in VideoCaptureTest class
|
||||
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>15-puzzle</name>
|
||||
<name>OpenCV Sample - 15 puzzle</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
|
@ -1,4 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
@ -1,5 +1,4 @@
|
||||
#Wed Jun 29 04:36:40 MSD 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
@ -28,8 +28,8 @@
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.303359177" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.373249505" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/platforms/android-9/arch-arm/usr/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include""/>
|
||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/../../sdk/native/jni/include""/>
|
||||
</option>
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1424359063" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||
@ -40,8 +40,8 @@
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.1156172258" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.149918263" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/platforms/android-9/arch-arm/usr/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include""/>
|
||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/../../sdk/native/jni/include""/>
|
||||
</option>
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.719752707" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||
|
@ -1,5 +1,4 @@
|
||||
#Wed Jun 29 04:36:40 MSD 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
@ -1,3 +1,4 @@
|
||||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -fexceptions
|
||||
APP_ABI := armeabi-v7a
|
||||
APP_PLATFORM := android-8
|
||||
|
@ -1,5 +1,4 @@
|
||||
#Wed Jun 29 04:36:40 MSD 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
@ -1,5 +1,4 @@
|
||||
#Wed Jun 29 04:36:40 MSD 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
@ -1,5 +1,4 @@
|
||||
#Wed Jun 29 04:36:40 MSD 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
@ -1,5 +1,4 @@
|
||||
#Wed Jun 29 04:36:40 MSD 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
@ -28,8 +28,8 @@
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.982773030" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.332905639" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/platforms/android-9/arch-arm/usr/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include""/>
|
||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/../../sdk/native/jni/include""/>
|
||||
</option>
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1475512260" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||
@ -40,8 +40,8 @@
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.472513352" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1490236166" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/platforms/android-9/arch-arm/usr/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include""/>
|
||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/../../sdk/native/jni/include""/>
|
||||
</option>
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.945696849" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||
|
@ -1,5 +1,4 @@
|
||||
#Wed Jun 29 04:36:40 MSD 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
@ -1,3 +1,4 @@
|
||||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -fexceptions
|
||||
APP_ABI := armeabi-v7a
|
||||
APP_PLATFORM := android-8
|
||||
|
@ -8,6 +8,8 @@ using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
extern "C" {
|
||||
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial3_Sample3Native_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba);
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial3_Sample3Native_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba)
|
||||
{
|
||||
Mat* pMatGr=(Mat*)addrGray;
|
||||
|
@ -31,8 +31,8 @@
|
||||
</option>
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1772035264" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/platforms/android-9/arch-arm/usr/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include""/>
|
||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/../../sdk/native/jni/include""/>
|
||||
</option>
|
||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.159439464" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||
@ -43,8 +43,8 @@
|
||||
</option>
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1841493632" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/platforms/android-9/arch-arm/usr/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include""/>
|
||||
<listOptionValue builtIn="false" value=""${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include""/>
|
||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/../../sdk/native/jni/include""/>
|
||||
</option>
|
||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.608739504" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||
|
@ -1,5 +1,4 @@
|
||||
#Wed Jun 29 04:36:40 MSD 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
@ -1,3 +1,4 @@
|
||||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -fexceptions
|
||||
APP_ABI := armeabi-v7a
|
||||
APP_PLATFORM := android-8
|
||||
|
@ -8,6 +8,8 @@ using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
extern "C" {
|
||||
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_Sample4Mixed_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba);
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_Sample4Mixed_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba)
|
||||
{
|
||||
Mat* pMatGr=(Mat*)addrGray;
|
||||
|
Loading…
x
Reference in New Issue
Block a user