Skip to content

Commit

Permalink
Fixed mDNSResponder detection without a path
Browse files Browse the repository at this point in the history
  • Loading branch information
breese committed Jun 20, 2018
1 parent d6c1eab commit 951eec4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cmake/FindDNSSD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else() # Posix
find_package(Avahi QUIET)
endif()

if (NOT DNSSD_FOUND AND DNSSD_WITH_MDNSRESPONDER)
if (NOT DNSSD_FOUND)
if (NOT DNSSD_WITH_MDNSRESPONDER STREQUAL "")
set(mDNSResponder_BUILD_DIR ${DNSSD_WITH_MDNSRESPONDER})
endif()
Expand Down
16 changes: 5 additions & 11 deletions cmake/FindmDNSResponder.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,15 @@
#
# Defines DNSSD::mDNSResponder imported target

if (mDNSResponder_BUILD_DIR)
set(mDNSResponder_INCDIR "${mDNSResponder_BUILD_DIR}/mDNSShared")
set(mDNSResponder_LIBDIR "${mDNSResponder_BUILD_DIR}/mDNSPosix/build/prod")
endif()

find_path(mDNSResponder_INCLUDE_DIR
NAMES dns_sd.h
PATHS "${mDNSResponder_INCDIR}")
PATHS "${mDNSResponder_BUILD_DIR}"
PATH_SUFFIXES mDNSShared)

find_library(mDNSResponder_LIBRARY
NAMES dns_sd
PATHS "${mDNSResponder_LIBDIR}"
)
PATHS "${mDNSResponder_BUILD_DIR}"
PATH_SUFFIXES mDNSPosix/build/prod)

set(mDNSResponder_FOUND FALSE CACHE BOOL "" FORCE)
if (mDNSResponder_INCLUDE_DIR AND mDNSResponder_LIBRARY)
Expand Down Expand Up @@ -75,6 +71,4 @@ mark_as_advanced(
mDNSResponder_FOUND
mDNSResponder_VERSION
mDNSResponder_INCLUDE_DIR
mDNSResponder_LIBRARY
mDNSResponder_INCDIR
mDNSResponder_LIBDIR)
mDNSResponder_LIBRARY)

0 comments on commit 951eec4

Please sign in to comment.