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
b69bf8a8
Commit
b69bf8a8
authored
Jul 22, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15097 from komakai:no_samples_build-option
parents
426482e0
a897fc91
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
7 deletions
+24
-7
CMakeLists.txt
CMakeLists.txt
+2
-2
android_gradle_projects.cmake
cmake/android/android_gradle_projects.cmake
+12
-0
build_sdk.py
platforms/android/build_sdk.py
+8
-3
gradle.properties
platforms/android/gradle-wrapper/gradle.properties
+1
-1
CMakeLists.txt
samples/CMakeLists.txt
+1
-1
No files found.
CMakeLists.txt
View file @
b69bf8a8
...
@@ -964,7 +964,7 @@ if(BUILD_opencv_apps)
...
@@ -964,7 +964,7 @@ if(BUILD_opencv_apps)
endif
()
endif
()
# examples
# examples
if
(
BUILD_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_PYTHON_EXAMPLES OR INSTALL_C_EXAMPLES
)
if
(
BUILD_EXAMPLES OR BUILD_ANDROID_EXAMPLES OR INSTALL_
ANDROID_EXAMPLES OR INSTALL_
PYTHON_EXAMPLES OR INSTALL_C_EXAMPLES
)
add_subdirectory
(
samples
)
add_subdirectory
(
samples
)
endif
()
endif
()
...
@@ -1199,7 +1199,7 @@ ocv_build_features_string(apps_status
...
@@ -1199,7 +1199,7 @@ ocv_build_features_string(apps_status
IF BUILD_EXAMPLES THEN
"examples"
IF BUILD_EXAMPLES THEN
"examples"
IF BUILD_opencv_apps THEN
"apps"
IF BUILD_opencv_apps THEN
"apps"
IF BUILD_ANDROID_SERVICE THEN
"android_service"
IF BUILD_ANDROID_SERVICE THEN
"android_service"
IF
BUILD_ANDROID_EXAMPLES
AND CAN_BUILD_ANDROID_PROJECTS THEN
"android_examples"
IF
(
BUILD_ANDROID_EXAMPLES OR INSTALL_ANDROID_EXAMPLES
)
AND CAN_BUILD_ANDROID_PROJECTS THEN
"android_examples"
ELSE
"-"
)
ELSE
"-"
)
status
(
" Applications:"
"
${
apps_status
}
"
)
status
(
" Applications:"
"
${
apps_status
}
"
)
ocv_build_features_string
(
docs_status
ocv_build_features_string
(
docs_status
...
...
cmake/android/android_gradle_projects.cmake
View file @
b69bf8a8
...
@@ -105,6 +105,7 @@ macro(add_android_project target path)
...
@@ -105,6 +105,7 @@ macro(add_android_project target path)
include ':
${
__dir
}
'
include ':
${
__dir
}
'
"
)
"
)
if
(
BUILD_ANDROID_EXAMPLES
)
# build apk
# build apk
set
(
APK_FILE
"
${
ANDROID_BUILD_BASE_DIR
}
/
${
__dir
}
/build/outputs/apk/release/
${
__dir
}
-
${
ANDROID_ABI
}
-release-unsigned.apk"
)
set
(
APK_FILE
"
${
ANDROID_BUILD_BASE_DIR
}
/
${
__dir
}
/build/outputs/apk/release/
${
__dir
}
-
${
ANDROID_ABI
}
-release-unsigned.apk"
)
ocv_update
(
OPENCV_GRADLE_VERBOSE_OPTIONS
"-i"
)
ocv_update
(
OPENCV_GRADLE_VERBOSE_OPTIONS
"-i"
)
...
@@ -116,6 +117,17 @@ include ':${__dir}'
...
@@ -116,6 +117,17 @@ include ':${__dir}'
DEPENDS
${
depends
}
opencv_java_android
DEPENDS
${
depends
}
opencv_java_android
COMMENT
"Building OpenCV Android sample project:
${
__dir
}
"
COMMENT
"Building OpenCV Android sample project:
${
__dir
}
"
)
)
else
()
# install only
# copy samples
add_custom_command
(
OUTPUT
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
COMMAND
${
CMAKE_COMMAND
}
-E touch
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
WORKING_DIRECTORY
"
${
ANDROID_BUILD_BASE_DIR
}
"
DEPENDS
${
depends
}
opencv_java_android
COMMENT
"Copying OpenCV Android sample project:
${
__dir
}
"
)
endif
()
file
(
REMOVE
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
)
# force rebuild after CMake run
file
(
REMOVE
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
)
# force rebuild after CMake run
add_custom_target
(
android_sample_
${
__dir
}
ALL DEPENDS
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
SOURCES
"
${
ANDROID_SAMPLE_MANIFEST_PATH
}
"
)
add_custom_target
(
android_sample_
${
__dir
}
ALL DEPENDS
"
${
OPENCV_DEPHELPER
}
/android_sample_
${
__dir
}
"
SOURCES
"
${
ANDROID_SAMPLE_MANIFEST_PATH
}
"
)
...
...
platforms/android/build_sdk.py
View file @
b69bf8a8
...
@@ -151,6 +151,7 @@ class Builder:
...
@@ -151,6 +151,7 @@ class Builder:
self
.
ninja_path
=
self
.
get_ninja
()
self
.
ninja_path
=
self
.
get_ninja
()
self
.
debug
=
True
if
config
.
debug
else
False
self
.
debug
=
True
if
config
.
debug
else
False
self
.
debug_info
=
True
if
config
.
debug_info
else
False
self
.
debug_info
=
True
if
config
.
debug_info
else
False
self
.
no_samples_build
=
True
if
config
.
no_samples_build
else
False
def
get_cmake
(
self
):
def
get_cmake
(
self
):
if
not
self
.
config
.
use_android_buildtools
and
check_executable
([
'cmake'
,
'--version'
]):
if
not
self
.
config
.
use_android_buildtools
and
check_executable
([
'cmake'
,
'--version'
]):
...
@@ -217,7 +218,7 @@ class Builder:
...
@@ -217,7 +218,7 @@ class Builder:
BUILD_TESTS
=
"OFF"
,
BUILD_TESTS
=
"OFF"
,
BUILD_PERF_TESTS
=
"OFF"
,
BUILD_PERF_TESTS
=
"OFF"
,
BUILD_DOCS
=
"OFF"
,
BUILD_DOCS
=
"OFF"
,
BUILD_ANDROID_EXAMPLES
=
"ON"
,
BUILD_ANDROID_EXAMPLES
=
(
"OFF"
if
self
.
no_samples_build
else
"ON"
)
,
INSTALL_ANDROID_EXAMPLES
=
"ON"
,
INSTALL_ANDROID_EXAMPLES
=
"ON"
,
)
)
if
self
.
ninja_path
!=
'ninja'
:
if
self
.
ninja_path
!=
'ninja'
:
...
@@ -243,8 +244,11 @@ class Builder:
...
@@ -243,8 +244,11 @@ class Builder:
execute
(
cmd
)
execute
(
cmd
)
# full parallelism for C++ compilation tasks
# full parallelism for C++ compilation tasks
execute
([
self
.
ninja_path
,
"opencv_modules"
])
execute
([
self
.
ninja_path
,
"opencv_modules"
])
# limit parallelism for Gradle steps (avoid huge memory consumption)
# limit parallelism for building samples (avoid huge memory consumption)
execute
([
self
.
ninja_path
,
'-j3'
,
"install"
if
(
self
.
debug_info
or
self
.
debug
)
else
"install/strip"
])
if
self
.
no_samples_build
:
execute
([
self
.
ninja_path
,
"install"
if
(
self
.
debug_info
or
self
.
debug
)
else
"install/strip"
])
else
:
execute
([
self
.
ninja_path
,
"-j1"
if
(
self
.
debug_info
or
self
.
debug
)
else
"-j3"
,
"install"
if
(
self
.
debug_info
or
self
.
debug
)
else
"install/strip"
])
def
build_javadoc
(
self
):
def
build_javadoc
(
self
):
classpaths
=
[]
classpaths
=
[]
...
@@ -323,6 +327,7 @@ if __name__ == "__main__":
...
@@ -323,6 +327,7 @@ if __name__ == "__main__":
parser
.
add_argument
(
'--force_opencv_toolchain'
,
action
=
"store_true"
,
help
=
"Do not use toolchain from Android NDK"
)
parser
.
add_argument
(
'--force_opencv_toolchain'
,
action
=
"store_true"
,
help
=
"Do not use toolchain from Android NDK"
)
parser
.
add_argument
(
'--debug'
,
action
=
"store_true"
,
help
=
"Build 'Debug' binaries (CMAKE_BUILD_TYPE=Debug)"
)
parser
.
add_argument
(
'--debug'
,
action
=
"store_true"
,
help
=
"Build 'Debug' binaries (CMAKE_BUILD_TYPE=Debug)"
)
parser
.
add_argument
(
'--debug_info'
,
action
=
"store_true"
,
help
=
"Build with debug information (useful for Release mode: BUILD_WITH_DEBUG_INFO=ON)"
)
parser
.
add_argument
(
'--debug_info'
,
action
=
"store_true"
,
help
=
"Build with debug information (useful for Release mode: BUILD_WITH_DEBUG_INFO=ON)"
)
parser
.
add_argument
(
'--no_samples_build'
,
action
=
"store_true"
,
help
=
"Do not build samples (speeds up build)"
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
log
.
basicConfig
(
format
=
'
%(message)
s'
,
level
=
log
.
DEBUG
)
log
.
basicConfig
(
format
=
'
%(message)
s'
,
level
=
log
.
DEBUG
)
...
...
platforms/android/gradle-wrapper/gradle.properties
View file @
b69bf8a8
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
# Specifies the JVM arguments used for the daemon process.
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs
=
-Xmx
1536m
org.gradle.jvmargs
=
-Xmx
2g
# When configured, Gradle will run in incubating parallel mode.
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# This option should only be used with decoupled projects. More details, visit
...
...
samples/CMakeLists.txt
View file @
b69bf8a8
...
@@ -38,7 +38,7 @@ endif()
...
@@ -38,7 +38,7 @@ endif()
if
(
UNIX AND NOT ANDROID
AND
(
HAVE_VA OR HAVE_VA_INTEL
))
if
(
UNIX AND NOT ANDROID
AND
(
HAVE_VA OR HAVE_VA_INTEL
))
add_subdirectory
(
va_intel
)
add_subdirectory
(
va_intel
)
endif
()
endif
()
if
(
ANDROID AND
BUILD_ANDROID_EXAMPLES
)
if
(
ANDROID
AND
(
BUILD_ANDROID_EXAMPLES OR INSTALL_ANDROID_EXAMPLES
)
)
add_subdirectory
(
android
)
add_subdirectory
(
android
)
endif
()
endif
()
if
(
INSTALL_PYTHON_EXAMPLES
)
if
(
INSTALL_PYTHON_EXAMPLES
)
...
...
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