X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=CMakeLists.txt;h=68e5e30576fc3a51efd10c45e4a2de7c56a76757;hb=b89ba58c9e52695daed33c34c7a8eea5dcff660b;hp=0e6bc573eb75e4cb3ed502a1887c7481c28ef213;hpb=7af88cbea323cfb264a57883f8faeda241ed78e2;p=novacoin.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e6bc57..68e5e30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,15 @@ endif() # Set default library path for berkeley db if (NOT BerkeleyDB_LIBS) set(BerkeleyDB_LIBS ${BerkeleyDB_ROOT}/lib) +if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +# Workaround for linux distributions +set(BerkeleyDB_LIBS ${BerkeleyDB_LIBS}/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu) +endif() +endif() + +# Set default library name for berkeley db +if (NOT BerkeleyDB_LIB_name) +set(BerkeleyDB_LIB_name libdb_cxx) endif() set(generic_sources @@ -194,16 +203,16 @@ if (NOT WIN32 AND NOT APPLE) endif() # Try various libdb library file extensions -if (EXISTS ${BerkeleyDB_LIBS}/libdb_cxx.a) - list(APPEND ALL_LIBRARIES ${BerkeleyDB_LIBS}/libdb_cxx.a) -elseif(EXISTS ${BerkeleyDB_LIBS}/libdb_cxx.so) - list(APPEND ALL_LIBRARIES ${BerkeleyDB_LIBS}/libdb_cxx.so) -elseif(EXISTS ${BerkeleyDB_LIBS}/libdb_cxx.dylib) - list(APPEND ALL_LIBRARIES ${BerkeleyDB_LIBS}/libdb_cxx.dylib) -elseif(EXISTS ${BerkeleyDB_LIBS}/libdb_cxx.dll) - list(APPEND ALL_LIBRARIES ${BerkeleyDB_LIBS}/libdb_cxx.dll) +if (EXISTS ${BerkeleyDB_LIBS}/${BerkeleyDB_LIB_name}.a) + list(APPEND ALL_LIBRARIES ${BerkeleyDB_LIBS}/${BerkeleyDB_LIB_name}.a) +elseif(EXISTS ${BerkeleyDB_LIBS}/${BerkeleyDB_LIB_name}.so) + list(APPEND ALL_LIBRARIES ${BerkeleyDB_LIBS}/${BerkeleyDB_LIB_name}.so) +elseif(EXISTS ${BerkeleyDB_LIBS}/${BerkeleyDB_LIB_name}.dylib) + list(APPEND ALL_LIBRARIES ${BerkeleyDB_LIBS}/${BerkeleyDB_LIB_name}.dylib) +elseif(EXISTS ${BerkeleyDB_LIBS}/${BerkeleyDB_LIB_name}.lib) + list(APPEND ALL_LIBRARIES ${BerkeleyDB_LIBS}/${BerkeleyDB_LIB_name}.lib) else() - message(FATAL_ERROR "Unable to find libdb_cxx library in ${BerkeleyDB_LIBS} directory. Try to specify either library path via BerkeleyDB_LIBS or berkeley db root path via BerkeleyDB_ROOT variable.") + message(FATAL_ERROR "Unable to find ${BerkeleyDB_LIB_name} library in ${BerkeleyDB_LIBS} directory. Try to specify either library path via BerkeleyDB_LIBS or berkeley db root path via BerkeleyDB_ROOT variable. You can also use BerkeleyDB_LIB_name variable to provide alternative file name search for.") endif() list(APPEND ALL_DEFINITIONS QT_GUI USE_QRCODE USE_IPV6)