FindMHD.cmake 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # - Try to find MHD
  2. # Once done this will define
  3. #
  4. # MHD_FOUND - system has MHD
  5. # MHD_INCLUDE_DIRS - the MHD include directory
  6. # MHD_LIBRARY - Link these to use MHD
  7. find_path(
  8. MHD_INCLUDE_DIR
  9. NAMES microhttpd.h
  10. DOC "microhttpd include dir"
  11. )
  12. find_library(
  13. MHD_LIBRARY
  14. NAMES microhttpd microhttpd-10 libmicrohttpd libmicrohttpd-dll
  15. DOC "microhttpd library"
  16. )
  17. set(MHD_INCLUDE_DIRS ${MHD_INCLUDE_DIR})
  18. set(MHD_LIBRARIES ${MHD_LIBRARY})
  19. # debug library on windows
  20. # same naming convention as in qt (appending debug library with d)
  21. # boost is using the same "hack" as us with "optimized" and "debug"
  22. # official MHD project actually uses _d suffix
  23. if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
  24. find_library(
  25. MHD_LIBRARY_DEBUG
  26. NAMES microhttpd_d microhttpd-10_d libmicrohttpd_d libmicrohttpd-dll_d
  27. DOC "mhd debug library"
  28. )
  29. set(MHD_LIBRARIES optimized ${MHD_LIBRARIES} debug ${MHD_LIBRARY_DEBUG})
  30. endif()
  31. include(FindPackageHandleStandardArgs)
  32. find_package_handle_standard_args(mhd DEFAULT_MSG
  33. MHD_INCLUDE_DIR MHD_LIBRARY)
  34. mark_as_advanced(MHD_INCLUDE_DIR MHD_LIBRARY)