File tree 7 files changed +20
-3
lines changed
7 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ option(OLP_SDK_BUILD_EXTERNAL_DEPS "Download and build external dependencies" ON
42
42
option (OLP_SDK_BUILD_EXAMPLES "Enable examples targets" OFF )
43
43
option (OLP_SDK_MSVC_PARALLEL_BUILD_ENABLE "Enable parallel build on MSVC" ON )
44
44
option (OLP_SDK_DISABLE_DEBUG_LOGGING "Disable debug and trace level logging" OFF )
45
- option (OLP_SDK_ENABLE_DEFAULT_CACHE "Enable default cache implementation" ON )
46
- option (OLP_SDK_ENABLE_DEFAULT_CACHE_LMDB "Enable default cache implementation based on LMDB" OFF )
45
+ option (OLP_SDK_ENABLE_DEFAULT_CACHE "Enable default cache implementation based on LevelDB" OFF )
46
+ option (OLP_SDK_ENABLE_DEFAULT_CACHE_LMDB "Enable default cache implementation based on LMDB" ON )
47
47
48
48
# C++ standard version. Minimum supported version is 11.
49
49
set (CMAKE_CXX_STANDARD 11)
Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ find_package(olp-cpp-sdk-dataservice-write REQUIRED)
40
40
find_package(leveldb REQUIRED)
41
41
find_package(Threads REQUIRED)
42
42
43
+ if(OLP_SDK_ENABLE_DEFAULT_CACHE_LMDB)
44
+ find_package(lmdb REQUIRED)
45
+ endif()
46
+
43
47
add_library(@OLP_SDK_EXAMPLE_TARGET_NAME@ SHARED
44
48
${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/Examples.h
45
49
${CMAKE_CURRENT_SOURCE_DIR}/src/main/cpp/ReadExample.h
Original file line number Diff line number Diff line change @@ -21,13 +21,16 @@ android {
21
21
// 2. OLP_SDK_HTTP_CLIENT_JAR - path to the OlpHttpClient.jar file; usually it stored in the <olp-build-folder>/olp-cpp-sdk-core/
22
22
// 3. (If not installed to the sysroot) path to the levelDB library:
23
23
// - leveldb_DIR;
24
- // 4. (If not installed to the sysroot) - path to the OLP SDK cmake config files:
24
+ // 4. (If not installed to the sysroot) path to the lmdb library:
25
+ // - lmdb_DIR;
26
+ // 5. (If not installed to the sysroot) - path to the OLP SDK cmake config files:
25
27
// - olp-cpp-sdk-core_DIR;
26
28
// - olp-cpp-sdk-dataservice-write_DIR;
27
29
// - olp-cpp-sdk-authentication_DIR
28
30
arguments "@OLP_SDK_EXAMPLE_ANDROID_TOOLCHAIN_FILE@",
29
31
"@OLP_SDK_EXAMPLE_HTTP_CLIENT_JAR@",
30
32
"@OLP_SDK_EXAMPLE_LEVELDB_DIR@",
33
+ "@OLP_SDK_EXAMPLE_LMDB_DIR@",
31
34
// required for finding installed packages in sysroot
32
35
"-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH",
33
36
"-DBOOST_ROOT=@BOOST_ROOT@",
Original file line number Diff line number Diff line change @@ -60,6 +60,13 @@ function(gen_android_example_application
60
60
if (DEFINED leveldb_DIR)
61
61
set (OLP_SDK_EXAMPLE_LEVELDB_DIR "-Dleveldb_DIR=${leveldb_DIR} " )
62
62
endif ()
63
+
64
+ if (OLP_SDK_ENABLE_DEFAULT_CACHE_LMDB)
65
+ set (OLP_SDK_EXAMPLE_LMDB_DIR "-Dlmdb_DIR='path to the directory which contains LMDB cmake config files'" )
66
+ if (DEFINED lmdb_DIR)
67
+ set (OLP_SDK_EXAMPLE_LMDB_DIR "-Dlmdb_DIR=${lmdb_DIR} " )
68
+ endif ()
69
+ endif ()
63
70
64
71
configure_file (
65
72
${CMAKE_CURRENT_SOURCE_DIR} /android/app/build .gradle.in
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ if(OLP_SDK_ENABLE_DEFAULT_CACHE_LMDB)
82
82
find_package (lmdb QUIET )
83
83
if (NOT TARGET lmdb AND NOT lmdb_FOUND)
84
84
add_subdirectory (lmdb)
85
+ set (lmdb_DIR ${EXTERNAL_lmdb_DIR} PARENT_SCOPE)
85
86
set (lmdb_INCLUDE_DIR ${EXTERNAL_lmdb_INCLUDE_DIR} PARENT_SCOPE)
86
87
endif ()
87
88
endif ()
Original file line number Diff line number Diff line change @@ -45,4 +45,5 @@ if(result)
45
45
endif ()
46
46
47
47
# Provide the dir to the lmdb cmake configuration files
48
+ set (EXTERNAL_lmdb_DIR ${EXTERNAL_BINARY_INSTALL_DIR} /lib/cmake/lmdb PARENT_SCOPE)
48
49
set (EXTERNAL_lmdb_INCLUDE_DIR ${EXTERNAL_BINARY_INSTALL_DIR} /include PARENT_SCOPE)
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ cd build
23
23
cmake \
24
24
-DOLP_SDK_ENABLE_TESTING=OFF \
25
25
-DOLP_SDK_ENABLE_DEFAULT_CACHE=OFF \
26
+ -DOLP_SDK_ENABLE_DEFAULT_CACHE_LMDB=OFF \
26
27
-DBUILD_SHARED_LIBS=ON \
27
28
..
28
29
You can’t perform that action at this time.
0 commit comments