小组成员:姚凯文(kevinyao0901),姜嘉琪
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

470 linhas
14 KiB

leveldb: Fix PosixWritableFile::Sync() on Apple systems. Apple doesn't follow POSIX specifications for fsync(). Instead, fsync() guarantees to flush the buffer cache to the device, which means the data will survive kernel panics, but may not survive power outages. Applications that need stronger guarantees (like databases) need to use fcntl(F_FULLFSYNC). This CL switches PosixWritableFile::Sync() to get the stronger guarantees on Apple systems. The improved implementation follows the same principles as SQLite [1] and node.js [2]. Research for the fcntl() to fsync() fallback strategy: Apple's released source code at https://opensource.apple.com/ shows at least three different error codes being returned when a filesystem does not support F_FULLFSYNC. fcntl() is implemented in xnu-4903.221.2 in bsd/kern/kern_descrip.c, where it delegates to fcntl_nocancel(). The documentation for fcntl_nocancel() mentions error codes for some operations, but does not include F_FULLFSYNC. The F_FULLSYNC branch in fcntl_nocancel() calls VNOP_IOCTL(_, F_FULLSYNC, NULL, 0, _), whose return value sets the error code. VNOP_IOCTL() is implemented in bsd/vfs/kpi_vfs.c and calls the ioctl function in the vnode's operation vector. The per-filesystem function names follow the pattern _vnop_ioctl() for all the instances in opensource code: {hfs,msdosfs,nfs,ntfs,smbfs,webdav,zfs}_vnop_ioctl(). hfs-407.30.1, msdosfs-229.200.3, and nfs in xnu-4903.221.2 handle F_FULLFSYNC. ntfs-94.200.1 and smb-759.40.1 do not handle F_FULLFSYNC, and the default branch returns ENOSUP. webdav-380.200.1 also does not handle F_FULLFSYNC, but the default branch returns EINVAL. zfs-59 also does not handle F_FULLSYNC, and its default branch returns ENOTTY. From a different angle, Apple's ntfs-94.200.1 includes utility code that uses fcntl(F_FULLFSYNC) and falls back to fsync() just like we do, supporting the hypothesis that there is no good way to detect lack of F_FULLFSYNC support. Also, Apple's fcntl() man page [3] does not mention a way to detect lack of F_FULLFSYNC support. [1] https://www.sqlite.org/src/doc/trunk/src/os_unix.c [2] https://github.com/libuv/libuv/blob/master/src/unix/fs.c [3] https://developer.apple.com/library/archive/documentatiVon/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html Tested: https://travis-ci.org/pwnall/leveldb/builds/477318498 TAP global presubmit ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=228593729
há 5 anos
  1. # Copyright 2017 The LevelDB Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file. See the AUTHORS file for names of contributors.
  4. cmake_minimum_required(VERSION 3.9)
  5. # Keep the version below in sync with the one in db.h
  6. project(leveldb VERSION 1.22.0 LANGUAGES C CXX)
  7. # This project can use C11, but will gracefully decay down to C89.
  8. set(CMAKE_C_STANDARD 11)
  9. set(CMAKE_C_STANDARD_REQUIRED OFF)
  10. set(CMAKE_C_EXTENSIONS OFF)
  11. # This project requires C++11.
  12. set(CMAKE_CXX_STANDARD 11)
  13. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  14. set(CMAKE_CXX_EXTENSIONS OFF)
  15. if (WIN32)
  16. set(LEVELDB_PLATFORM_NAME LEVELDB_PLATFORM_WINDOWS)
  17. # TODO(cmumford): Make UNICODE configurable for Windows.
  18. add_definitions(-D_UNICODE -DUNICODE)
  19. else (WIN32)
  20. set(LEVELDB_PLATFORM_NAME LEVELDB_PLATFORM_POSIX)
  21. endif (WIN32)
  22. option(LEVELDB_BUILD_TESTS "Build LevelDB's unit tests" ON)
  23. option(LEVELDB_BUILD_BENCHMARKS "Build LevelDB's benchmarks" ON)
  24. option(LEVELDB_INSTALL "Install LevelDB's header and library" ON)
  25. include(TestBigEndian)
  26. test_big_endian(LEVELDB_IS_BIG_ENDIAN)
  27. include(CheckIncludeFile)
  28. check_include_file("unistd.h" HAVE_UNISTD_H)
  29. include(CheckLibraryExists)
  30. check_library_exists(crc32c crc32c_value "" HAVE_CRC32C)
  31. check_library_exists(snappy snappy_compress "" HAVE_SNAPPY)
  32. check_library_exists(tcmalloc malloc "" HAVE_TCMALLOC)
  33. include(CheckCXXSymbolExists)
  34. # Using check_cxx_symbol_exists() instead of check_c_symbol_exists() because
  35. # we're including the header from C++, and feature detection should use the same
  36. # compiler language that the project will use later. Principles aside, some
  37. # versions of do not expose fdatasync() in <unistd.h> in standard C mode
  38. # (-std=c11), but do expose the function in standard C++ mode (-std=c++11).
  39. check_cxx_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC)
  40. check_cxx_symbol_exists(F_FULLFSYNC "fcntl.h" HAVE_FULLFSYNC)
  41. check_cxx_symbol_exists(O_CLOEXEC "fcntl.h" HAVE_O_CLOEXEC)
  42. if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
  43. # Disable C++ exceptions.
  44. string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  45. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c-")
  46. add_definitions(-D_HAS_EXCEPTIONS=0)
  47. # Disable RTTI.
  48. string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  49. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
  50. else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
  51. # Enable strict prototype warnings for C code in clang and gcc.
  52. if(NOT CMAKE_C_FLAGS MATCHES "-Wstrict-prototypes")
  53. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes")
  54. endif(NOT CMAKE_C_FLAGS MATCHES "-Wstrict-prototypes")
  55. # Disable C++ exceptions.
  56. string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  57. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
  58. # Disable RTTI.
  59. string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  60. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
  61. endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
  62. # Test whether -Wthread-safety is available. See
  63. # https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
  64. include(CheckCXXCompilerFlag)
  65. check_cxx_compiler_flag(-Wthread-safety HAVE_CLANG_THREAD_SAFETY)
  66. include(CheckCXXSourceCompiles)
  67. # Test whether C++17 __has_include is available.
  68. check_cxx_source_compiles("
  69. #if defined(__has_include) && __has_include(<string>)
  70. #include <string>
  71. #endif
  72. int main() { std::string str; return 0; }
  73. " HAVE_CXX17_HAS_INCLUDE)
  74. set(LEVELDB_PUBLIC_INCLUDE_DIR "include/leveldb")
  75. set(LEVELDB_PORT_CONFIG_DIR "include/port")
  76. configure_file(
  77. "port/port_config.h.in"
  78. "${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h"
  79. )
  80. include_directories(
  81. "${PROJECT_BINARY_DIR}/include"
  82. "."
  83. )
  84. if(BUILD_SHARED_LIBS)
  85. # Only export LEVELDB_EXPORT symbols from the shared library.
  86. add_compile_options(-fvisibility=hidden)
  87. endif(BUILD_SHARED_LIBS)
  88. # Must be included before CMAKE_INSTALL_INCLUDEDIR is used.
  89. include(GNUInstallDirs)
  90. add_library(leveldb "")
  91. target_sources(leveldb
  92. PRIVATE
  93. "${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h"
  94. "db/builder.cc"
  95. "db/builder.h"
  96. "db/c.cc"
  97. "db/db_impl.cc"
  98. "db/db_impl.h"
  99. "db/db_iter.cc"
  100. "db/db_iter.h"
  101. "db/dbformat.cc"
  102. "db/dbformat.h"
  103. "db/dumpfile.cc"
  104. "db/filename.cc"
  105. "db/filename.h"
  106. "db/log_format.h"
  107. "db/log_reader.cc"
  108. "db/log_reader.h"
  109. "db/log_writer.cc"
  110. "db/log_writer.h"
  111. "db/memtable.cc"
  112. "db/memtable.h"
  113. "db/repair.cc"
  114. "db/skiplist.h"
  115. "db/snapshot.h"
  116. "db/table_cache.cc"
  117. "db/table_cache.h"
  118. "db/version_edit.cc"
  119. "db/version_edit.h"
  120. "db/version_set.cc"
  121. "db/version_set.h"
  122. "db/write_batch_internal.h"
  123. "db/write_batch.cc"
  124. "port/port_stdcxx.h"
  125. "port/port.h"
  126. "port/thread_annotations.h"
  127. "table/block_builder.cc"
  128. "table/block_builder.h"
  129. "table/block.cc"
  130. "table/block.h"
  131. "table/filter_block.cc"
  132. "table/filter_block.h"
  133. "table/format.cc"
  134. "table/format.h"
  135. "table/iterator_wrapper.h"
  136. "table/iterator.cc"
  137. "table/merger.cc"
  138. "table/merger.h"
  139. "table/table_builder.cc"
  140. "table/table.cc"
  141. "table/two_level_iterator.cc"
  142. "table/two_level_iterator.h"
  143. "util/arena.cc"
  144. "util/arena.h"
  145. "util/bloom.cc"
  146. "util/cache.cc"
  147. "util/coding.cc"
  148. "util/coding.h"
  149. "util/comparator.cc"
  150. "util/crc32c.cc"
  151. "util/crc32c.h"
  152. "util/env.cc"
  153. "util/filter_policy.cc"
  154. "util/hash.cc"
  155. "util/hash.h"
  156. "util/logging.cc"
  157. "util/logging.h"
  158. "util/mutexlock.h"
  159. "util/no_destructor.h"
  160. "util/options.cc"
  161. "util/random.h"
  162. "util/status.cc"
  163. # Only CMake 3.3+ supports PUBLIC sources in targets exported by "install".
  164. $<$<VERSION_GREATER:CMAKE_VERSION,3.2>:PUBLIC>
  165. "${LEVELDB_PUBLIC_INCLUDE_DIR}/c.h"
  166. "${LEVELDB_PUBLIC_INCLUDE_DIR}/cache.h"
  167. "${LEVELDB_PUBLIC_INCLUDE_DIR}/comparator.h"
  168. "${LEVELDB_PUBLIC_INCLUDE_DIR}/db.h"
  169. "${LEVELDB_PUBLIC_INCLUDE_DIR}/dumpfile.h"
  170. "${LEVELDB_PUBLIC_INCLUDE_DIR}/env.h"
  171. "${LEVELDB_PUBLIC_INCLUDE_DIR}/export.h"
  172. "${LEVELDB_PUBLIC_INCLUDE_DIR}/filter_policy.h"
  173. "${LEVELDB_PUBLIC_INCLUDE_DIR}/iterator.h"
  174. "${LEVELDB_PUBLIC_INCLUDE_DIR}/options.h"
  175. "${LEVELDB_PUBLIC_INCLUDE_DIR}/slice.h"
  176. "${LEVELDB_PUBLIC_INCLUDE_DIR}/status.h"
  177. "${LEVELDB_PUBLIC_INCLUDE_DIR}/table_builder.h"
  178. "${LEVELDB_PUBLIC_INCLUDE_DIR}/table.h"
  179. "${LEVELDB_PUBLIC_INCLUDE_DIR}/write_batch.h"
  180. )
  181. if (WIN32)
  182. target_sources(leveldb
  183. PRIVATE
  184. "util/env_windows.cc"
  185. "util/windows_logger.h"
  186. )
  187. else (WIN32)
  188. target_sources(leveldb
  189. PRIVATE
  190. "util/env_posix.cc"
  191. "util/posix_logger.h"
  192. )
  193. endif (WIN32)
  194. # MemEnv is not part of the interface and could be pulled to a separate library.
  195. target_sources(leveldb
  196. PRIVATE
  197. "helpers/memenv/memenv.cc"
  198. "helpers/memenv/memenv.h"
  199. )
  200. target_include_directories(leveldb
  201. PUBLIC
  202. $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
  203. $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
  204. )
  205. set_target_properties(leveldb
  206. PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
  207. target_compile_definitions(leveldb
  208. PRIVATE
  209. # Used by include/export.h when building shared libraries.
  210. LEVELDB_COMPILE_LIBRARY
  211. # Used by port/port.h.
  212. ${LEVELDB_PLATFORM_NAME}=1
  213. )
  214. if (NOT HAVE_CXX17_HAS_INCLUDE)
  215. target_compile_definitions(leveldb
  216. PRIVATE
  217. LEVELDB_HAS_PORT_CONFIG_H=1
  218. )
  219. endif(NOT HAVE_CXX17_HAS_INCLUDE)
  220. if(BUILD_SHARED_LIBS)
  221. target_compile_definitions(leveldb
  222. PUBLIC
  223. # Used by include/export.h.
  224. LEVELDB_SHARED_LIBRARY
  225. )
  226. endif(BUILD_SHARED_LIBS)
  227. if(HAVE_CLANG_THREAD_SAFETY)
  228. target_compile_options(leveldb
  229. PUBLIC
  230. -Werror -Wthread-safety)
  231. endif(HAVE_CLANG_THREAD_SAFETY)
  232. if(HAVE_CRC32C)
  233. target_link_libraries(leveldb crc32c)
  234. endif(HAVE_CRC32C)
  235. if(HAVE_SNAPPY)
  236. target_link_libraries(leveldb snappy)
  237. endif(HAVE_SNAPPY)
  238. if(HAVE_TCMALLOC)
  239. target_link_libraries(leveldb tcmalloc)
  240. endif(HAVE_TCMALLOC)
  241. # Needed by port_stdcxx.h
  242. find_package(Threads REQUIRED)
  243. target_link_libraries(leveldb Threads::Threads)
  244. add_executable(leveldbutil
  245. "db/leveldbutil.cc"
  246. )
  247. target_link_libraries(leveldbutil leveldb)
  248. if(LEVELDB_BUILD_TESTS)
  249. enable_testing()
  250. function(leveldb_test test_file)
  251. get_filename_component(test_target_name "${test_file}" NAME_WE)
  252. add_executable("${test_target_name}" "")
  253. target_sources("${test_target_name}"
  254. PRIVATE
  255. "${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h"
  256. "util/testharness.cc"
  257. "util/testharness.h"
  258. "util/testutil.cc"
  259. "util/testutil.h"
  260. "${test_file}"
  261. )
  262. target_link_libraries("${test_target_name}" leveldb)
  263. target_compile_definitions("${test_target_name}"
  264. PRIVATE
  265. ${LEVELDB_PLATFORM_NAME}=1
  266. )
  267. if (NOT HAVE_CXX17_HAS_INCLUDE)
  268. target_compile_definitions("${test_target_name}"
  269. PRIVATE
  270. LEVELDB_HAS_PORT_CONFIG_H=1
  271. )
  272. endif(NOT HAVE_CXX17_HAS_INCLUDE)
  273. add_test(NAME "${test_target_name}" COMMAND "${test_target_name}")
  274. endfunction(leveldb_test)
  275. leveldb_test("db/c_test.c")
  276. leveldb_test("db/fault_injection_test.cc")
  277. leveldb_test("issues/issue178_test.cc")
  278. leveldb_test("issues/issue200_test.cc")
  279. leveldb_test("issues/issue320_test.cc")
  280. leveldb_test("util/env_test.cc")
  281. leveldb_test("util/status_test.cc")
  282. leveldb_test("util/no_destructor_test.cc")
  283. if(NOT BUILD_SHARED_LIBS)
  284. leveldb_test("db/autocompact_test.cc")
  285. leveldb_test("db/corruption_test.cc")
  286. leveldb_test("db/db_test.cc")
  287. leveldb_test("db/dbformat_test.cc")
  288. leveldb_test("db/filename_test.cc")
  289. leveldb_test("db/log_test.cc")
  290. leveldb_test("db/recovery_test.cc")
  291. leveldb_test("db/skiplist_test.cc")
  292. leveldb_test("db/version_edit_test.cc")
  293. leveldb_test("db/version_set_test.cc")
  294. leveldb_test("db/write_batch_test.cc")
  295. leveldb_test("helpers/memenv/memenv_test.cc")
  296. leveldb_test("table/filter_block_test.cc")
  297. leveldb_test("table/table_test.cc")
  298. leveldb_test("util/arena_test.cc")
  299. leveldb_test("util/bloom_test.cc")
  300. leveldb_test("util/cache_test.cc")
  301. leveldb_test("util/coding_test.cc")
  302. leveldb_test("util/crc32c_test.cc")
  303. leveldb_test("util/hash_test.cc")
  304. leveldb_test("util/logging_test.cc")
  305. # TODO(costan): This test also uses
  306. # "util/env_{posix|windows}_test_helper.h"
  307. if (WIN32)
  308. leveldb_test("util/env_windows_test.cc")
  309. else (WIN32)
  310. leveldb_test("util/env_posix_test.cc")
  311. endif (WIN32)
  312. endif(NOT BUILD_SHARED_LIBS)
  313. endif(LEVELDB_BUILD_TESTS)
  314. if(LEVELDB_BUILD_BENCHMARKS)
  315. function(leveldb_benchmark bench_file)
  316. get_filename_component(bench_target_name "${bench_file}" NAME_WE)
  317. add_executable("${bench_target_name}" "")
  318. target_sources("${bench_target_name}"
  319. PRIVATE
  320. "${PROJECT_BINARY_DIR}/${LEVELDB_PORT_CONFIG_DIR}/port_config.h"
  321. "util/histogram.cc"
  322. "util/histogram.h"
  323. "util/testharness.cc"
  324. "util/testharness.h"
  325. "util/testutil.cc"
  326. "util/testutil.h"
  327. "${bench_file}"
  328. )
  329. target_link_libraries("${bench_target_name}" leveldb)
  330. target_compile_definitions("${bench_target_name}"
  331. PRIVATE
  332. ${LEVELDB_PLATFORM_NAME}=1
  333. )
  334. if (NOT HAVE_CXX17_HAS_INCLUDE)
  335. target_compile_definitions("${bench_target_name}"
  336. PRIVATE
  337. LEVELDB_HAS_PORT_CONFIG_H=1
  338. )
  339. endif(NOT HAVE_CXX17_HAS_INCLUDE)
  340. endfunction(leveldb_benchmark)
  341. if(NOT BUILD_SHARED_LIBS)
  342. leveldb_benchmark("benchmarks/db_bench.cc")
  343. endif(NOT BUILD_SHARED_LIBS)
  344. check_library_exists(sqlite3 sqlite3_open "" HAVE_SQLITE3)
  345. if(HAVE_SQLITE3)
  346. leveldb_benchmark("benchmarks/db_bench_sqlite3.cc")
  347. target_link_libraries(db_bench_sqlite3 sqlite3)
  348. endif(HAVE_SQLITE3)
  349. # check_library_exists is insufficient here because the library names have
  350. # different manglings when compiled with clang or gcc, at least when installed
  351. # with Homebrew on Mac.
  352. set(OLD_CMAKE_REQURED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
  353. list(APPEND CMAKE_REQUIRED_LIBRARIES kyotocabinet)
  354. check_cxx_source_compiles("
  355. #include <kcpolydb.h>
  356. int main() {
  357. kyotocabinet::TreeDB* db = new kyotocabinet::TreeDB();
  358. delete db;
  359. return 0;
  360. }
  361. " HAVE_KYOTOCABINET)
  362. set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQURED_LIBRARIES})
  363. if(HAVE_KYOTOCABINET)
  364. leveldb_benchmark("benchmarks/db_bench_tree_db.cc")
  365. target_link_libraries(db_bench_tree_db kyotocabinet)
  366. endif(HAVE_KYOTOCABINET)
  367. endif(LEVELDB_BUILD_BENCHMARKS)
  368. if(LEVELDB_INSTALL)
  369. install(TARGETS leveldb
  370. EXPORT leveldbTargets
  371. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  372. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  373. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  374. )
  375. install(
  376. FILES
  377. "${LEVELDB_PUBLIC_INCLUDE_DIR}/c.h"
  378. "${LEVELDB_PUBLIC_INCLUDE_DIR}/cache.h"
  379. "${LEVELDB_PUBLIC_INCLUDE_DIR}/comparator.h"
  380. "${LEVELDB_PUBLIC_INCLUDE_DIR}/db.h"
  381. "${LEVELDB_PUBLIC_INCLUDE_DIR}/dumpfile.h"
  382. "${LEVELDB_PUBLIC_INCLUDE_DIR}/env.h"
  383. "${LEVELDB_PUBLIC_INCLUDE_DIR}/export.h"
  384. "${LEVELDB_PUBLIC_INCLUDE_DIR}/filter_policy.h"
  385. "${LEVELDB_PUBLIC_INCLUDE_DIR}/iterator.h"
  386. "${LEVELDB_PUBLIC_INCLUDE_DIR}/options.h"
  387. "${LEVELDB_PUBLIC_INCLUDE_DIR}/slice.h"
  388. "${LEVELDB_PUBLIC_INCLUDE_DIR}/status.h"
  389. "${LEVELDB_PUBLIC_INCLUDE_DIR}/table_builder.h"
  390. "${LEVELDB_PUBLIC_INCLUDE_DIR}/table.h"
  391. "${LEVELDB_PUBLIC_INCLUDE_DIR}/write_batch.h"
  392. DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/leveldb"
  393. )
  394. include(CMakePackageConfigHelpers)
  395. configure_package_config_file(
  396. "cmake/${PROJECT_NAME}Config.cmake.in"
  397. "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake"
  398. INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
  399. )
  400. write_basic_package_version_file(
  401. "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake"
  402. COMPATIBILITY SameMajorVersion
  403. )
  404. install(
  405. EXPORT leveldbTargets
  406. NAMESPACE leveldb::
  407. DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
  408. )
  409. install(
  410. FILES
  411. "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake"
  412. "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake"
  413. DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
  414. )
  415. endif(LEVELDB_INSTALL)