]> git.saurik.com Git - apt.git/blobdiff - CMake/FindBerkeleyDB.cmake
CMake: Handle Berkeley DB on FreeBSD
[apt.git] / CMake / FindBerkeleyDB.cmake
index 44cfd3ddbe798e7c66f3b2bd693b473b7d4101c9..34bc3b0d16d48d5fb53a8321cb2cc7e0a322e08e 100644 (file)
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
+# We need NO_DEFAULT_PATH here, otherwise CMake helpfully picks up the wrong
+# db.h on BSD systems instead of the Berkeley DB one.
 find_path(BERKELEY_DB_INCLUDE_DIRS db.h
-  /usr/include/db5
+  ${CMAKE_INSTALL_FULL_INCLUDEDIR}/db5
   /usr/local/include/db5
-  /usr/include/db4
+  /usr/include/db5
+
+  ${CMAKE_INSTALL_FULL_INCLUDEDIR}/db4
   /usr/local/include/db4
+  /usr/include/db4
+
+  ${CMAKE_INSTALL_FULL_INCLUDEDIR}
+  /usr/local/include
+  /usr/include
+
+  NO_DEFAULT_PATH
 )
 
-find_library(BERKELEY_DB_LIBRARIES NAMES db )
+find_library(BERKELEY_DB_LIBRARIES NAMES db db-5)
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Berkeley "Could not find Berkeley DB >= 4.1" BERKELEY_DB_INCLUDE_DIRS BERKELEY_DB_LIBRARIES)