diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2015-06-28 21:13:02 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-06-28 21:16:29 +0200 |
commit | 0769233ac2047278a7cdc2954fc46f4b2f59ed67 (patch) | |
tree | f2562c2581270da006bab0556f898eed8af7a4ee /kbabel/kbabeldict/modules/dbsearchengine/ConfigureChecks.cmake | |
parent | 7c73823e9f1619e471779c8f203b2774ca04fefd (diff) | |
download | tdesdk-0769233ac2047278a7cdc2954fc46f4b2f59ed67.tar.gz tdesdk-0769233ac2047278a7cdc2954fc46f4b2f59ed67.zip |
Improve berkeley db detection with CMake
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit a539938d4b6828063357dbd1e9f3c2808c1629c2)
Diffstat (limited to 'kbabel/kbabeldict/modules/dbsearchengine/ConfigureChecks.cmake')
-rw-r--r-- | kbabel/kbabeldict/modules/dbsearchengine/ConfigureChecks.cmake | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/kbabel/kbabeldict/modules/dbsearchengine/ConfigureChecks.cmake b/kbabel/kbabeldict/modules/dbsearchengine/ConfigureChecks.cmake index 3c03cff1..7dd8a1a9 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine/ConfigureChecks.cmake +++ b/kbabel/kbabeldict/modules/dbsearchengine/ConfigureChecks.cmake @@ -9,13 +9,18 @@ # ################################################# +find_file( USE_DB_H_PATH NAMES "db5/db.h" "db4/db.h" "db.h" ) + check_c_source_compiles(" - #include <db.h> - void main() { DB *db; db->open(db, 0, 0, NULL, DB_BTREE, DB_CREATE, 0644); } " + #include <${USE_DB_H_PATH}> + #include <stddef.h> + int main() { DB *db; db->open(db, 0, 0, NULL, DB_BTREE, DB_CREATE, 0644); } " HAVE_BERKELEY_DB ) if( HAVE_BERKELEY_DB ) - set( BDB_LIBRARY db ) -else( ) + find_library( BDB_LIBRARY db PATH_SUFFIXES db5 db4 ) +endif( ) + +if( NOT BDB_LIBRARY ) tde_message_fatal( "berkeley db is required, but was not found on your system" ) endif( ) |