Merge pull request #218 from selsta/mac-system-unbound

cmake: fix build with system unbound on mac
This commit is contained in:
moneroexamples 2020-09-05 14:36:25 +08:00 committed by GitHub
commit 70ffcf68d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -76,8 +76,20 @@ if(APPLE)
link_directories(/usr/local/lib)
endif()
MESSAGE(STATUS "Looking for libunbound") # FindUnbound.cmake from monero repo
FIND_PATH(UNBOUND_INCLUDE_DIR
NAMES unbound.h
PATH_SUFFIXES include/ include/unbound/
PATHS "${PROJECT_SOURCE_DIR}"
${UNBOUND_ROOT}
$ENV{UNBOUND_ROOT}
/usr/local/
/usr/
)
find_library (UNBOUND_LIBRARY unbound)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32 OR (${UNBOUND_LIBRARY} STREQUAL "UNBOUND_LIBRARY-NOTFOUND"))
if (WIN32 OR (${UNBOUND_LIBRARY} STREQUAL "UNBOUND_LIBRARY-NOTFOUND"))
add_library(unbound STATIC IMPORTED)
set_property(TARGET unbound PROPERTY IMPORTED_LOCATION ${MONERO_BUILD_DIR}/external/unbound/libunbound.a)
endif()