-
Notifications
You must be signed in to change notification settings - Fork 0
/
macos.cmake
91 lines (84 loc) · 2.91 KB
/
macos.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Apple macOS
list(APPEND CMAKE_PREFIX_PATH /usr/local)
# BerkeleyDB (nothing; brew berkeley-db (or not))
if (USE_BDB)
find_library(BDB_LIBRARY db_cxx /usr/local/opt/berkeley-db@4/lib)
if (BDB_LIBRARY)
add_definitions(-DUSE_BDB)
add_executable(kvtest_bdb src/bdb.cpp)
include_directories(/usr/local/opt/berkeley-db@4/include/)
target_link_libraries(kvtest_bdb /usr/local/opt/berkeley-db@4/lib/libdb_cxx.dylib)
target_link_libraries(kvtest_bdb common)
install(TARGETS kvtest_bdb RUNTIME DESTINATION bin)
else()
set(USE_BDB OFF)
endif ()
endif ()
# leveldb (cmake; brew leveldb)
if (USE_LDB)
find_package(leveldb CONFIG REQUIRED)
if (USE_LDB)
add_definitions(-DUSE_LDB)
add_executable(kvtest_ldb src/ldb.cpp)
include_directories(/usr/local/opt/leveldb/include/)
target_link_libraries(kvtest_ldb /usr/local/opt/leveldb/lib/libleveldb.dylib)
target_link_libraries(kvtest_ldb common)
install(TARGETS kvtest_ldb RUNTIME DESTINATION bin)
endif()
endif()
# RocksDB (cmake; brew rocksdb)
# list(APPEND CMAKE_MODULE_PATH "/usr/local/opt/rocksdb/lib/cmake")
if (USE_RDB)
find_package(RocksDB CONFIG)
if (USE_RDB)
add_definitions(-DUSE_RDB)
add_executable(kvtest_rdb src/rdb.cpp)
include_directories(/usr/local/opt/rocksdb/include/)
target_link_libraries(kvtest_rdb /usr/local/opt/rocksdb/lib/librocksdb.dylib)
target_link_libraries(kvtest_rdb common)
install(TARGETS kvtest_rdb RUNTIME DESTINATION bin)
else()
set(USE_RDB OFF)
endif()
endif()
# LMDB
# (nothing; brew lmdb)
if (USE_MDB)
find_library(LMDB_LIBRARY lmdb)
if (LMDB_LIBRARY)
add_definitions(-DUSE_MDB)
add_executable(kvtest_mdb src/mdb.cpp)
include_directories(/usr/local/opt/lmdb/include/)
target_link_libraries(kvtest_mdb /usr/local/opt/lmdb/lib/liblmdb.dylib)
target_link_libraries(kvtest_mdb common)
install(TARGETS kvtest_mdb RUNTIME DESTINATION bin)
else()
set(USE_MDB OFF)
endif ()
endif()
# kyotocabinet (pkg-config; brew kyoto-cabinet)
if (USE_KC)
pkg_search_module(KC IMPORTED_TARGET kyotocabinet)
if (KC_FOUND)
add_definitions(-DUSE_KC)
add_executable(kvtest_kc src/kc.cpp)
target_link_libraries(kvtest_kc PkgConfig::KC)
target_link_libraries(kvtest_kc common)
install(TARGETS kvtest_kc RUNTIME DESTINATION bin)
else()
set(USE_KC OFF)
endif()
endif()
# tkrzw (pkg-config; brew tkrzw (will))
if (USE_TK)
pkg_search_module(TK IMPORTED_TARGET tkrzw)
if (TK_FOUND)
add_definitions(-DUSE_TK)
add_executable(kvtest_tk src/tk.cpp)
target_link_libraries(kvtest_tk PkgConfig::TK)
target_link_libraries(kvtest_tk common)
install(TARGETS kvtest_tk RUNTIME DESTINATION bin)
else ()
set(USE_TK OFF)
endif()
endif ()