FindRocksDB.cmake 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Find rocksdb
  2. #
  3. # Find the rocksdb includes and library
  4. #
  5. # if you nee to add a custom library search path, do it via via CMAKE_PREFIX_PATH
  6. #
  7. # This module defines
  8. # ROCKSDB_INCLUDE_DIRS, where to find header, etc.
  9. # ROCKSDB_LIBRARIES, the libraries needed to use rocksdb.
  10. # ROCKSDB_FOUND, If false, do not try to use rocksdb.
  11. # only look in default directories
  12. find_path(
  13. ROCKSDB_INCLUDE_DIR
  14. NAMES rocksdb/db.h
  15. DOC "rocksdb include dir"
  16. )
  17. find_library(
  18. ROCKSDB_LIBRARY
  19. NAMES rocksdb
  20. DOC "rocksdb library"
  21. )
  22. set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR})
  23. set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY})
  24. # debug library on windows
  25. # same naming convention as in qt (appending debug library with d)
  26. # boost is using the same "hack" as us with "optimized" and "debug"
  27. if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
  28. find_library(
  29. ROCKSDB_LIBRARY_DEBUG
  30. NAMES rocksdbd
  31. DOC "rocksdb debug library"
  32. )
  33. set(ROCKSDB_LIBRARIES optimized ${ROCKSDB_LIBRARIES} debug ${ROCKSDB_LIBRARY_DEBUG})
  34. endif()
  35. # handle the QUIETLY and REQUIRED arguments and set ROCKSDB_FOUND to TRUE
  36. # if all listed variables are TRUE, hide their existence from configuration view
  37. include(FindPackageHandleStandardArgs)
  38. find_package_handle_standard_args(RocksDB DEFAULT_MSG
  39. ROCKS_DB_LIBRARY ROCKSDB_INCLUDE_DIR)
  40. mark_as_advanced (ROCKSDB_INCLUDE_DIR ROCKSDB_LIBRARY)