2017-08-30 23:28:33 +00:00
|
|
|
# - Try to find MHD
|
|
|
|
# Once done this will define
|
|
|
|
#
|
|
|
|
# MHD_FOUND - system has MHD
|
|
|
|
# MHD_INCLUDE_DIRS - the MHD include directory
|
|
|
|
# MHD_LIBRARY - Link these to use MHD
|
|
|
|
|
|
|
|
find_path(
|
|
|
|
MHD_INCLUDE_DIR
|
|
|
|
NAMES microhttpd.h
|
2018-02-20 17:52:52 +00:00
|
|
|
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
|
|
|
PATH_SUFFIXES "include"
|
2017-08-30 23:28:33 +00:00
|
|
|
DOC "microhttpd include dir"
|
2018-03-14 12:58:38 +00:00
|
|
|
NO_DEFAULT_PATH
|
2017-08-30 23:28:33 +00:00
|
|
|
)
|
|
|
|
|
2018-03-13 23:32:43 +00:00
|
|
|
find_path(MHD_INCLUDE_DIR NAMES microhttpd.h)
|
|
|
|
|
2017-08-30 23:28:33 +00:00
|
|
|
find_library(
|
|
|
|
MHD_LIBRARY
|
2018-03-14 12:58:38 +00:00
|
|
|
NAMES libmicrohttpd.a microhttpd libmicrohttpd
|
2018-02-20 17:52:52 +00:00
|
|
|
PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS"
|
|
|
|
PATH_SUFFIXES "lib"
|
2017-08-30 23:28:33 +00:00
|
|
|
DOC "microhttpd library"
|
2018-03-14 12:58:38 +00:00
|
|
|
NO_DEFAULT_PATH
|
2017-08-30 23:28:33 +00:00
|
|
|
)
|
|
|
|
|
2018-03-13 23:32:43 +00:00
|
|
|
find_library(MHD_LIBRARY NAMES microhttpd libmicrohttpd)
|
|
|
|
|
2017-08-30 23:28:33 +00:00
|
|
|
set(MHD_INCLUDE_DIRS ${MHD_INCLUDE_DIR})
|
|
|
|
set(MHD_LIBRARIES ${MHD_LIBRARY})
|
|
|
|
|
|
|
|
# debug library on windows
|
|
|
|
# same naming convention as in qt (appending debug library with d)
|
|
|
|
# boost is using the same "hack" as us with "optimized" and "debug"
|
|
|
|
# official MHD project actually uses _d suffix
|
2017-09-02 16:04:40 +00:00
|
|
|
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
|
2017-08-30 23:28:33 +00:00
|
|
|
find_library(
|
|
|
|
MHD_LIBRARY_DEBUG
|
|
|
|
NAMES microhttpd_d microhttpd-10_d libmicrohttpd_d libmicrohttpd-dll_d
|
|
|
|
DOC "mhd debug library"
|
|
|
|
)
|
|
|
|
set(MHD_LIBRARIES optimized ${MHD_LIBRARIES} debug ${MHD_LIBRARY_DEBUG})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2018-02-20 17:52:52 +00:00
|
|
|
find_package_handle_standard_args(MHD DEFAULT_MSG MHD_LIBRARY MHD_INCLUDE_DIR)
|
2017-08-30 23:28:33 +00:00
|
|
|
mark_as_advanced(MHD_INCLUDE_DIR MHD_LIBRARY)
|
|
|
|
|