Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MSVC compatibility: Removed dependency on BDB C API- we still used BD…
…B_CXX. Use versioned library name with MSVC
- Loading branch information
Showing
1 changed file
with
14 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,33 @@ | ||
# Try to find the BerkeleyDB librairies | ||
# BDB_FOUND - system has Berkeley DB lib | ||
# BDB_INCLUDE_DIR - the Berkeley DB include directory | ||
# BDB_LIBRARY - Library needed to use Berkeley DB | ||
# BDBXX_INCLUDE_DIR - the Berkeley DB include directory for C++ | ||
# BDBXX_LIBRARY - Library needed to use Berkeley DB C++ API | ||
|
||
include(BrewHelper) | ||
find_brew_prefix(BREW_HINT berkeley-db) | ||
|
||
find_path(BDB_INCLUDE_DIR | ||
NAMES | ||
db.h | ||
HINTS ${BREW_HINT} | ||
) | ||
find_library(BDB_LIBRARY | ||
NAMES | ||
db libdb | ||
HINTS ${BREW_HINT} | ||
) | ||
|
||
find_path(BDBXX_INCLUDE_DIR | ||
NAMES | ||
db_cxx.h | ||
HINTS ${BREW_HINT} | ||
) | ||
find_library(BDBXX_LIBRARY | ||
NAMES | ||
db_cxx libdb_cxx | ||
HINTS ${BREW_HINT} | ||
if (MSVC) | ||
# MSVC and VCPKG package manager use versioned library name | ||
find_library(BDBXX_LIBRARY NAMES libdb48) | ||
else() | ||
find_library(BDBXX_LIBRARY | ||
NAMES | ||
db_cxx libdb_cxx | ||
HINTS ${BREW_HINT} | ||
) | ||
endif() | ||
|
||
MESSAGE(STATUS "BerkeleyDB libs: " ${BDB_LIBRARY} " " ${BDBXX_LIBRARY}) | ||
MESSAGE(STATUS "BerkeleyDB libs: " ${BDBXX_LIBRARY}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(BerkeleyDB DEFAULT_MSG BDB_INCLUDE_DIR BDB_LIBRARY BDBXX_INCLUDE_DIR BDBXX_LIBRARY) | ||
find_package_handle_standard_args(BerkeleyDB DEFAULT_MSG BDBXX_INCLUDE_DIR BDBXX_LIBRARY) | ||
|
||
mark_as_advanced(BDB_INCLUDE_DIR BDB_LIBRARY BDBXX_INCLUDE_DIR BDBXX_LIBRARY) | ||
mark_as_advanced(BDBXX_INCLUDE_DIR BDBXX_LIBRARY) | ||
|
||
set(BerkeleyDB_LIBRARIES ${BDB_LIBRARY} ${BDBXX_LIBRARY}) | ||
set(BerkeleyDB_INCLUDE_DIRS ${BDB_INCLUDE_DIR} ${BDBXX_INCLUDE_DIR}) | ||
set(BerkeleyDB_LIBRARIES ${BDBXX_LIBRARY}) | ||
set(BerkeleyDB_INCLUDE_DIRS ${BDBXX_INCLUDE_DIR}) |