Skip to content

Commit 30b8869

Browse files
committed
link with dlib
1 parent 73f2f2f commit 30b8869

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

visionSamples/FaceTracker/app/CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,28 @@ cmake_minimum_required(VERSION 3.4.1)
77

88
set (CMAKE_CXX_STANDARD 11)
99

10+
set(DLIB_DIR ../../../dlib)
11+
include_directories(${DLIB_DIR})
12+
13+
add_library( # Sets the name of the library.
14+
lib_dlib
15+
16+
# Sets the library as a shared library.
17+
SHARED
18+
19+
# Provides a relative path to your source file(s).
20+
# Associated headers in the same location as their source
21+
# file are automatically included.
22+
../../../dlib/dlib/threads/threads_kernel_shared.cpp
23+
../../../dlib/dlib/entropy_decoder/entropy_decoder_kernel_2.cpp
24+
../../../dlib/dlib/base64/base64_kernel_1.cpp
25+
../../../dlib/dlib/threads/threads_kernel_1.cpp
26+
../../../dlib/dlib/threads/threads_kernel_2.cpp
27+
../../../dlib/dlib/threads/thread_pool_extension.cpp
28+
../../../dlib/dlib/threads/async.cpp
29+
../../../dlib/dlib/dnn/cpu_dlib.cpp
30+
../../../dlib/dlib/dnn/tensor_tools.cpp
31+
)
1032

1133
add_library( # Sets the name of the library.
1234
native-lib
@@ -40,6 +62,8 @@ find_library( # Sets the name of the path variable.
4062
target_link_libraries( # Specifies the target library.
4163
native-lib
4264

65+
lib_dlib
66+
4367
-ljnigraphics
4468

4569
# Links the target library to the log library

visionSamples/FaceTracker/app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ android {
1414
cmake {
1515
cppFlags "-frtti -fexceptions"
1616
abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a'
17-
//arguments "-DANDROID_STL=c++_shared"
17+
arguments "-DANDROID_STL=c++_shared"
1818
// Passes optional arguments to CMake.
1919
//arguments "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=clang"
2020

2121
// Sets a flag to enable format macro constants for the C compiler.
2222
//cFlags "-D__STDC_FORMAT_MACROS"
23+
2324
}
2425
}
2526
}

visionSamples/FaceTracker/app/src/main/cpp/native-lib.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include <android/log.h>
44
#include <android/bitmap.h>
55

6+
#include <dlib/image_processing.h>
7+
68
using namespace std;
79

810
#define LOG_TAG "Native"

0 commit comments

Comments
 (0)