diff options
-rwxr-xr-x | CMakeLists.txt | 4 | ||||
-rw-r--r-- | cmake/modules/FindBDB.cmake | 49 | ||||
-rw-r--r-- | cmake/modules/FindDB.cmake | 49 | ||||
-rw-r--r-- | src/libicalss/CMakeLists.txt | 4 |
4 files changed, 53 insertions, 53 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a168281..3ef57eaa 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,8 +77,8 @@ set(PROJECT_URL "http://libical.github.io/libical/") # compile in Berkeley DB support option(WITH_BDB "Build in Berkeley DB Support. Requires pre-installed Berkeley DB development toolkit") if(WITH_BDB) - find_package(DB) - if(DB_FOUND) + find_package(BDB) + if(BDB_FOUND) add_definitions(-DWITH_BDB) else() message(FATAL_ERROR "Cannot build the Berkeley DB storage support as requested. Unable to the locate the pre-installed Berkeley DB development toolkit.") diff --git a/cmake/modules/FindBDB.cmake b/cmake/modules/FindBDB.cmake new file mode 100644 index 00000000..341e1fda --- /dev/null +++ b/cmake/modules/FindBDB.cmake @@ -0,0 +1,49 @@ +# Finds the Berkeley DB Library +# +# BDB_FOUND - True if Berkeley DB found. +# BDB_INCLUDE_DIR - Directory to include to get Berkeley DB headers +# BDB_LIBRARY - Library to link against for the Berkeley DB +# + +if(BDB_INCLUDE_DIR AND BDB_LIBRARY) + # Already in cache, be silent + set(BDB_FIND_QUIETLY TRUE) +endif() + +# Look for the header file. +find_path( + BDB_INCLUDE_DIR + NAMES db.h + HINTS /usr/local/opt/db/include + DOC "Include directory for the Berkeley DB library" +) +mark_as_advanced(BDB_INCLUDE_DIR) + +# Look for the library. +find_library( + BDB_LIBRARY + NAMES db + HINTS /usr/local/opt/db4/lib + DOC "Libraries to link against for the Berkeley DB" +) +mark_as_advanced(BDB_LIBRARY) + +# Copy the results to the output variables. +if(BDB_INCLUDE_DIR AND BDB_LIBRARY) + set(BDB_FOUND 1) +else() + set(BDB_FOUND 0) +endif() + +if(BDB_FOUND) + if(NOT BDB_FIND_QUIETLY) + message(STATUS "Found Berkeley DB header files in ${BDB_INCLUDE_DIR}") + message(STATUS "Found Berkeley libraries: ${BDB_LIBRARY}") + endif() +else() + if(BDB_FIND_REQUIRED) + message(FATAL_ERROR "Could not find Berkeley DB") + else() + message(STATUS "Optional package Berkeley DB was not found") + endif() +endif() diff --git a/cmake/modules/FindDB.cmake b/cmake/modules/FindDB.cmake deleted file mode 100644 index 5449136d..00000000 --- a/cmake/modules/FindDB.cmake +++ /dev/null @@ -1,49 +0,0 @@ -# Finds the Berkeley DB Library -# -# DB_FOUND - True if Berkeley DB found. -# DB_INCLUDE_DIR - Directory to include to get Berkeley DB headers -# DB_LIBRARY - Library to link against for the Berkeley DB -# - -if(DB_INCLUDE_DIR AND DB_LIBRARY) - # Already in cache, be silent - set(DB_FIND_QUIETLY TRUE) -endif() - -# Look for the header file. -find_path( - DB_INCLUDE_DIR - NAMES db.h - HINTS /usr/local/opt/db/include - DOC "Include directory for the Berkeley DB library" -) -mark_as_advanced(DB_INCLUDE_DIR) - -# Look for the library. -find_library( - DB_LIBRARY - NAMES db - HINTS /usr/local/opt/db4/lib - DOC "Libraries to link against for the Berkeley DB" -) -mark_as_advanced(DB_LIBRARY) - -# Copy the results to the output variables. -if(DB_INCLUDE_DIR AND DB_LIBRARY) - set(DB_FOUND 1) -else() - set(DB_FOUND 0) -endif() - -if(DB_FOUND) - if(NOT DB_FIND_QUIETLY) - message(STATUS "Found Berkeley DB header files in ${DB_INCLUDE_DIR}") - message(STATUS "Found Berkeley libraries: ${DB_LIBRARY}") - endif() -else() - if(DB_FIND_REQUIRED) - message(FATAL_ERROR "Could not find Berkeley DB") - else() - message(STATUS "Optional package Berkeley DB was not found") - endif() -endif() diff --git a/src/libicalss/CMakeLists.txt b/src/libicalss/CMakeLists.txt index 33ec6c32..0db3be91 100644 --- a/src/libicalss/CMakeLists.txt +++ b/src/libicalss/CMakeLists.txt @@ -5,7 +5,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/src/libical ${CMAKE_BINARY_DIR}/src/libical ) if(WITH_BDB) - include_directories(${DB_INCLUDE_DIR}) + include_directories(${BDB_INCLUDE_DIR}) endif() if(WIN32) @@ -87,7 +87,7 @@ endif() target_link_libraries(icalss ical) if(WITH_BDB) - target_link_libraries(icalss ${DB_LIBRARY}) + target_link_libraries(icalss ${BDB_LIBRARY}) endif() if(MSVC) |