Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
01b986ef
Commit
01b986ef
authored
Feb 24, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed try_compile for Android; Fixed samples build
parent
5bea651e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
11 deletions
+20
-11
android.toolchain.cmake
android/android.toolchain.cmake
+18
-9
OpenCVDetectAndroidSDK.cmake
cmake/OpenCVDetectAndroidSDK.cmake
+2
-2
No files found.
android/android.toolchain.cmake
View file @
01b986ef
...
...
@@ -156,6 +156,8 @@
# [+] 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
# [+] mostly fixed try_compile (it was always failing for Android)
# ------------------------------------------------------------------------------
# this one is important
...
...
@@ -661,10 +663,25 @@ elseif( EXISTS "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/incl
endif
()
#flags and definitions
set
(
ANDROID_CXX_FLAGS
"--sysroot=
\"
${
ANDROID_SYSROOT
}
\"
"
)
if
(
ANDROID_SYSROOT MATCHES
"[ ;
\"
]"
)
set
(
ANDROID_CXX_FLAGS
"--sysroot=
\"
${
ANDROID_SYSROOT
}
\"
"
)
# quotes will break try_compile and compiler identification
message
(
WARNING
"Your Android system root has non-alphanumeric symbols. It can break compiler features detection and the whole build."
)
else
()
set
(
ANDROID_CXX_FLAGS
"--sysroot=
${
ANDROID_SYSROOT
}
"
)
endif
()
remove_definitions
(
-DANDROID
)
add_definitions
(
-DANDROID
)
# Force set compilers because standard identification works badly for us
include
(
CMakeForceCompiler
)
CMAKE_FORCE_C_COMPILER
(
"
${
CMAKE_C_COMPILER
}
"
GNU
)
CMAKE_FORCE_CXX_COMPILER
(
"
${
CMAKE_CXX_COMPILER
}
"
GNU
)
set
(
CMAKE_SIZEOF_VOID_P 4
)
set
(
CMAKE_C_SIZEOF_DATA_PTR 4
)
set
(
CMAKE_CXX_SIZEOF_DATA_PTR 4
)
# NDK flags
if
(
ARMEABI OR ARMEABI_V7A
)
# NDK also defines -ffunction-sections -funwind-tables but they result in worse OpenCV performance
...
...
@@ -835,14 +852,6 @@ link_directories( ${ANDROID_SYSTEM_LIB_DIRS} )
set
(
ANDROID_CXX_FLAGS
"
${
ANDROID_CXX_FLAGS
}
"
CACHE INTERNAL
"Extra Android falgs"
)
set
(
CMAKE_CXX_FLAGS
"
${
ANDROID_CXX_FLAGS
}
${
CMAKE_CXX_FLAGS
}
"
)
set
(
CMAKE_C_FLAGS
"
${
ANDROID_CXX_FLAGS
}
${
CMAKE_C_FLAGS
}
"
)
# workaround for ugly cmake bug - compiler identification replaces all spaces (and somethimes " (quote symbol)) in the compiler flags with ; symbol
# as result identification fails if ANDROID_SYSROOT contain spaces
include
(
CMakeForceCompiler
)
CMAKE_FORCE_C_COMPILER
(
"
${
CMAKE_C_COMPILER
}
"
GNU
)
CMAKE_FORCE_CXX_COMPILER
(
"
${
CMAKE_CXX_COMPILER
}
"
GNU
)
set
(
CMAKE_SIZEOF_VOID_P 4
)
set
(
CMAKE_C_SIZEOF_DATA_PTR 4
)
set
(
CMAKE_CXX_SIZEOF_DATA_PTR 4
)
#set these global flags for cmake client scripts to change behavior
set
(
ANDROID True
)
...
...
cmake/OpenCVDetectAndroidSDK.cmake
View file @
01b986ef
...
...
@@ -73,8 +73,8 @@ if(ANDROID_EXECUTABLE)
# detect ANDROID_SDK_TARGET if no target is provided by user
if
(
NOT ANDROID_SDK_TARGET
)
set
(
desired_android_target_level
${
ANDROID_NATIVE_API_LEVEL
}
)
if
(
desired_android_target_level LESS
8
)
set
(
desired_android_target_level
8
)
if
(
desired_android_target_level LESS
11
)
set
(
desired_android_target_level
11
)
endif
()
if
(
ANDROID_PROCESS EQUAL 0
)
math
(
EXPR desired_android_target_level_1
"
${
desired_android_target_level
}
-1"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment