55
66cmake_minimum_required (VERSION 3.4.1)
77
8- # The includes and executables can be found in https://github.com/hollaus/opencv_native
9- include_directories (${CMAKE_CURRENT_SOURCE_DIR} /src/main/include /)
8+ # The includes and executables can be found in https://github.com/hollaus/opencv_native which are
9+ # imported as a git submodule
10+ include_directories (${PATH_TO_OPENCV_NATIVE} /jni/include /)
1011
11- add_library ( lib_opencv SHARED IMPORTED )
12- set_target_properties (lib_opencv PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR} /src/main/jniLibs /${ANDROID_ABI} /libopencv_java3.so)
12+ add_library (lib_opencv SHARED IMPORTED )
13+ set_target_properties (lib_opencv PROPERTIES IMPORTED_LOCATION ${PATH_TO_OPENCV_NATIVE} /libs /${ANDROID_ABI} /libopencv_java3.so)
1314
1415# Creates and names a library, sets it as either STATIC
1516# or SHARED, and provides the relative paths to its source code.
1617# You can define multiple libraries, and CMake builds them for you.
1718# Gradle automatically packages shared libraries with your APK.
1819
1920add_library ( # Sets the name of the library.
20- docscan-native
21+ docscan-native
2122
22- # Sets the library as a shared library.
23- SHARED
23+ # Sets the library as a shared library.
24+ SHARED
2425
25- # Provides a relative path to your source file(s).
26- src/main/cpp/DocScanInterface.cpp
27- src/main/cpp/FocusMeasure.cpp
28- src/main/cpp/DkMath.cpp
29- src/main/cpp/PageSegmentationUtils.cpp
30- src/main/cpp/PageSegmentation.cpp
31- src/main/cpp/Utils.cpp
32- src/main/cpp/Illumination.cpp )
26+ # Provides a relative path to your source file(s).
27+ src/main/cpp/DocScanInterface.cpp
28+ src/main/cpp/FocusMeasure.cpp
29+ src/main/cpp/DkMath.cpp
30+ src/main/cpp/PageSegmentationUtils.cpp
31+ src/main/cpp/PageSegmentation.cpp
32+ src/main/cpp/Utils.cpp
33+ src/main/cpp/Illumination.cpp)
3334
3435# Searches for a specified prebuilt library and stores the path as a
3536# variable. Because CMake includes system libraries in the search path by
@@ -38,19 +39,19 @@ add_library( # Sets the name of the library.
3839# completing its build.
3940
4041find_library ( # Sets the name of the path variable.
41- log -lib
42+ log -lib
4243
43- # Specifies the name of the NDK library that
44- # you want CMake to locate.
45- log )
44+ # Specifies the name of the NDK library that
45+ # you want CMake to locate.
46+ log )
4647
4748# Specifies libraries CMake should link to your target library. You
4849# can link multiple libraries, such as libraries you define in this
4950# build script, prebuilt third-party libraries, or system libraries.
5051
5152target_link_libraries ( # Specifies the target library.
52- docscan-native
53- lib_opencv
54- # Links the target library to the log library
55- # included in the NDK.
56- ${log -lib} )
53+ docscan-native
54+ lib_opencv
55+ # Links the target library to the log library
56+ # included in the NDK.
57+ ${log -lib})
0 commit comments